:root {
  --bg: #f3f5f6;
  --panel: #fff;
  --ink: #18272e;
  --muted: #657780;
  --line: #dce4e7;
  --accent: #096b70;
  --accent-dark: #074e53;
  --accent-soft: #e6f2f2;
  --success: #17705a;
  --success-soft: #e8f4ef;
  --warning: #95600d;
  --warning-soft: #fff4dc;
  --danger: #a13b3b;
  --danger-soft: #fff0ee;
  --shadow: 0 8px 24px rgba(21, 45, 53, .055);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: #123b40; color: #e9f2f2; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; padding: 26px 22px 28px; font-size: 18px; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand small { display: block; margin-top: 3px; color: #9fc0c2; font-size: 9px; letter-spacing: .13em; font-weight: 500; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #6e9b9d; border-radius: 10px; background: #1a4b50; font-size: 22px; }
.sidebar nav { display: grid; gap: 5px; padding: 0 12px; }
.sidebar nav a { color: #c5d9da; padding: 11px 14px; border-radius: 8px; font-weight: 550; }
.sidebar nav a:hover, .sidebar nav a.active { background: #20545a; color: #fff; text-decoration: none; }
.sidebar nav a.active { box-shadow: inset 3px 0 #74c3c2; }
.sidebar-foot { margin-top: auto; padding: 20px 22px; color: #89abad; font-size: 11px; border-top: 1px solid #285258; }
.main-shell { min-width: 0; }
.topbar { height: 68px; padding: 0 28px; display: flex; align-items: center; gap: 22px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.global-search { flex: 1; max-width: 580px; }
.global-search input { width: 100%; border: 1px solid #d2dfe2; border-radius: 8px; background: #f5f8f8; padding: 9px 13px; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.user-menu small { display: block; color: var(--muted); font-size: 11px; text-align: right; }
.icon-button { display: none; }
.link-button { border: 0; background: none; color: var(--accent); padding: 4px; }
.content { width: min(1760px, 100%); margin: 0 auto; padding: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.page-head h1, h1 { margin: 0 0 5px; font-size: 28px; letter-spacing: -.025em; }
.page-head p, .subtitle { margin: 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 14px; border: 1px solid #bfcdd1; border-radius: 7px; background: #fff; color: var(--ink); font-weight: 600; }
.button:hover { background: #f3f7f7; text-decoration: none; }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.danger { color: var(--danger); border-color: #deb6b2; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: var(--shadow); }
.card-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.card-value { margin-top: 6px; font-size: 30px; line-height: 1.2; font-weight: 720; font-variant-numeric: tabular-nums; }
.card-note { margin-top: 5px; color: var(--muted); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; }
.panel { margin-bottom: 20px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.panel h2 { margin: 0; font-size: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.notice { padding: 13px 16px; margin-bottom: 18px; border: 1px solid #c8dfe0; border-radius: 9px; background: #eaf5f4; color: #315b5e; }
.message { padding: 12px 16px; margin-bottom: 16px; border-radius: 8px; background: var(--success-soft); color: var(--success); border: 1px solid #bfddd2; }
.message.error { background: var(--danger-soft); color: var(--danger); border-color: #ebc8c3; }
.filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(130px, 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; }
.filters .wide { grid-column: span 2; }
.field { margin-bottom: 14px; }
.filters .field { margin-bottom: 0; }
.field label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #bfced2; border-radius: 7px; background: #fff; color: var(--ink); padding: 9px 10px; }
.field textarea { resize: vertical; }
.help { color: var(--muted); font-size: 12px; }
.errorlist { color: var(--danger); margin: 4px 0; padding-left: 20px; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f3f6f7; color: #4d626b; font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f5fafa; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-link { font-weight: 700; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.unknown { color: var(--warning); }
.badge { display: inline-block; padding: 2px 8px; margin: 1px 3px 1px 0; border-radius: 999px; background: #edf1f2; color: #52656d; font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.stack { display: grid; gap: 8px; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list-title { display: flex; justify-content: space-between; gap: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.timeline { border-left: 2px solid #c7dbdd; margin-left: 6px; padding-left: 20px; }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); left: -26px; top: 6px; }
.product-card { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 12px; overflow: hidden; }
.product-head { display: flex; justify-content: space-between; gap: 12px; padding: 13px 15px; background: #f4f7f8; }
.product-body { padding: 14px 15px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.inline-form { display: inline; }
.review-box { border-left: 4px solid var(--accent); background: #f0f7f7; padding: 16px; border-radius: 6px; }
.diff { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.diff-old { color: var(--danger); text-decoration: line-through; }
.diff-new { color: var(--success); font-weight: 700; }
.footer-note { margin-top: 24px; color: var(--muted); font-size: 12px; text-align: center; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #113c41, #1d6266); }
.login-panel { width: min(420px, 100%); padding: 32px; border-radius: 14px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.login-brand { margin-bottom: 24px; text-align: center; }
.login-brand h1 { font-size: 25px; }
@media (max-width: 1200px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -250px; width: 232px; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .icon-button { display: inline-block; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 6px 9px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .content { padding: 18px 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .user-menu small { display: none; }
}
@media (max-width: 560px) {
  .cards, .filters, .detail-grid { grid-template-columns: 1fr; }
  .filters .wide { grid-column: auto; }
  .page-head { display: block; }
  .page-head .actions { margin-top: 14px; }
  .panel { padding: 14px; }
  .global-search { display: none; }
}
