:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --card: #ffffff;
  --ink: #1e2d27;
  --muted: #718078;
  --line: #e4ebe7;
  --green: #286c55;
  --green-dark: #1f5946;
  --green-soft: #e7f3ed;
  --sidebar: #183c32;
  --sidebar-active: #2a5a4c;
  --sidebar-muted: #a7c3b8;
  --accent-2: #6bb298;
  --orange: #db7a37;
  --orange-soft: #fff1e6;
  --red: #be514d;
  --red-soft: #fcebea;
  --shadow: 0 12px 28px rgba(44, 68, 59, 0.06);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1080px; background: var(--bg); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; padding: 24px 14px 18px; display: flex; flex-direction: column; background: var(--sidebar); color: #d6e5df; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 25px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #f5b462; color: #553714; font-weight: 800; }
.brand strong { display: block; color: white; font-size: 17px; letter-spacing: 1px; }
.brand span { display: block; margin-top: 4px; color: var(--sidebar-muted); font-size: 11px; }
.nav-title { margin: 18px 10px 7px; color: #81a79a; font-size: 11px; letter-spacing: 1px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: #c6d9d2; text-align: left; font-size: 14px; transition: .2s; }
.nav-item span { width: 17px; color: #a4c8bb; font-size: 16px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: var(--sidebar-active); color: white; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255,255,255,.12); }
.cloud-status { display: flex; gap: 8px; align-items: center; color: #dcebe5; font-size: 12px; }
.cloud-status i { width: 8px; height: 8px; border-radius: 50%; background: #79d59b; box-shadow: 0 0 0 4px rgba(121,213,155,.12); }
.sidebar-foot small { display: block; margin: 7px 0 0 16px; color: #8caf9f; font-size: 11px; }

main { margin-left: 224px; }
.topbar { height: 88px; padding: 20px 32px 16px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.76); border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
h1 { margin: 0; font-size: 23px; letter-spacing: .5px; }
.top-actions { display: flex; align-items: center; gap: 11px; }
.ai-trigger { height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 13px; border: 1px solid #c8dfd6; border-radius: 8px; background: #eff8f4; color: var(--green); font-size: 13px; font-weight: 700; }
.ai-trigger:hover { background: #e2f2ec; }
.lang-toggle { width: 38px; height: 38px; border: 1px solid #c8dfd6; border-radius: 8px; background: white; color: var(--green); font-size: 12px; font-weight: 800; }
.lang-toggle:hover { background: #eff8f4; }
.search { width: 255px; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #8a9892; }
.search input { width: 100%; border: 0; outline: none; color: var(--ink); font-size: 13px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #64746c; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #e2f0ea; color: var(--green); font-weight: 700; }
.content { padding: 26px 32px 40px; }

.hero { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-radius: 14px; background: linear-gradient(108deg, var(--green-dark), var(--accent-2)); color: white; box-shadow: var(--shadow); }
.hero h2 { margin: 0 0 8px; font-size: 20px; }
.hero p { margin: 0; color: #d6ebe4; font-size: 13px; }
.hero-actions { display: flex; gap: 10px; }
.button { padding: 9px 15px; border: 1px solid transparent; border-radius: 7px; background: var(--green); color: white; font-size: 13px; font-weight: 700; }
.button:hover { background: var(--green-dark); }
.button.light { background: white; color: var(--green); }
.button.ghost { border-color: var(--line); background: white; color: #4d6058; }
.button.small { padding: 7px 11px; font-size: 12px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 18px; }
.metric, .card { border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.metric { padding: 18px; }
.metric-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.metric strong { display: block; margin-top: 10px; color: #22342d; font-size: 26px; }
.metric small { display: block; margin-top: 5px; color: #829087; font-size: 11px; }
.good { color: var(--green) !important; }
.warn { color: var(--orange) !important; }

.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; margin-top: 18px; }
.card { overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.link { border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; }

.bar-list { padding: 11px 18px 17px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 52px; gap: 10px; align-items: center; margin-top: 15px; font-size: 12px; }
.bar-track { height: 7px; overflow: hidden; border-radius: 7px; background: #edf2ef; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--accent-2); }
.bar-row b { text-align: right; font-size: 12px; }
.todo-list { padding: 7px 18px 13px; }
.todo { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo-icon { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--orange-soft); color: var(--orange); font-weight: 700; }
.todo strong { display: block; font-size: 13px; }
.todo small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.page-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.page-toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.toolbar-actions { display: flex; gap: 9px; }
.filter-row { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.filter-row input, .filter-row select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: white; color: #506159; font-size: 12px; outline: none; }
.filter-row input { width: 210px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fbfcfb; }
.pagination-info { color: var(--muted); font-size: 12px; }
.pagination-actions { display: flex; align-items: center; gap: 7px; }
.pagination button, .pagination select { height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #52635c; font-size: 12px; }
.pagination button:disabled { cursor: not-allowed; opacity: .42; }
.page-current { min-width: 92px; color: #52635c; font-size: 12px; text-align: center; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; background: #f8faf9; color: #6e7c76; font-size: 11px; font-weight: 700; text-align: left; }
td { padding: 13px 14px; border-top: 1px solid var(--line); color: #3c4e47; font-size: 12px; }
tr:hover td { background: #fbfdfc; }
.product { display: flex; gap: 9px; align-items: center; }
.product strong { display: block; color: #30423b; font-size: 12px; }
.product small { color: #8a9792; font-size: 11px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-size: 11px; white-space: nowrap; }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: #eef1f0; color: #6c7974; }
.text-button { border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.quick-card { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); transition: .2s; }
.quick-card:hover { transform: translateY(-2px); border-color: #bad6ca; }
.quick-card .quick-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); font-weight: 800; }
.quick-card strong { display: block; margin-top: 13px; font-size: 14px; }
.quick-card small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.notice { padding: 12px 14px; border: 1px solid #d9e9e2; border-radius: 8px; background: #f1f8f5; color: #467061; font-size: 12px; line-height: 1.7; }

.analytics-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; margin-top: 16px; }
.analytics-filter-card { margin-bottom: 14px; padding: 14px 16px; }
.analytics-filter-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.analytics-filter-grid label { color: var(--muted); font-size: 12px; }
.analytics-filter-grid input, .analytics-filter-grid select { display: block; height: 34px; margin-top: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: white; color: #506159; }
.store-checks { display: flex; flex-wrap: wrap; gap: 13px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: #52635c; font-size: 12px; }
.store-checks label { display: flex; gap: 4px; align-items: center; }
.store-checks small { color: var(--muted); }
.chart-card { padding-bottom: 16px; }
.chart-pad { padding: 15px 18px 4px; }
.trend-chart { width: 100%; height: 190px; }
.trend-chart text { fill: #8a9792; font-size: 10px; }
.trend-chart .grid { stroke: #e6ece9; stroke-dasharray: 4 4; }
.trend-chart .area { fill: url(#trendArea); }
.trend-chart .line { fill: none; stroke: #377b65; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-chart .dot { fill: white; stroke: #377b65; stroke-width: 2; }
.sales-bars { padding: 8px 18px 14px; }
.sales-bar { display: grid; grid-template-columns: 110px 1fr 80px; gap: 10px; align-items: center; padding: 9px 0; font-size: 12px; }
.sales-bar-track { height: 10px; overflow: hidden; border-radius: 10px; background: #eef2f0; }
.sales-bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--accent-2)); }
.sales-bar b { text-align: right; color: #385148; font-size: 12px; }
.mini-rank { padding: 8px 18px 15px; }
.rank-row { display: grid; grid-template-columns: 22px 1fr 76px 58px; gap: 8px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: #edf4f1; color: var(--green); font-size: 11px; font-weight: 700; }
.rank-row b { color: #344840; text-align: right; }
.rank-row small { color: var(--green); text-align: right; }
.rank-select { height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #5c6c65; font-size: 11px; }
.compact-rank-card .card-head { padding: 13px 15px 10px; }
.compact-table { table-layout: fixed; }
.compact-table th { padding: 7px 11px; border-right: 1px solid #e5e8ed; background: #f7f8fc; color: #263d61; font-size: 11px; }
.compact-table td { padding: 7px 11px; border-top: 1px solid #e3e7ee; border-right: 1px solid #edf0f4; color: #344659; font-size: 11px; }
.compact-table tr:hover td { background: #f5f9f7; }
.compact-table .row-number { width: 42px; color: #47667d; text-align: center; }
.compact-table .number { width: 145px; text-align: right; font-variant-numeric: tabular-nums; }
.analytics-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.insight-card { padding: 16px 18px; border: 1px solid #d6e9e1; border-radius: 12px; background: linear-gradient(135deg, #eff8f4, #fbfdfc); }
.insight-card h3 { margin: 0; color: #315e50; font-size: 14px; }
.insight-card p { margin: 8px 0 12px; color: #5e766d; font-size: 12px; line-height: 1.7; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 7px 10px; border: 1px solid #d8e8e2; border-radius: 16px; background: white; color: #507166; font-size: 11px; }
.chip:hover { border-color: #9fcbbb; color: var(--green); }

.ai-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(23, 42, 35, .15); }
.ai-drawer { position: fixed; inset: 0 0 0 auto; z-index: 20; width: 420px; display: flex; flex-direction: column; background: #fbfdfc; box-shadow: -15px 0 34px rgba(28, 57, 47, .12); }
.ai-head { padding: 18px; display: flex; align-items: center; justify-content: space-between; background: #214f41; color: white; }
.ai-head strong { display: block; font-size: 16px; }
.ai-head small { display: block; margin-top: 5px; color: #bcd6cc; font-size: 11px; }
.ai-head .close { color: white; }
.ai-body { flex: 1; overflow: auto; padding: 16px; }
.ai-message { max-width: 92%; margin-bottom: 12px; padding: 11px 12px; border-radius: 11px; background: white; color: #4a5e56; box-shadow: 0 3px 12px rgba(51, 77, 68, .06); font-size: 12px; line-height: 1.75; white-space: pre-line; }
.ai-message.user { margin-left: auto; background: #dff0e9; color: #315d4f; }
.ai-suggestions { padding: 0 16px 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.ai-input { display: flex; gap: 8px; padding: 13px 16px 16px; border-top: 1px solid var(--line); background: white; }
.ai-input input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; outline: none; font-size: 12px; }
.ai-input input:focus { border-color: #9bc6b7; }
.theme-picker { position: relative; }
.theme-toggle { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #c8dfd6; border-radius: 8px; background: white; }
.theme-toggle i { width: 17px; height: 17px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.theme-menu { position: absolute; top: 45px; right: 0; z-index: 8; width: 154px; display: none; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 12px 28px rgba(30,55,47,.14); }
.theme-menu.open { display: block; }
.theme-option { width: 100%; display: flex; gap: 9px; align-items: center; padding: 8px; border: 0; border-radius: 6px; background: white; color: #586861; text-align: left; font-size: 12px; }
.theme-option:hover, .theme-option.active { background: #f0f5f3; color: #2e473f; }
.theme-option i { width: 14px; height: 14px; border-radius: 50%; }
.login-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: linear-gradient(135deg, var(--sidebar), var(--green)); }
.login-card { width: 360px; padding: 28px; border-radius: 16px; background: white; box-shadow: 0 20px 50px rgba(16,42,34,.22); }
.login-card h2 { margin: 0; color: var(--ink); font-size: 22px; }
.login-card p { margin: 8px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-card label { display: block; margin-top: 12px; color: #52635c; font-size: 12px; }
.login-card input { width: 100%; height: 39px; margin-top: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; outline: none; }
.login-card .button { width: 100%; margin-top: 18px; }
.login-error { min-height: 18px; margin-top: 10px; color: var(--red); font-size: 12px; }
.user-pill { height: 38px; display: flex; gap: 7px; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #53645d; font-size: 12px; }
.user-pill button { border: 0; background: transparent; color: var(--green); font-size: 12px; }
.category-table td { padding: 10px 14px; }
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input { height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; outline: none; }
.opening-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opening-grid label { color: #61716a; font-size: 12px; }
.opening-grid input, .opening-grid select, .opening-grid textarea { width: 100%; margin-top: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; outline: none; }
.opening-grid textarea { min-height: 90px; resize: vertical; }

.toast { position: fixed; right: 25px; bottom: 24px; z-index: 5; padding: 12px 15px; border-radius: 8px; background: #24483d; color: white; box-shadow: 0 8px 20px rgba(0,0,0,.15); font-size: 13px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(27, 47, 40, .35); }
.modal { width: 520px; overflow: hidden; border-radius: 12px; background: white; box-shadow: 0 18px 50px rgba(21,44,36,.2); }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px; color: #56665f; font-size: 13px; line-height: 1.8; }
.modal-foot { justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); border-bottom: 0; }
.close { border: 0; background: transparent; color: #85918c; font-size: 20px; }
