:root {
  --accent: #1f10e0;
  --accent-weak: #eceafd;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e4e6ea;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --ok: #0f9d58;
  --ok-weak: #e7f6ee;
  --warn: #d97706;
  --warn-weak: #fdf3e3;
  --danger: #d64545;
  --danger-weak: #fdeaea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 35, 41, .05), 0 4px 12px rgba(31, 35, 41, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }

.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.topbar .spacer { flex: 1; }

.who { color: var(--text-2); font-size: 13px; white-space: nowrap; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

label.field { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }

select, input[type=text], input[type=password], input[type=number] {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
  min-width: 160px;
}

select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }

select.cs-select { min-width: 220px; max-width: 100%; }

.btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}

.btn:hover { border-color: #c9cdd4; background: #fafbfc; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a0dc4; }
.btn.ghost { background: transparent; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat .k { color: var(--text-2); font-size: 12px; }
.stat .v { font-size: 26px; font-weight: 600; line-height: 1.25; margin-top: 2px; }
.stat .u { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 3px; }
.stat.accent .v { color: var(--accent); }
.stat.ok .v { color: var(--ok); }

h2.sec {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h2.sec .count {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-3);
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 12px; }

.store {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
  position: relative;
}

.store.in { border-color: #b9e3cc; background: linear-gradient(0deg, var(--ok-weak), var(--ok-weak)); }

.store .name { font-weight: 600; font-size: 14px; margin-bottom: 8px; word-break: break-all; }

.store .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f2f3f5;
  color: var(--text-2);
  white-space: nowrap;
}

.tag.in { background: var(--ok); color: #fff; font-weight: 600; }
.tag.stay { background: #fff7e6; color: var(--warn); }
.tag.new { background: var(--accent-weak); color: var(--accent); }
.tag.off { background: var(--danger-weak); color: var(--danger); }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }

th { color: var(--text-2); font-weight: 500; background: #fafbfc; position: sticky; top: 0; }

tbody tr:hover { background: #fafbfc; }
tbody tr.in { background: var(--ok-weak); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.in-strong { color: var(--ok); font-weight: 600; }

.empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 13px; }

.muted { color: var(--text-3); font-size: 12px; }

.banner {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}

.banner.show { display: block; }
.banner.err { background: var(--danger-weak); color: var(--danger); }
.banner.warn { background: var(--warn-weak); color: var(--warn); }

.trend { width: 100%; height: 120px; display: block; }

.switch { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; cursor: pointer; }

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.login-card h1 { font-size: 17px; margin: 0 0 4px; }
.login-card p.sub { color: var(--text-3); font-size: 13px; margin: 0 0 20px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.login-card input { width: 100%; height: 38px; margin-bottom: 14px; }
.login-card .btn { width: 100%; height: 38px; }

/* ===== 全员在店总览 ===== */

.focus-box {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(0deg, var(--accent-weak), var(--accent-weak));
}

.focus-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; justify-content: space-between; }
.focus-left { display: flex; align-items: baseline; gap: 10px; }
.focus-idx {
  font-size: 12px; color: var(--accent); background: #fff;
  border-radius: 20px; padding: 2px 9px; font-variant-numeric: tabular-nums;
}
.focus-name { font-size: 17px; font-weight: 600; }
.focus-right { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.focus-big { font-size: 30px; font-weight: 600; color: var(--accent); line-height: 1; }
.focus-unit { font-size: 13px; color: var(--text-2); margin-right: 6px; }
.focus-sub { font-size: 12px; color: var(--text-2); }
.focus-stores { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.ov-cards { max-height: 340px; overflow-y: auto; padding-right: 2px; }

.ov-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ov-card:hover { border-color: #c9cdd4; }
.ov-card.focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.ov-card.focus .ov-big { color: var(--accent); }

.ov-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-big { font-size: 24px; font-weight: 600; line-height: 1.2; color: var(--ok); font-variant-numeric: tabular-nums; }
.ov-big .u { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 2px; }
.ov-sub { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

.bar { height: 4px; background: #eef0f3; border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }

@media (max-width: 760px) {
  .ov-cards { max-height: 420px; }
  .focus-right { width: 100%; }
  .focus-big { font-size: 26px; }
}

@media (max-width: 760px) {
  .wrap { padding: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 12px; }
  select.cs-select { min-width: 100%; }
  .controls { gap: 8px; }
  .stat .v { font-size: 22px; }
  .brand span.txt { display: none; }
}
