:root {
  --bg: #f2f4f6;
  --surface: #fff;
  --surface-soft: #f7f8fa;
  --ink: #24282d;
  --muted: #727b84;
  --line: #d9dee3;
  --line-soft: #eaedf0;
  --primary-neutral: #4e687e;
  --primary-neutral-dark: #354b5d;
  --primary-neutral-soft: #eaf0f4;
  --accent: #4e687e;
  --accent-dark: #354b5d;
  --accent-soft: #eaf0f4;
  --accent-warm: #ad7b43;
  --accent-warm-soft: #f6efe6;
  --accent-danger: #a85e5e;
  --accent-danger-soft: #f8eded;
  --cyan: #71889a;
}

body, .content, .wecom-shell, .wecom-chat-workspace, .wecom-feature-page { background-color:#f2f4f6; }
.sidebar { border-right-color:#303943; background:#232b33; }
.topbar, .panel, .ip-panel, .ip-commandbar, .tl-card, .tl-list article, .tl-food-table, .te-header { background:#fff; }
.sidebar-brand .brand-mark, .brand-mark { background:linear-gradient(145deg,#617d93,#354b5d); box-shadow:0 7px 18px rgba(42,61,76,.18); }
.sidebar-brand strong { color:#f5f7f9; }
.sidebar-foot { border-color:rgba(255,255,255,.11); background:transparent; }
.sidebar-foot span { color:rgba(255,255,255,.46); }
.sidebar-foot strong { color:rgba(255,255,255,.78); }

.primary-button, .command-button,
.wecom-send-button, .wecom-bind-primary, .wecom-ai-save, .wecom-nutrition-save,
.wecom-sop-save, .wecom-stage-save, .wecom-stage-publish {
  border-color:var(--accent) !important;
  background:var(--accent) !important;
  color:#fff !important;
  box-shadow:0 4px 12px rgba(53,75,93,.12) !important;
}
.primary-button:hover, .command-button:hover,
.wecom-send-button:hover, .wecom-bind-primary:hover { border-color:var(--accent-dark) !important; background:var(--accent-dark) !important; }
.ghost-button, .table-action, .filter-control, .ip-add-row {
  border-color:#cfd6dc;
  background:transparent;
  color:#46535e;
}
.ghost-button:hover, .table-action:hover, .ip-add-row:hover { border-color:#8799a8; background:#f0f4f7; color:#293640; }
.panel-action, .table-action, .wecom-feature-title > div > span,
.tl-card header span, .tl-list article > div > span, .te-header > div > span { color:var(--accent) !important; }
.page-head p { color:var(--accent); }

.main-nav button { color:rgba(255,255,255,.66); }
.main-nav button:hover { background:rgba(255,255,255,.07); color:#fff; }
.main-nav button.active { background:rgba(113,145,169,.24) !important; color:#fff !important; box-shadow:inset 3px 0 #9bb4c7; }
.main-nav button.active::before { display:none; }
.main-nav button.active .nav-icon { color:#bdd0de; opacity:1; }
.main-nav button b { background:var(--accent-warm); }

button.active,
.ip-section-nav button.active, .tl-tabs button.active, .te-nav button.active,
.wecom-workspace-tabs button.active, .wecom-side-tabs button.active,
.wecom-group-tabs button.active, .wecom-period-tabs button.active,
.wecom-stage-phases button.active, .wecom-glucose-day-picker button.active,
.wecom-time-tabs button.active {
  border-color:var(--accent-dark) !important;
  background:var(--accent-dark) !important;
  color:#fff !important;
  box-shadow:none !important;
}
.tl-tabs b { background:rgba(78,104,126,.12); color:inherit; }
button.active b { background:rgba(255,255,255,.18); }

input:focus, select:focus, textarea:focus,
.ip-field input:focus, .ip-field textarea:focus,
.wecom-ai-fields input:focus, .wecom-ai-fields select:focus, .wecom-ai-fields textarea:focus {
  border-color:#71899c !important;
  box-shadow:0 0 0 3px rgba(78,104,126,.11) !important;
}
.ip-inline-template { border-color:#cbd4db; background:#f8f8f8; color:#4b6071; }
.ip-patient-banner, .tl-hero { border-color:#d9e0e5; background:linear-gradient(125deg,rgba(255,255,255,.95),rgba(235,241,245,.82)); }
.ip-avatar, .avatar, .user-menu > div:first-child, .wecom-avatar { background:#e6edf2; color:#405c72; }
.ip-panel, .ip-commandbar, .tl-card { box-shadow:0 7px 22px rgba(44,58,69,.045); }
.ip-total-kcal strong, .plan-card .plan-metric { color:var(--accent-dark); }
.ip-stage-index { background:var(--accent-soft); color:var(--accent); }
.ip-nutrient-bars b { background:var(--accent-warm); }
.ip-nutrient-bars b.good { background:#6f8799; }
.ip-nutrient-bars b.over { background:var(--accent-danger); }
.ip-macro-check.ok, .ip-publish-checks > div.ok, .ip-publish-checks > div.ok i,
.ip-checklist i.done { background:var(--accent-soft); color:var(--accent-dark); }
.ip-publish-checks > div:not(.ok), .ip-checklist i:not(.done) { background:var(--accent-warm-soft); color:#8e622f; }
.tl-card header em { background:var(--accent-soft); color:var(--accent); }

.wecom-message.out p { border-color:#526e84; background:#526e84; color:#fff; }
.wecom-switch input:checked + i { background:#58758c !important; }
.wecom-account-status i, .sidebar-foot i { background:#8aa4b7 !important; box-shadow:0 0 0 3px rgba(138,164,183,.14) !important; }
.status-pill.low, .review-pill.reviewed, .binding-pill.bound,
.wecom-online, .wecom-status-online { background:var(--accent-soft) !important; color:var(--accent-dark) !important; }
.status-pill.medium, .review-pill.pending { background:var(--accent-warm-soft) !important; color:#8e622f !important; }
.status-pill.high, .review-pill.rejected { background:var(--accent-danger-soft) !important; color:#9e5050 !important; }
.wecom-feature-metrics article > strong.good, .wecom-stage-kpis p.good, .wecom-stage-table em.good { color:#526f85 !important; }
.wecom-feature-metrics article > strong.warn { color:#a97438 !important; }
.wecom-feature-metrics article > strong.danger { color:#a65359 !important; }

.login-view {
  background:
    radial-gradient(circle at 20% 15%,rgba(89,119,141,.10),transparent 34%),
    radial-gradient(circle at 82% 82%,rgba(173,123,67,.07),transparent 30%),
    #f1f3f5;
}
.login-panel { border-color:#d8dde2; background:rgba(255,255,255,.96); box-shadow:0 22px 60px rgba(35,47,57,.11); }
.login-copy > p { color:var(--accent); }
.login-security i { background:#70899c; box-shadow:0 0 0 3px #e4ebf0; }
.toast { border-left-color:#8299aa; background:#28343e; }

@media (max-width:1100px) {
  .te-shell { min-width:860px; }
  .te-meta { grid-template-columns:1fr; }
  .te-meta label.wide { grid-column:auto; }
}
