:root {
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e7e2dc;
    --canvas: #f7f5f2;
    --panel: #ffffff;
    --sidebar: #17221f;
    --accent: #d8683c;
    --accent-dark: #b94f28;
    --sage: #4f766b;
    --soft-sage: #e9f2ee;
    --soft-orange: #fbede5;
    --danger: #a74141;
    --shadow: 0 12px 32px rgba(36, 29, 23, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-width: 1100px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
h1, h2, h3, p { margin-top: 0; }
small { display: block; color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px; background: var(--sidebar); color: #dfe9e5; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 28px; }
.brand-mark { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 12px; color: white; background: var(--accent); font-family: Georgia, serif; font-size: 24px; box-shadow: 0 8px 18px rgba(216, 104, 60, .28); }
.brand strong { display: block; color: white; font-size: 18px; letter-spacing: .2px; }
.brand small { margin-top: 2px; color: #88a099; font-size: 11px; }
.nav-list { display: grid; gap: 6px; }
.nav-list a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; color: #aabbb5; transition: .18s ease; }
.nav-list a span { width: 18px; color: #8da59d; text-align: center; }
.nav-list a:hover { background: rgba(255,255,255,.05); color: white; }
.nav-list a.active { color: white; background: rgba(216, 104, 60, .16); box-shadow: inset 3px 0 var(--accent); }
.nav-list a.active span { color: #f4a27e; }
.sidebar-note { margin-top: auto; padding: 14px; display: flex; gap: 10px; align-items: center; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: rgba(255,255,255,.03); }
.sidebar-note strong { display: block; font-size: 13px; }
.sidebar-note small { margin-top: 2px; color: #839b93; font-size: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #f2ad6f; box-shadow: 0 0 0 5px rgba(242,173,111,.1); }

.workspace { min-width: 0; }
.topbar { height: 94px; padding: 19px 34px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.eyebrow { margin-bottom: 4px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 1.8px; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.account { display: flex; gap: 10px; align-items: center; }
.account strong { display: block; font-size: 13px; }
.account small { font-size: 11px; }
.avatar { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--soft-orange); color: var(--accent-dark); font-weight: 700; }
.link-button { padding: 5px 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.link-button:hover { color: var(--accent); }
.page-content { padding: 28px 34px 48px; }

.hero-panel { min-height: 166px; padding: 30px 34px; border-radius: 18px; display: flex; align-items: end; justify-content: space-between; color: white; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.16), transparent 28%), linear-gradient(120deg, #9e4d31, #d66c42 55%, #e59469); box-shadow: var(--shadow); }
.hero-panel h2 { margin: 15px 0 8px; max-width: 620px; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 600; letter-spacing: -.4px; }
.hero-panel p { margin-bottom: 0; color: rgba(255,255,255,.78); }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.soft { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: var(--ink); background: white; border-color: var(--line); }
.button.light { color: #9e4d31; background: white; }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.button.wide { width: 100%; }
.button-row { display: flex; gap: 9px; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.metric-card { position: relative; min-height: 122px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 5px 16px rgba(36,29,23,.04); }
.metric-card::after { content: ""; position: absolute; width: 54px; height: 54px; right: -22px; top: -22px; border-radius: 50%; background: var(--soft-sage); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card strong { display: block; margin: 7px 0 2px; color: var(--sage); font-family: Georgia, serif; font-size: 31px; }
.metric-card.warning strong { color: var(--accent); }
.metric-card.danger strong { color: var(--danger); }

.two-column { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, .75fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 6px 20px rgba(36,29,23,.04); overflow: hidden; }
.panel-head { padding: 20px 22px 16px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid #f0ede9; }
.panel-head h3 { margin-bottom: 4px; font-size: 16px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-head a { color: var(--accent); font-size: 12px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 14px; color: #7a756f; background: #faf9f7; text-align: left; font-size: 10px; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #f0ede9; vertical-align: middle; }
td strong { display: block; font-size: 12px; }
td small { margin-top: 3px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
tbody tr:hover { background: #fcfbf9; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #75502e; background: #f9eee0; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-pill.success { color: #356256; background: var(--soft-sage); }
.status-pill.neutral { color: #555f6d; background: #edf0f4; }

.shop-health { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid #f0ede9; }
.shop-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--sage); font-family: Georgia, serif; font-weight: 700; }
.shop-icon.large { width: 44px; height: 44px; font-size: 20px; }
.grow { flex: 1; min-width: 0; }
.grow strong { display: block; font-size: 12px; }
.grow small { margin-top: 3px; font-size: 10px; }
.capability-legend { padding: 15px 20px; display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.capability-legend span::before { content: "•"; margin-right: 8px; color: var(--accent); }

.section-intro { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: end; }
.section-intro h2 { margin-bottom: 6px; font-size: 20px; }
.section-intro p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.batch-bar { padding: 13px 18px; display: flex; align-items: end; gap: 12px; background: #faf9f7; border-bottom: 1px solid var(--line); }
.batch-bar label { color: var(--muted); font-size: 11px; font-weight: 700; }
.batch-bar select { min-width: 150px; margin-left: 8px; padding: 7px 28px 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.batch-bar small { margin-left: auto; align-self: center; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.shop-card { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 6px 20px rgba(36,29,23,.04); }
.shop-card-top { display: flex; justify-content: space-between; align-items: start; }
.shop-card h3 { margin: 18px 0 5px; }
.shop-card > p { color: var(--muted); font-size: 11px; }
.shop-card dl { margin: 18px 0; padding: 13px 0; border-block: 1px solid #f0ede9; }
.shop-card dl div { padding: 4px 0; display: flex; justify-content: space-between; gap: 14px; font-size: 11px; }
.shop-card dt { color: var(--muted); }
.shop-card dd { margin: 0; font-weight: 600; }
.capabilities { display: flex; gap: 7px; flex-wrap: wrap; }
.capabilities span { padding: 5px 7px; border-radius: 6px; background: #f1f2f3; color: #8a9098; font-size: 10px; }
.capabilities span.ok { background: var(--soft-sage); color: #356256; }
.capabilities span.off { text-decoration: line-through; }
.notice { margin: 18px 0; padding: 15px 18px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--soft-orange); }
.notice strong { color: var(--accent-dark); font-size: 12px; }
.notice p { margin: 4px 0 0; color: #765742; font-size: 12px; line-height: 1.6; }

.message-list { display: grid; gap: 13px; }
.message-card { padding: 19px 22px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 5px 16px rgba(36,29,23,.04); }
.message-meta { display: flex; align-items: center; gap: 10px; }
.avatar.customer { color: #356256; background: var(--soft-sage); }
.message-meta time { color: var(--muted); font-size: 11px; }
.message-card blockquote { margin: 16px 0; padding: 14px 17px; border-left: 2px solid #d9c7bc; color: #47413d; background: #faf8f6; font-family: Georgia, serif; line-height: 1.6; }
.message-actions { display: flex; gap: 9px; align-items: center; }
.message-actions span { margin-left: auto; color: var(--muted); font-size: 10px; }
.progress { width: 100px; height: 5px; overflow: hidden; border-radius: 999px; background: #ece9e5; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--sage); }

.alert { margin-bottom: 14px; padding: 11px 14px; border-radius: 9px; font-size: 12px; }
.alert.success { color: #315b50; background: var(--soft-sage); }
.alert.error { color: #8d3939; background: #fbe7e7; }

.login-page { min-width: 0; min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 20%, rgba(216,104,60,.13), transparent 27%), radial-gradient(circle at 85% 75%, rgba(79,118,107,.15), transparent 28%), #f5f1ec; }
.login-card { width: min(410px, 100%); padding: 42px; border: 1px solid rgba(255,255,255,.8); border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: 0 22px 60px rgba(48,37,29,.14); backdrop-filter: blur(12px); }
.login-brand { margin-bottom: 28px; }
.login-card h1 { margin-bottom: 8px; font-family: Georgia, "Songti SC", serif; font-size: 31px; }
.muted { color: var(--muted); }
.stack-form { display: grid; gap: 16px; margin-top: 26px; }
.stack-form label { color: #5c5752; font-size: 12px; font-weight: 700; }
.stack-form input { width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: white; }
.stack-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216,104,60,.1); }
.login-tip { margin: 17px 0 0; color: #99918a; text-align: center; font-size: 10px; }

@media (max-width: 1250px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
