:root {
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
    --primary: #2f5bea;
  --primary-hover: #2549bf;
  --primary-soft: #eef2ff;
  --success: #0f9f5f;
  --success-soft: #e9f8f0;
  --warning: #d68616;
  --warning-soft: #fff5e5;
  --danger: #cf4b4b;
  --danger-soft: #fff1f1;
  --purple: #5b6bd6;
  --purple-soft: #f0f2ff;
  --title: #1d2433;
  --text: #4a5568;
  --muted: #6d7483;
  --placeholder: #97a0b1;
  --line: #e7e1d8;
  --line-strong: #dbd4c9;
  --page: #f6f4ef;
  --card: #fffdfb;
  --sidebar: linear-gradient(180deg, #fcfbf7 0%, #f6f3ec 100%);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(22, 93, 255, 0.07), transparent 28%),
    linear-gradient(180deg, #f7f9fc 0%, #f2f5fa 100%);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

pre {
  max-height: 360px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #0f172a;
  color: #e5e7eb;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
  white-space: pre-wrap;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 240px;
  height: 100vh;
  padding: 16px 12px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  backdrop-filter: blur(10px);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 4px 8px 14px;
}

.sidebar__logo {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), #5b8cff);
  box-shadow: 0 10px 24px rgba(22, 93, 255, 0.24);
  color: #fff;
  font-weight: 800;
}

.sidebar__brand strong,
.sidebar__brand span,
.tenant-card strong,
.tenant-card span {
  display: block;
}

.sidebar__brand strong {
  color: var(--title);
  font-size: 16px;
  line-height: 24px;
}

.sidebar__brand span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
}

.sidebar__nav {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 6px 0;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group__label {
  padding: 6px 12px 4px;
  color: var(--placeholder);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}

.nav-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 600;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.nav-item:hover {
  background: rgba(22, 93, 255, 0.08);
  color: var(--primary);
  transform: translateX(2px);
}

.nav-item.is-active {
  background: linear-gradient(90deg, rgba(22, 93, 255, 0.14), rgba(22, 93, 255, 0.04));
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item__icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-md);
  background: #f3f4f6;
  color: var(--muted);
}

.nav-item__icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.nav-item span:not(.nav-item__icon) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-item strong {
  color: inherit;
  font-size: 14px;
  line-height: 18px;
}

.nav-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item.is-active .nav-item__icon {
  background: #fffdfa;
  color: var(--primary);
}

.sidebar__footer {
  padding: 12px 4px 0;
}

.tenant-card {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
}

.tenant-card:hover {
  border-color: #c6cff3;
  background: #fffdfa;
}

.tenant-card__label,
.tenant-card__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.tenant-card strong {
  margin: 4px 0;
  color: var(--title);
  font-size: 15px;
  line-height: 22px;
}

.main-shell {
  min-width: 0;
  position: relative;
}

.main-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 180px;
  background: linear-gradient(180deg, rgba(47, 91, 234, 0.06), rgba(47, 91, 234, 0));
  pointer-events: none;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.04);
}

.header__title {
  min-width: 220px;
}

.header__title h1 {
  margin: 0;
  color: var(--title);
  font-size: 22px;
  font-weight: 700;
  line-height: 30px;
}

.header__title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.header__actions,
.hero-panel__actions,
.toolbar,
.config-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.content {
  display: grid;
  gap: 20px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px 24px 32px;
}

.card,
.workmap {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: 0 8px 24px rgba(34, 39, 51, 0.05);
  animation: fadeIn 200ms var(--ease-out);
}

.section-card {
  padding: 20px;
  background: linear-gradient(180deg, #fffdfb 0%, #fcfbf8 100%);
}

.section-card__header,
.section-card__header--compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-card__header h3,
.workmap__header h3 {
  margin: 4px 0 0;
  color: var(--title);
  font-size: 20px;
  font-weight: 700;
  line-height: 30px;
}

.section-card__header h4,
.config-card__header h4 {
  margin: 0;
  color: var(--title);
  font-size: 16px;
  line-height: 24px;
}

.section-card__header p,
.workmap__header p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.section-eyebrow {
  display: inline-flex;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.04em;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  gap: 24px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid #dde4f1;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% 12%, rgba(47, 91, 234, 0.12), transparent 26%),
    linear-gradient(135deg, #ffffff 0%, #faf9f6 56%, #f2f6ff 100%);
  box-shadow: 0 16px 34px rgba(34, 39, 51, 0.07);
}

.hero-panel h2 {
  max-width: 780px;
  margin: 14px 0 12px;
  color: var(--title);
  font-size: 34px;
  font-weight: 800;
  line-height: 44px;
  letter-spacing: -0.02em;
}

.hero-panel p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 24px;
}

.hero-panel__copy {
  min-width: 0;
}

.hero-panel__actions {
  margin-top: 22px;
}

.hero-panel__summary {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
  border: 1px solid #dde4f1;
  border-radius: var(--radius-xl);
  background: #fffdfa;
  box-shadow: var(--shadow-md);
}

.summary-kpi span,
.summary-kpi strong {
  display: block;
}

.summary-kpi span {
  color: var(--muted);
  font-size: 13px;
}

.summary-kpi strong {
  margin-top: 4px;
  color: var(--primary);
  font-size: 36px;
  line-height: 44px;
}

.summary-kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.executive-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.executive-card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
  box-shadow: 0 8px 20px rgba(34, 39, 51, 0.05);
}

.executive-card--attention {
  border-color: #f0d3d3;
  background: linear-gradient(180deg, #fffefe 0%, #fff7f7 100%);
}

.executive-card--calm {
  border-color: #d4e6dc;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf8 100%);
}

.executive-card__label {
  display: inline-flex;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.executive-card strong {
  display: block;
  margin-top: 10px;
  color: var(--title);
  font-size: 34px;
  line-height: 40px;
}

.executive-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.summary-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.summary-link {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdfa;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.summary-link:hover {
  border-color: #c6cff3;
  background: var(--primary-soft);
  color: var(--primary);
}

.hero-panel__ai {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}



.detail-hero {
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #fffdfb 0%, #f9f7f2 100%);
}

.detail-hero--project {
  background:
    radial-gradient(circle at top right, rgba(47, 91, 234, 0.08), transparent 28%),
    linear-gradient(180deg, #fffdfb 0%, #f8f6f0 100%);
}

.detail-hero__meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-hero h4 {
  margin: 0;
  color: var(--title);
  font-size: 24px;
  line-height: 32px;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 22px;
}

.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdfa;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-section h4 {
  margin: 0;
  color: var(--title);
  font-size: 16px;
  line-height: 24px;
}

.detail-rich-text {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-rich-list {
  display: grid;
  gap: 12px;
}

.project-edit-form {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.project-edit-additions {
  align-items: start;
}

.project-edit-subpanel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdfa;
}

.project-edit-subpanel > strong {
  color: var(--title);
  font-size: 14px;
}

.detail-section__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-section__title span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-closure-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #fffdfa 0%, #f7f3eb 100%);
}

.task-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.task-action-grid button {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 64px;
  text-align: left;
}

.task-action-grid button span {
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.75;
}

.task-stage-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.task-stage-guide div {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-stage-guide strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef2f8;
  color: var(--title);
  font-size: 12px;
}

.task-stage-guide .is-current {
  border-color: #b9c8e8;
  background: #f8fbff;
  color: var(--title);
  box-shadow: var(--shadow-sm);
}

.task-row-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.task-row-footer > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.record-shell {
  display: grid;
  gap: 12px;
  cursor: default;
}

.record-shell__actions {
  justify-content: flex-end;
}

.project-row--interactive,
.task-card--interactive {
  display: grid;
  gap: 10px;
  width: 100%;
}

.task-card--interactive {
  padding: 16px;
}

.task-card--warning em {
  background: #fff3df;
  color: #89540c;
}

.task-card--review em {
  background: #eef4ff;
  color: #2b5596;
}

.task-card--done em {
  background: #edf8ef;
  color: #2f6d3a;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.detail-mini-grid {
  display: grid;
  gap: 10px;
}

.detail-mini-card {
  display: grid;
  gap: 6px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdfa;
}

.detail-mini-card strong {
  color: var(--title);
  font-size: 14px;
  line-height: 20px;
}

.detail-mini-card span,
.detail-mini-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.detail-mini-card .detail-rich-text {
  font-size: 13px;
  line-height: 1.65;
}

.workmap__grid,
.metrics-grid,
.dashboard-grid,
.closure-board,
.agent-grid,
.config-grid,
.automation-grid,
.architecture-map {
  display: grid;
  gap: 20px;
}

.workmap__grid,
.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid,
.dashboard-grid--primary {
  grid-template-columns: minmax(0, 1.32fr) minmax(320px, 0.68fr);
}

.section-card--wide {
  grid-column: span 2;
}

.closure-board,
.agent-grid,
.config-grid,
.automation-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.architecture-map {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.architecture-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.btn-primary,
.btn-secondary,
.btn-text,
.user-chip,
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms var(--ease-out), border-color 150ms var(--ease-out), color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.btn-primary {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.btn-secondary,
.user-chip,
.mobile-menu-toggle {
  border: 1px solid var(--line);
  background: #fffdfa;
  color: var(--text);
}

.btn-secondary:hover,
.user-chip:hover,
.mobile-menu-toggle:hover {
  background: #f3f6fb;
}

.btn-text {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--primary);
}

.btn-text:hover {
  text-decoration: underline;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 10px;
  border: 0;
  border-radius: 9999px;
  background: #f3f4f6;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.role-switcher {
  display: grid;
  grid-template-columns: auto minmax(112px, 1fr);
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 220px;
  max-width: 320px;
}

.role-switcher span,
.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fffdfa;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), background 150ms var(--ease-out);
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.14);
}

.search-box {
  min-width: 220px;
}

.search-box--wide {
  flex: 1 1 280px;
}

.select-field {
  width: auto;
  min-width: 148px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.field-group {
  display: grid;
  gap: 10px;
  padding: 12px 0 4px;
}

.field-group__title {
  color: var(--title);
  font-size: 13px;
  font-weight: 800;
}

.field-group__body {
  display: grid;
  gap: 12px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.switch input {
  width: 16px;
  min-height: 16px;
}

.query-table,
.project-table,
.mail-list,
.task-stack,
.alert-list,
.timeline,
.focus-list,
.focus-projects,
.agent-run-list,
.management-list,
.detail-list {
  display: grid;
  gap: 10px;
}

.checklist-result {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.checklist-result__header,
.checklist-result__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdfa;
}

.checklist-result__header {
  border-color: #cfdcf8;
  background: #f8fbff;
}

.checklist-result__header strong,
.checklist-result__item strong {
  color: var(--title);
  font-size: 14px;
}

.checklist-result__header span,
.checklist-result__item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  text-align: right;
}

.workmap-card,
.metric-card,
.focus-item,
.focus-project-card,
.project-row,
.mail-row,
.task-item,
.alert-item,
.timeline-item,
.management-row,
.closure-item,
.agent-card,
.config-card,
.retry-row,
.detail-item,
.timeline-line,
.architecture-node,
.architecture-hub {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdfa;
  box-shadow: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), transform 150ms var(--ease-out), background 150ms var(--ease-out);
}

.workmap-card,
.focus-item,
.focus-project-card,
.task-item,
.alert-item,
.timeline-item,
.management-row,
.closure-item,
.architecture-node,
.architecture-hub {
  width: 100%;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.workmap-card:hover,
.metric-card:hover,
.focus-item:hover,
.focus-project-card:hover,
.project-row:hover,
.mail-row:hover,
.task-item:hover,
.alert-item:hover,
.timeline-item:hover,
.management-row:hover,
.closure-item:hover,
.agent-card:hover,
.architecture-node:hover,
.architecture-hub:hover {
  border-color: #c7d7ff;
  background: #fbfdff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.is-danger {
  border-color: #f1d1d1 !important;
  background: linear-gradient(180deg, #fffefe 0%, #fff7f7 100%) !important;
}

.is-warn {
  border-color: #f0dfbf !important;
  background: linear-gradient(180deg, #fffdfa 0%, #fff8ee 100%) !important;
}

.is-calm {
  border-color: #d4e6dc !important;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf8 100%) !important;
}

.workmap-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 142px;
}

.workmap-card__step,
.focus-item__level,
.project-row__rank,
.mail-row__source {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.workmap-card__step {
  width: 34px;
  height: 26px;
}

.metric-card {
  position: relative;
  min-height: 128px;
  padding: 18px;
  overflow: hidden;
  cursor: pointer;
}

.metric-card::after {
  position: absolute;
  right: -28px;
  bottom: -32px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(51, 112, 255, 0.08);
  content: "";
}

.metric-card--warn::after {
  background: rgba(245, 63, 63, 0.08);
}

.metric-card__label,
.metric-card__foot {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.metric-card strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--title);
  font-size: 32px;
  font-weight: 800;
  line-height: 40px;
}

.project-row,
.mail-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(150px, 0.34fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
}

.project-row__rank,
.mail-row__source {
  min-width: 40px;
  min-height: 40px;
  padding: 0 8px;
}

.project-row__health,
.mail-row__meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.project-row__main,
.mail-row > div,
.focus-item__body {
  min-width: 0;
}

.project-row__main strong,
.mail-row strong,
.task-item strong,
.alert-item strong,
.timeline-item strong,
.management-row strong,
.agent-card strong,
.closure-item strong,
.focus-item__body strong,
.focus-project-card strong,
.workmap-card strong,
.architecture-node strong,
.architecture-hub strong {
  display: block;
  overflow: hidden;
  color: var(--title);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  text-overflow: ellipsis;
}

.project-row__main span,
.project-row__main small,
.mail-row span,
.mail-row small,
.task-item span,
.task-item small,
.alert-item span,
.alert-item small,
.timeline-item span,
.timeline-item small,
.management-row span,
.management-row small,
.agent-card p,
.agent-card small,
.closure-item span,
.closure-item small,
.focus-item__body p,
.focus-item__body small,
.focus-item__owner,
.focus-project-card p,
.focus-project-card__meta,
.workmap-card p,
.architecture-node span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  text-overflow: ellipsis;
}

.focus-item__body small {
  white-space: normal;
}

.progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 9999px;
  background: #eef2f7;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.progress-track--lg {
  height: 8px;
  margin-top: 4px;
  background: linear-gradient(180deg, #eef2f7 0%, #e6ebf3 100%);
}

.progress-track__fill {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.progress-track__fill--primary {
  background: linear-gradient(90deg, #2f6bff 0%, #4f8dff 100%);
}

.progress-track__fill--success {
  background: linear-gradient(90deg, #248a4b 0%, #3dbb69 100%);
}

.progress-track__fill--warn {
  background: linear-gradient(90deg, #c68416 0%, #f1b24a 100%);
}

.progress-track__fill--danger {
  background: linear-gradient(90deg, #c94b4b 0%, #ef7a7a 100%);
}

.focus-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.focus-item__level {
  width: 42px;
  height: 32px;
}

.focus-project-card {
  display: grid;
  gap: 10px;
}

.focus-project-card__top,
.config-card__header,
.agent-card__top,
.detail-drawer__header,
.detail-drawer__footer,
.retry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.focus-project-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.closure-item {
  min-height: 118px;
}

.closure-item em {
  display: inline-flex;
  margin-top: 10px;
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.closure-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.alert-item {
  border-color: #ffd7d7;
  background: #fffafa;
}

.timeline-item {
  position: relative;
  padding-left: 18px;
}

.timeline-item::before {
  position: absolute;
  top: 20px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  content: "";
}

.agent-card,
.config-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.agent-run-panel {
  margin-top: 20px;
}

.architecture-panel {
  border-color: #d7e3ff;
  background:
    radial-gradient(circle at 92% 8%, rgba(51, 112, 255, 0.12), transparent 28%),
    linear-gradient(135deg, #fff, #f8fbff);
}

.architecture-node,
.architecture-hub {
  min-height: 132px;
  border-color: #d7e3ff;
}

.architecture-hub {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fff, var(--primary-soft));
  text-align: center;
}

.architecture-hub span {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: var(--radius-xl);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.architecture-flow span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid #dde4f1;
  border-radius: 9999px;
  background: #fffdfa;
  color: var(--primary);
  font-weight: 700;
}

.automation-grid .detail-item,
.database-status .detail-item {
  min-height: 74px;
}

.detail-item {
  display: grid;
  grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf7 100%);
}

.detail-item strong {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.detail-item span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--title);
  line-height: 20px;
}

.empty-state,
.list-empty,
.detail-empty {
  display: grid;
  min-height: 104px;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf7 100%);
  color: var(--muted);
  text-align: center;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(31, 41, 55, 0.38);
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(31, 41, 55, 0.34);
  backdrop-filter: blur(3px);
}

.detail-drawer {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(620px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  background: linear-gradient(180deg, #ffffff 0%, #fcfbf7 100%);
  box-shadow: 0 28px 56px rgba(34, 39, 51, 0.16);
}

.detail-drawer__header,
.detail-drawer__footer {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-drawer__footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.detail-drawer__header span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.detail-drawer__header h3 {
  margin: 2px 0 0;
  color: var(--title);
  font-size: 20px;
  line-height: 30px;
}

.detail-drawer__body {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
  overflow: auto;
}

.detail-operation-guide {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cfdcf8;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #f8fbff 0%, #eef4ff 100%);
}

.detail-operation-guide > div:first-child {
  display: grid;
  gap: 4px;
}

.detail-operation-guide strong {
  color: var(--title);
  font-size: 15px;
  line-height: 20px;
}

.detail-operation-guide span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.detail-operation-guide__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.detail-operation-guide__steps span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(47, 91, 234, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.detail-operation-guide__steps b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
}

.drawer-hero {
  padding: 20px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #2f5bea, #7a8cff);
  color: #fff;
}

.drawer-hero h4 {
  margin: 8px 0;
  font-size: 22px;
  line-height: 30px;
}

.drawer-hero p,
.drawer-hero span {
  color: rgba(255, 255, 255, 0.82);
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-section h4 {
  margin: 0;
  color: var(--title);
  font-size: 16px;
  line-height: 24px;
}

.drawer-section p {
  margin: 0;
  color: var(--muted);
}

.timeline-line {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.timeline-line small {
  color: var(--muted);
}

.mobile-menu-toggle {
  display: none;
}

.is-hidden {
  display: none !important;
}

.page-section {
  display: grid;
  gap: 24px;
  animation: fadeIn 220ms var(--ease-out);
}

.module-guide {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(47, 91, 234, 0.08), transparent 24%),
    #fffdfa;
}

.module-guide__header {
  display: grid;
  gap: 6px;
}

.module-guide__header h3 {
  margin: 0;
  color: var(--title);
  font-size: 20px;
  line-height: 28px;
}

.module-guide__header p {
  margin: 0;
  color: var(--muted);
  line-height: 22px;
}

.module-guide__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.module-guide__item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.module-guide__item:hover {
  border-color: #c7d7ff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.module-guide__item strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--title);
  font-size: 14px;
  line-height: 20px;
}

.module-guide__item em {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.module-guide__item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.is-focus-pulse {
  animation: focusPulse 1100ms var(--ease-out);
}

@keyframes focusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 91, 234, 0.28);
  }

  45% {
    box-shadow: 0 0 0 8px rgba(47, 91, 234, 0.12);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(47, 91, 234, 0);
  }
}

.empty-state {
  padding: 18px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: #fffdfa;
  color: var(--muted);
  text-align: center;
}

.empty-state--actionable {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.empty-state--actionable strong {
  color: var(--title);
  font-size: 14px;
}

.empty-state--actionable span {
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.list-item-card,
.project-row,
.task-card,
.alert-card,
.timeline-item,
.closure-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fffdfa;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}

.list-item-card:hover,
.project-row:hover,
.task-card:hover,
.alert-card:hover,
.timeline-item:hover,
.closure-card:hover {
  border-color: #c7d7ff;
  box-shadow: var(--shadow-sm);
}

.list-item-card strong,
.project-row strong,
.task-card strong,
.alert-card strong,
.timeline-item strong,
.closure-card strong,
.focus-item strong {
  display: block;
  margin-bottom: 4px;
}

.list-item-card span,
.project-row span,
.task-card span,
.alert-card span,
.timeline-item span,
.closure-card span,
.focus-item span {
  display: block;
  color: var(--muted);
}

.list-item-card em,
.project-row em,
.task-card em,
.alert-card em,
.timeline-item em,
.closure-card em,
.focus-item em {
  display: inline-block;
  margin-top: 8px;
  color: var(--title);
  font-style: normal;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f6fb;
}

.management-row,
.agent-card {
  display: grid;
  gap: 12px;
}

@media (max-width: 1280px) {
  .workmap__grid,
  .metrics-grid,
  .module-guide__grid,
  .detail-operation-guide__steps,
  .executive-strip,
  .closure-board,
  .agent-grid,
  .config-grid,
  .automation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-grid--primary,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .section-card--wide {
    grid-column: auto;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .app-layout {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .sidebar {
    width: 64px;
    padding: 12px 8px;
  }

  .sidebar__brand {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar__brand div:not(.sidebar__logo),
  .nav-group__label,
  .nav-item span:not(.nav-item__icon),
  .tenant-card strong,
  .tenant-card__label,
  .tenant-card__meta {
    display: none;
  }

  .nav-item {
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0;
  }

  .tenant-card {
    padding: 8px;
  }
}

@media (max-width: 900px) {
  .architecture-map,
  .architecture-flow {
    grid-template-columns: 1fr;
  }

  .project-row,
  .mail-row,
  .focus-item {
    grid-template-columns: 1fr;
  }

  .project-row__health,
  .mail-row__meta {
    justify-items: start;
  }
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: min(240px, 82vw);
    transform: translateX(-105%);
    transition: transform 200ms var(--ease-out);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .header {
    align-items: stretch;
    flex-direction: column;
    min-height: auto;
    padding: 12px 16px;
  }

  .header__actions {
    align-items: stretch;
  }

  .role-switcher {
    min-width: 0;
    max-width: none;
  }

  .content {
    padding: 16px;
  }

  .hero-panel {
    padding: 22px;
  }

  .hero-panel h2 {
    font-size: 28px;
    line-height: 36px;
  }

  .section-card {
    padding: 16px;
  }

  .section-card__header,
  .section-card__header--compact,
  .toolbar,
  .task-row-footer,
  .config-actions,
  .hero-panel__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box,
  .select-field {
    width: 100%;
    min-width: 0;
  }

  .workmap__grid,
  .metrics-grid,
  .module-guide__grid,
  .executive-strip,
  .closure-board,
  .agent-grid,
  .config-grid,
  .task-action-grid,
  .task-stage-guide,
  .automation-grid {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    inset: auto 12px 12px;
    width: auto;
    max-height: 72vh;
  }
}
