/* 多门店经营数据看板样式（左侧导航布局） */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #e8532e;
  --primary-dark: #c9431f;
  --bg: #f5f2ef;
  --card: #ffffff;
  --text: #2b2623;
  --muted: #8a8078;
  --border: #ece5df;
  --green: #2e9e5b;
  --red: #e8532e;
  --blue: #3b82f6;
  --sidebar-w: 220px;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
body.auth-locked .layout { display: none; }
body.auth-locked .app-loading { display: none; }
.auth-screen {
  position: relative; z-index: 1200;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(232,83,46,.12), transparent 32%), var(--bg);
  padding: 28px;
}
.auth-screen.hidden { display: none; }
.auth-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; box-shadow: 0 18px 60px rgba(43,35,32,.12);
}
.auth-card.hidden { display: none; }
.auth-mark { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: #fff1ec; font-size: 26px; margin-bottom: 14px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; color: var(--text); }
.auth-card p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.auth-card label { display: block; font-size: 13px; font-weight: 700; color: #6f625a; margin: 12px 0 6px; }
.auth-input {
  width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; font: inherit; outline: none; background: #fff;
}
.auth-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,83,46,.12); }
.auth-primary, .auth-secondary {
  width: 100%; border: 0; border-radius: 10px; height: 44px; margin-top: 18px;
  font: inherit; font-weight: 800; cursor: pointer;
}
.auth-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(232,83,46,.24); }
.auth-secondary { background: #f5f2ef; color: #6f625a; }
.auth-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.auth-hint { color: #a99c93; font-size: 12px; margin-top: 12px; line-height: 1.5; }
.brand-list { display: grid; gap: 10px; margin-top: 12px; }
.brand-card-btn {
  width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 12px;
  padding: 14px; text-align: left; cursor: pointer; font: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.brand-card-btn:hover { border-color: var(--primary); box-shadow: 0 8px 20px rgba(43,35,32,.08); transform: translateY(-1px); }
.brand-card-title { font-weight: 800; color: var(--text); }
.brand-card-note { font-size: 12px; color: var(--muted); margin-top: 3px; }
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.upload-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center;
  background: #fffdfa;
}
.upload-name { font-weight: 800; color: var(--text); }
.upload-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.upload-state { font-size: 12px; font-weight: 800; color: #a99c93; }
.upload-state.done { color: var(--green); }
.upload-file { grid-column: 1 / -1; font: inherit; font-size: 12px; color: var(--muted); max-width: 100%; }
.upload-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.upload-actions .btn[disabled] { opacity: .55; cursor: not-allowed; }
@media (max-width: 900px) { .upload-grid { grid-template-columns: 1fr; } }
.brand-init-guide {
  border: 1px solid #f3d3c8; background: #fff7f3; border-radius: 10px;
  padding: 14px; margin: 10px 0 14px;
}
.brand-init-title { font-weight: 900; color: var(--text); margin-bottom: 4px; }
.brand-init-sub { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.brand-init-progress { height: 8px; border-radius: 999px; background: #f2e6df; overflow: hidden; margin: 10px 0; }
.brand-init-progress span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.brand-init-files { display: flex; flex-wrap: wrap; gap: 7px; }
.brand-init-file {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 5px 9px; font-size: 12px; font-weight: 700; color: #8a8078;
}
.brand-init-file.done { border-color: rgba(46,158,91,.25); background: #effaf3; color: var(--green); }
.brand-init-file.need { border-color: rgba(232,83,46,.22); background: #fff1ec; color: var(--primary); }
.upload-history { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fffdfa; }
.upload-history-title { padding: 10px 12px; font-size: 13px; font-weight: 900; color: var(--text); border-bottom: 1px solid #f2ece7; }
.upload-history-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f7f1ec; font-size: 12px; color: var(--muted); }
.upload-history-row:last-child { border-bottom: 0; }
.upload-history-main { flex: 1; min-width: 0; }
.upload-history-main strong { color: var(--text); }
.upload-history-sub { color: #a99c93; margin-top: 2px; word-break: break-all; }
.hidden { display: none !important; }
.admin-grid { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 18px; align-items: start; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; font-weight: 800; color: #6f625a; margin-bottom: 6px; }
.form-row .filter-search, .form-row .filter-select { width: 100%; }
.admin-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fffdfa; }
.admin-list-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 1px solid #f2ece7; }
.admin-list-item:last-child { border-bottom: 0; }
.admin-list-main { flex: 1; min-width: 0; }
.admin-list-title { font-weight: 800; color: var(--text); }
.admin-list-sub { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.admin-list-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; align-items: center; }
.admin-inline-input {
  height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px;
  font: inherit; font-size: 12px; background: #fff; min-width: 120px;
}
.admin-inline-select {
  height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px;
  font: inherit; font-size: 12px; background: #fff;
}
.admin-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-checks label {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 9px; font-size: 12px; color: #6f625a; cursor: pointer; background: #fff;
}
.admin-audit-list { max-height: 420px; overflow: auto; }
.admin-audit-list .audit-row { align-items: flex-start; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

/* ============ 布局 ============ */
.layout { display: flex; min-height: 100vh; }

/* ============ 左侧导航 ============ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #2b2320;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo {
  font-size: 17px; font-weight: 800;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #ffb59e;
}
.brand-switcher {
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-switcher-label { color: #8a7d76; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
#current-brand-btn {
  width: 100%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
  color: #fff; border-radius: 10px; padding: 9px 10px; text-align: left; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 800;
}
.logout-link {
  margin-top: 7px; border: 0; background: transparent; color: #a99c93;
  font: inherit; font-size: 12px; cursor: pointer; padding: 0;
}
.logout-link:hover { color: #ffb59e; }
.admin-shortcut {
  width: 100%; margin-top: 8px; border: 1px solid rgba(255,181,158,.38);
  background: rgba(232,83,46,.16); color: #ffcfbf; border-radius: 10px;
  padding: 8px 10px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 800;
  text-align: left;
}
.admin-shortcut:hover { background: rgba(232,83,46,.26); color: #fff; }
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; min-height: 0; }
.nav-group {
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: #ffb59e; padding: 14px 8px 2px; text-transform: uppercase;
}
.nav-item {
  border: none; background: transparent; color: #cfc4bd;
  font-size: 14px; font-weight: 600; text-align: left;
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
/* 全局「仅看一战区」开关 */
.war-scope-btn {
  border: 1.5px dashed rgba(255,196,120,.5); background: rgba(255,170,60,.08); color: #ffd9a0;
  font-size: 13.5px; font-weight: 700; text-align: center;
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
  transition: all .18s; font-family: inherit; margin-bottom: 4px;
  letter-spacing: .5px;
}
.war-scope-btn:hover { border-color: #ffb347; background: rgba(255,170,60,.16); color: #ffe3b8; }
.war-scope-btn.active {
  border-style: solid; border-color: #ff9f2e;
  background: linear-gradient(135deg, #ff9f2e, #ff7a1a);
  color: #fff; box-shadow: 0 4px 16px rgba(255,140,30,.4);
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, #ff8a5c, var(--primary));
  color: #fff; box-shadow: 0 4px 14px rgba(232,83,46,.35);
}
.sidebar-foot {
  padding: 16px 20px; font-size: 12px; color: #8a7d76;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ============ 右侧内容 ============ */
.content {
  flex: 1; padding: 28px 32px 60px;
  min-width: 0;
}
.page { max-width: 1200px; margin: 0 auto; }
.page.hidden { display: none; }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 20px; color: var(--text); }

/* 按钮 */
.btn {
  border: none; cursor: pointer; font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 10px; transition: all .15s;
  font-family: inherit;
}
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* 标签 */
.tag {
  font-size: 11px; font-weight: 600; background: #fff1ec; color: var(--primary);
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-grid.cost-kpis { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .kpi-grid, .kpi-grid.cost-kpis { grid-template-columns: repeat(2, 1fr); } }

.kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
}
.kpi.rev-kpi-trend {
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kpi.rev-kpi-trend:hover {
  border-color: rgba(232,83,46,.45);
  box-shadow: 0 8px 22px rgba(43,35,32,.08);
  transform: translateY(-1px);
}
.kpi.rev-kpi-trend.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(232,83,46,.25), 0 8px 22px rgba(232,83,46,.12);
}
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi-value.kpi-name { font-size: 18px; line-height: 1.3; padding-top: 4px; }
.kpi-select {
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px;
  background: #fff; outline: none; max-width: 100%; cursor: pointer;
  transition: border-color .15s;
}
.kpi-select:focus { border-color: var(--primary); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.store .kpi-value { color: #7c3aed; }
.kpi.revenue .kpi-value { color: var(--blue); }
.kpi.cost .kpi-value { color: var(--red); }
.kpi.net .kpi-value { color: var(--green); }
.kpi.net.negative .kpi-value { color: var(--red); }

/* 表格 */
.table-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px; margin-top: 20px;
}
.table-card h3 { font-size: 15px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
.time-share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.time-share-title { font-size: 13px; font-weight: 700; color: #5d5149; margin: 0 0 8px; }
.time-share-scroll { max-height: 430px; overflow: auto; }
.time-share-scroll thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
@media (max-width: 900px) { .time-share-grid { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid #f6f1ed; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.store-row { cursor: pointer; transition: background .12s; }
.store-row:hover { background: #fff8f4; }
.store-row.active { background: #fff1ec; box-shadow: inset 3px 0 0 var(--primary); }
.store-name { font-weight: 700; }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }

/* 环比对比 */
.cmp { margin-left: 6px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.cmp-up { color: var(--green); }
.cmp-down { color: var(--red); }
.cmp-flat { color: var(--muted); }
.cmp-na { color: var(--muted); font-weight: 400; }
.cmp-prev { color: var(--muted); font-weight: 400; font-size: 11px; }

/* 平台占比饼图卡片 + 维度切换 */
.pie-card { max-width: 560px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-left: 8px; vertical-align: 2px; }
.seg-btn { border: none; background: #fff; color: var(--muted); font-size: 12px; font-weight: 600; padding: 3px 12px; cursor: pointer; font-family: inherit; transition: all .15s; }
.seg-btn:hover { color: var(--primary); }
.seg-btn.active { background: var(--primary); color: #fff; }

/* 表格列头排序 */
.sortable { cursor: pointer; user-select: none; transition: color .15s; }
.sortable:hover { color: var(--primary); }
#table-rv-score th[data-score-sort] button { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; white-space: nowrap; cursor: pointer; }
#table-rv-score th[data-score-sort] button:hover { color: var(--primary); }
#table-rv-score th[data-score-sort] button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
#table-rv-score .sort-indicator { display: inline-block; min-width: 1em; color: var(--primary); }
.sort-arrow { font-size: 10px; margin-left: 2px; color: var(--primary); }

/* 含推广成本开关 */
.promo-toggle { margin-left: 10px; vertical-align: 2px; }
.promo-toggle.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(232,83,46,.3);
}

/* 固定高度滚动表格（约 10 行，超出滑动） */
.store-table-scroll {
  max-height: 500px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px;
}
.store-table-scroll thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.store-table-scroll::-webkit-scrollbar { width: 8px; }
.store-table-scroll::-webkit-scrollbar-thumb { background: #d9cfc8; border-radius: 4px; }
.store-table-scroll::-webkit-scrollbar-thumb:hover { background: #c0b4ac; }

/* 成本构成表：约 5 行 */
.cost-scroll { max-height: 262px; }
.cost-store-row { cursor: pointer; transition: background .12s; }
.cost-store-row:hover { background: #fff8f4; }
.cost-store-row.active { background: #fff1ec; box-shadow: inset 3px 0 0 var(--primary); }

/* 图表 */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
.chart-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
}
.chart-card h3 { font-size: 15px; margin-bottom: 8px; }
.chart { width: 100%; height: 320px; }

/* 门店详情 */
.detail-panel {
  margin-top: 20px; border: 2px solid var(--primary); border-radius: 16px;
  padding: 18px; background: #fffdfb;
}
.detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.detail-head h3 { font-size: 17px; }
.detail-kpis {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 6px;
}
@media (max-width: 900px) { .detail-kpis { grid-template-columns: repeat(3, 1fr); } }
.dkpi {
  background: #fdfbf9; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; text-align: center;
}
.dkpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.dkpi-value { font-size: 18px; font-weight: 800; margin-top: 2px; }
.dkpi-value.revenue { color: var(--blue); }
.dkpi-value.cost { color: var(--red); }
.dkpi-value.pos { color: var(--green); }
.dkpi-value.neg { color: var(--red); }

/* 隐藏工具类 */
.hidden { display: none !important; }

/* ============ 菜品成本库 ============ */
.dish-lib-card { margin-top: 20px; }
.dish-lib-desc { font-size: 12px; color: var(--muted); margin: -6px 0 14px; }
.dish-form {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 14px; background: #fdfbf9; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 14px;
}
.dish-input, .dish-select {
  font-family: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: #fff; outline: none; transition: border-color .15s;
}
.dish-input:focus, .dish-select:focus { border-color: var(--primary); }
.dish-input { flex: 1; min-width: 140px; }
.dish-input.dish-price { flex: 0 0 140px; }
.dish-select { flex: 0 0 110px; }

.dish-import {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 14px; background: #fdfbf9; border: 1px dashed var(--border);
  border-radius: 12px; margin-bottom: 14px;
}
.dish-dropzone {
  flex: 1; min-width: 220px; border: 2px dashed #e0d6cf; border-radius: 10px;
  padding: 14px 12px; text-align: center; cursor: pointer; background: #fff;
  transition: all .15s;
}
.dish-dropzone:hover, .dish-dropzone.dragover { border-color: var(--primary); background: #fff6f2; }
.dish-dropzone .dz-icon { font-size: 22px; }
.dish-dropzone .dz-text { font-size: 13px; font-weight: 600; margin-top: 2px; }
.dish-dropzone .dz-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

.dish-stats {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  font-size: 13px; color: var(--muted); margin-bottom: 10px;
}
.dish-stats b { color: var(--text); font-size: 15px; }

/* 统计 + 搜索工具栏 */
.dish-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.dish-search-wrap { margin-left: auto; }
.dish-search {
  font-family: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  background: #fff; outline: none; width: 200px; transition: border-color .15s;
}
.dish-search:focus { border-color: var(--primary); }

/* 固定高度滚动列表（约 10 行） */
.dish-table-wrap {
  max-height: 460px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px;
}
.dish-table-wrap thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.dish-table-wrap::-webkit-scrollbar { width: 8px; }
.dish-table-wrap::-webkit-scrollbar-thumb { background: #d9cfc8; border-radius: 4px; }
.dish-table-wrap::-webkit-scrollbar-thumb:hover { background: #c0b4ac; }

.del-btn {
  border: 1px solid #f3c2c2; background: #fdecec; color: #b3261e;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.del-btn:hover { background: #f8d7d7; }
.edit-btn {
  border: 1px solid #c9d8f5; background: #eef4ff; color: #1d4ed8;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.edit-btn:hover { background: #dbe8ff; }

/* 行内编辑 */
.editing-row { background: #fffbe8; }
.dish-inline-input, .dish-inline-select {
  font-family: inherit; font-size: 13px; color: var(--text);
  border: 1px solid #e8c96a; border-radius: 6px; padding: 5px 8px;
  background: #fff; outline: none; width: 100%; min-width: 70px;
}
.dish-inline-input:focus, .dish-inline-select:focus { border-color: var(--primary); }
.dish-inline-price { width: 80px; }
.save-btn {
  border: 1px solid #b8e0c4; background: #e9f8ee; color: #1a7f3d;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.save-btn:hover { background: #d3f0dd; }

/* ============ 筛选导航区 ============ */
.filter-bar {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 18px; margin-bottom: 18px;
  display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-end;
}
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-group-inline { display: inline-flex; align-items: center; gap: 4px; }

/* 战区报表 · 平台收入分析表格美化 */
.zone-table { width: 100%; border-collapse: collapse; }
.zone-table thead th {
  background: #2b2320; color: #fff; font-size: 13px; padding: 10px 12px;
  position: sticky; top: 0; z-index: 2; border: none; white-space: nowrap;
}
.zone-table thead th:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 0; }
.zone-table thead th:last-child { border-top-right-radius: 8px; }
.zone-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.zone-table tbody tr:nth-child(even) { background: #faf7f4; }
.zone-table tbody tr:hover { background: #fff3ec; }
.zone-table tbody tr.zone-total td {
  background: #f1ecff; border-top: 2px solid #ddd6fe;
  font-weight: 700;
}
.zone-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 7px; vertical-align: middle;
}
.zone-table .mom-up { color: var(--green); }
.zone-table .mom-down { color: var(--red); }
.filter-label {
  font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap;
}
.filter-select, .filter-date, .filter-search {
  font-family: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
  background: #fdfbf9; outline: none; transition: border-color .15s;
}
.filter-select:focus, .filter-date:focus, .filter-search:focus {
  border-color: var(--primary);
}
.filter-date { width: 138px; }
.filter-sep { font-size: 12px; color: var(--muted); }
.filter-static {
  display: inline-block; background: #fff8f4; border: 1px solid #f0e2d8;
  color: #7c3aed; font-size: 13px; font-weight: 700;
  padding: 6px 12px; border-radius: 8px; margin-left: 2px;
}
.filter-search { width: 180px; }
.filter-search-group { margin-left: auto; }

/* 加载遮罩 + 更新提示 */
.app-loading {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(245, 242, 239, .92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.app-loading .spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid #e8ddd6; border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.app-loading .load-text { font-size: 14px; color: var(--muted); font-weight: 600; }
.app-loading .load-error { font-size: 14px; color: var(--red); font-weight: 700; max-width: 480px; text-align: center; line-height: 1.8; }
.flash-notice {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000;
  background: #2b2320; color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

/* 平台 chip */
.chip-group { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 20px;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(232,83,46,.3);
}

@media (max-width: 768px) {
  .filter-search-group { margin-left: 0; width: 100%; }
  .filter-search { flex: 1; }
}

/* 响应式：窄屏时左侧导航变顶部横条 */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; flex-wrap: wrap;
  }
  .logo { border-bottom: none; padding: 14px 16px; font-size: 15px; }
  .nav { flex-direction: row; padding: 8px 12px; overflow-x: auto; }
  .nav-item { white-space: nowrap; padding: 8px 12px; }
  .sidebar-foot { display: none; }
  .content { padding: 18px 14px 40px; }
}

/* 门店标签徽章（直营/加盟/托管） */
.st-tag { display:inline-block; padding:1px 7px; margin-left:6px; border-radius:9px; font-size:11px; font-weight:700; vertical-align:middle; white-space:nowrap; }
.st-tag.t-direct { background:#e8f2ff; color:#1d6fb8; }
.st-tag.t-franchise { background:#fff3e0; color:#c67b1a; }
.st-tag.t-trusteeship { background:#eaf7ec; color:#2e7d43; }
.st-manager { display:inline-block; padding:1px 7px; margin-left:6px; border-radius:9px; font-size:11px; font-weight:700; vertical-align:middle; white-space:nowrap; background:#f1edf9; color:#7251a3; }
.st-zone { display:inline-block; padding:1px 7px; margin-left:6px; border-radius:9px; font-size:11px; font-weight:700; vertical-align:middle; white-space:nowrap; background:#eaf6f6; color:#247277; }
.st-zone.auto { background:#fff4dd; color:#b37418; }
.manager-input { height:28px; padding:4px 8px; font-size:12px; }
.manager-city-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #faf7f4; padding: 7px 10px; border-bottom: 1px solid #efe7e0;
}
.manager-city-title { font-weight: 700; font-size: 12.5px; color: #5a4d45; }
.manager-city-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.manager-city-actions .manager-input { width: 140px; min-width: 140px; }
.manager-province-block + .manager-province-block { border-top: 2px solid #eadfd6; }
.manager-province-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #f4eee8; padding: 9px 10px; border-bottom: 1px solid #e5d8ce;
}
.manager-province-title { font-weight: 800; font-size: 13.5px; color: #4f423a; }
