:root {
  --bg: #eef1ee;
  --ink: #111715;
  --muted: #64706b;
  --line: #d8ded8;
  --panel: #ffffff;
  --panel-soft: #f7f8f4;
  --green: #12664f;
  --blue: #245f96;
  --amber: #b98020;
  --red: #b94848;
  --rail: #17211e;
  --shadow: 0 18px 48px rgba(22, 30, 28, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(18, 102, 79, 0.08), transparent 34%),
    linear-gradient(300deg, rgba(36, 95, 150, 0.08), transparent 36%),
    var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.provider-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.provider-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  background: var(--rail);
  color: #f4f7f2;
  padding: 18px 14px;
}

.provider-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.provider-brand span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: #eef1ee;
  color: #14211d;
  font-weight: 900;
}

.provider-brand strong { font-size: 19px; }
.provider-nav { display: grid; gap: 7px; }

.provider-nav button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(244,247,242,.72);
  padding: 0 12px;
  text-align: left;
}

.provider-nav button.active,
.provider-nav button:hover {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #fff;
}

.sidebar-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 16px;
}

.sidebar-card span,
.provider-topbar span,
.summary-card span,
.section-head span,
.work-card span,
.todo-item span,
.capability-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sidebar-card span { color: rgba(244,247,242,.62); }
.sidebar-card p { margin: 0; color: rgba(244,247,242,.82); line-height: 1.55; }
.provider-main { min-width: 0; }

.provider-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  background: rgba(244,246,242,.82);
  padding: 0 22px;
  backdrop-filter: blur(14px);
}

.provider-topbar h1 {
  margin: 3px 0 0;
  font-size: 24px;
}

.topbar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.topbar-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--rail);
  border-radius: 8px;
  background: var(--rail);
  color: #fff;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.topbar-actions a + a {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 22px 0;
}

.summary-card,
.surface,
.work-board,
.work-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}

.summary-card {
  display: grid;
  gap: 7px;
  min-height: 112px;
  padding: 16px;
}
.summary-card strong { font-size: 31px; line-height: 1; }
.summary-card p,
.work-card p,
.todo-item p,
.capability-card p,
.next-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 16px 22px 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}
.section-head h2 { margin: 3px 0 0; font-size: 18px; }
.section-head strong { color: var(--green); }

.work-list,
.todo-list,
.capability-panel,
.promotion-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.work-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}
.work-card:hover {
  border-color: rgba(18,102,79,.42);
  box-shadow: 0 16px 34px rgba(18,102,79,.12);
}

.work-top,
.work-bottom,
.work-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.work-card h3 { margin: 3px 0 0; font-size: 18px; }
.work-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #e8ece8;
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.tag.capacity,
.tag.active { background: #e1f2eb; color: var(--green); }
.tag.quote,
.tag.pending { background: #fff1d9; color: var(--amber); }
.tag.inquiry,
.tag.review { background: #e8f0f8; color: var(--blue); }
.tag.project,
.tag.alert { background: #fbe4e4; color: var(--red); }

.work-actions a,
.work-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--rail);
  border-radius: 8px;
  background: var(--rail);
  color: #fff;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.work-actions button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.action-rail { display: grid; align-content: start; gap: 12px; }
.todo-item,
.capability-card,
.promotion-card,
.channel-card,
.next-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}
.promotion-card {
  background: linear-gradient(145deg, #fff, #eef6f2);
}
.portal-link {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  padding: 10px;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.lead-list {
  display: grid;
  gap: 8px;
}
.channel-card {
  box-shadow: none;
  background: #fff;
}
.channel-card strong {
  font-size: 20px;
}
.promotion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.promotion-actions a,
.promotion-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--rail);
  border-radius: 8px;
  background: var(--rail);
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}
.promotion-actions button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}
.lead-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.lead-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lead-card a,
.lead-card button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}
.lead-card button {
  cursor: pointer;
  color: var(--ink);
}
.lead-card button:disabled {
  cursor: wait;
  opacity: .72;
}
.next-card {
  margin: 14px;
  background: linear-gradient(145deg, #fff, #f6f7f2);
}

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .action-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .provider-shell,
  .summary-grid,
  .action-rail {
    grid-template-columns: 1fr;
  }
  .provider-sidebar { position: static; min-height: auto; }
  .provider-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .summary-grid,
  .workspace-grid {
    padding-left: 14px;
    padding-right: 14px;
  }
  .work-top,
  .work-bottom,
  .work-actions,
  .channel-grid {
    align-items: flex-start;
    flex-direction: column;
  }
  .channel-grid { display: grid; grid-template-columns: 1fr; }
}
