:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #d6deea;
  --soft: #f6f8fb;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --amber: #b7791f;
  --danger: #a33d3d;
  --sidebar: #111827;
  --sidebar-soft: #1f2a44;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

button,
.button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
}

.secondary,
.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover,
.ghost:hover {
  background: var(--soft);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--bg);
}

.auth-card {
  width: min(620px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 18px 46px rgba(28, 40, 35, 0.12);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.summary {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 28px 0 16px;
}

.tab {
  flex: 1;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.stack {
  display: grid;
  gap: 12px;
}

.message {
  min-height: 24px;
  color: var(--danger);
  font-weight: 700;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  padding: 4px 2px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand span,
.brand strong,
.brand small {
  display: block;
}

.brand span {
  color: #7de0d0;
  font-size: 0.78rem;
  font-weight: 900;
}

.brand strong {
  margin-top: 6px;
  font-size: 1.28rem;
  line-height: 1.2;
}

.brand small {
  margin-top: 7px;
  color: #9fb3ad;
  font-weight: 700;
}

#nav {
  display: grid;
  gap: 7px;
}

#nav button {
  justify-content: flex-start;
  min-height: 44px;
  background: transparent;
  color: #dcebe7;
  border: 1px solid transparent;
  padding: 0 12px;
}

#nav button span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #9fded4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 900;
}

#nav button.active,
#nav button:hover {
  background: var(--sidebar-soft);
  border-color: rgba(255, 255, 255, 0.14);
}

#nav button.active span {
  background: var(--accent);
  color: #fff;
}

#logoutButton {
  margin-top: auto;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.main {
  min-width: 0;
  padding: 22px 28px 42px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h2 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.18;
}

.user-badge {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(28, 40, 35, 0.06);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(28, 40, 35, 0.06);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.section-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #fbfcfb;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
  margin-top: 14px;
}

.ops-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 15px;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mini-head strong {
  font-size: 1rem;
}

.mini-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-list,
.action-list {
  display: grid;
  gap: 9px;
}

.activity-list article,
.action-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.activity-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.activity-list strong,
.activity-list span,
.action-list strong,
.action-list span {
  display: block;
}

.activity-list span,
.action-list span,
.empty-state {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.activity-list em {
  border-radius: 8px;
  padding: 5px 9px;
  background: rgba(183, 121, 31, 0.12);
  color: var(--amber);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 900;
}

.notice {
  margin-top: 14px;
  border-left: 4px solid var(--accent);
  background: #f7faf8;
  padding: 14px;
  line-height: 1.7;
}

.notice strong {
  display: block;
}

.table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f8faf8;
}

.cards {
  display: grid;
  gap: 12px;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.item-card h4 {
  margin: 0 0 8px;
}

.item-card p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.6;
}

dialog {
  width: min(680px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(20, 29, 27, 0.22);
}

dialog::backdrop {
  background: rgba(20, 29, 27, 0.42);
}

.dialog-form {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.dialog-form h3 {
  margin: 0 0 4px;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
}

@media (max-width: 1040px) {
  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .tabs,
  menu {
    flex-direction: column;
  }

  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 14px;
  }
}

/* V2 inquiry conversion workbench */
:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #d6deea;
  --soft: #f6f8fb;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --success: #0f8a65;
  --warning: #b7791f;
  --danger: #a33d3d;
  --sidebar: #111827;
  --sidebar-soft: #1f2a44;
  --dark-note: #101827;
}

body {
  background: var(--bg);
  color: var(--ink);
}

button,
.button {
  min-height: 42px;
  border-radius: 6px;
  background: var(--accent);
  font-weight: 800;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
}

.secondary {
  background: #e7f0ff;
  border-color: #d7e5fb;
  color: #174ea6;
}

.secondary:hover {
  background: #dceaff;
}

.ghost {
  background: #eef4ff;
  border-color: #dbe7fb;
  color: #3264a8;
}

.ghost:hover {
  background: #e3edff;
}

input,
textarea,
select {
  border-radius: 6px;
  border-color: var(--line);
  background: #fbfcfe;
  padding: 11px 12px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.app {
  grid-template-columns: 280px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  background: var(--sidebar);
  padding: 24px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 0 16px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fff;
  color: #0b1323;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex: 0 0 auto;
}

.brand span {
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.2;
}

.brand strong {
  margin-top: 3px;
  color: #fff;
  font-size: 1.15rem;
}

.brand small {
  color: #b9c3d5;
  font-size: 0.82rem;
  line-height: 1.5;
}

#nav {
  gap: 8px;
}

#nav button {
  min-height: 40px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #f0f6ff;
  padding: 0 14px;
}

#nav button span {
  width: auto;
  height: auto;
  min-width: 18px;
  background: transparent;
  color: #d6e4ff;
  font-size: 0.9rem;
}

#nav button.active,
#nav button:hover {
  background: #233657;
  border-color: rgba(96, 165, 250, 0.45);
}

#nav button.active span {
  background: transparent;
  color: #fff;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  color: #d7e2f2;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #9fb0c9;
  font-size: 0.78rem;
}

.side-assistant {
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: rgba(37, 99, 235, 0.12);
  color: #eff6ff;
  display: grid;
  gap: 10px;
}

.side-assistant span,
.side-assistant strong {
  display: block;
}

.side-assistant span {
  color: #b9d2ff;
  font-size: 0.78rem;
  font-weight: 800;
}

.side-assistant strong {
  margin-top: 3px;
}

.side-assistant button {
  width: 100%;
  min-height: 36px;
  background: #ffffff;
  color: #174ea6;
}

#logoutButton {
  margin-top: 0;
}

.main {
  padding: 22px;
}

.topbar {
  margin-bottom: 18px;
}

.topbar h2 {
  font-size: 1.5rem;
}

.topbar-copy {
  margin: 6px 0 0;
  color: #8290a6;
  line-height: 1.5;
}

.workspace-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.workspace-tabs button {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: #475467;
  padding: 0 14px;
}

.workspace-tabs button.active,
.workspace-tabs button:hover {
  border-color: #b9cff8;
  background: #eaf2ff;
  color: #174ea6;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.service-badge,
.user-badge {
  border-radius: 8px;
  background: #fff;
  border: 1px solid #b8e0cf;
  color: var(--success);
  font-weight: 800;
  padding: 10px 14px;
}

.service-badge.warn {
  border-color: #efc1c1;
  color: var(--danger);
}

.user-badge {
  border-color: var(--line);
  color: #344054;
}

.workbench-board {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(420px, 1fr) minmax(340px, 420px);
  gap: 14px;
  align-items: start;
}

.left-rail,
.center-stage,
.right-rail {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.wb-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  min-width: 0;
}

.compact-card {
  padding-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.25;
}

.card-head span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label > span {
  color: #344054;
  font-size: 0.86rem;
  font-weight: 700;
}

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

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid .span-two {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.row-actions input {
  min-width: 120px;
}

.product-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 12px;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inline-actions select {
  width: auto;
  min-width: 130px;
}

.wb-card > label {
  margin-bottom: 12px;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: auto;
}

.check-row span {
  font-weight: 700;
}

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

.workflow-actions {
  margin-top: 12px;
}

.workflow-actions button:first-child {
  grid-column: span 2;
}

.fine-print,
.empty-state {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.upload-box {
  border: 1px solid #d8e5fb;
  border-radius: 8px;
  background: #f6f9ff;
  padding: 12px;
  margin-bottom: 12px;
}

.upload-box input[type="file"] {
  background: #fff;
}

.upload-box button {
  width: 100%;
}

.knowledge-manager {
  display: grid;
  grid-template-columns: minmax(280px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.knowledge-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.knowledge-list article {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
  padding: 10px;
}

.knowledge-list strong,
.knowledge-list span {
  display: block;
}

.knowledge-list strong {
  font-size: 0.88rem;
}

.knowledge-list span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.knowledge-edit-list {
  max-height: calc(100vh - 340px);
  min-height: 320px;
}

.knowledge-edit-list article {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) minmax(120px, auto);
  gap: 8px;
  align-items: start;
}

.knowledge-edit-list article.is-disabled {
  background: #f8fafc;
  opacity: 0.78;
}

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

.knowledge-edit-list .status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #d0d5dd;
  color: var(--muted);
  background: #f8fafc;
}

.knowledge-edit-list .status-tag.success {
  border-color: #b7e4d4;
  color: #08704f;
  background: #ecfdf5;
}

.knowledge-edit-list .status-tag.muted {
  border-color: #d0d5dd;
  color: #667085;
  background: #f2f4f7;
}

.knowledge-edit-list textarea {
  grid-column: 1 / 4;
  min-height: 96px;
}

.knowledge-item-actions {
  display: grid;
  gap: 8px;
}

.knowledge-edit-list button {
  min-height: 38px;
  white-space: nowrap;
}

.knowledge-edit-list .danger-outline {
  color: #b42318;
  border-color: #f4b4ad;
  background: #fff7f6;
}

.link-button {
  min-height: 34px;
  justify-content: flex-start;
  padding: 0;
  margin-top: 8px;
  background: transparent;
  color: var(--accent);
}

.link-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

.intent-strip {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.intent-strip span,
.intent-strip strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  background: #eaf2ff;
  color: #174ea6;
  font-size: 0.84rem;
  font-weight: 800;
}

.intent-strip strong {
  background: #fff4df;
  color: var(--warning);
}

.output-area {
  width: 100%;
  min-height: 220px;
  line-height: 1.65;
}

.output-area.warm {
  background: #fffdf7;
  border-color: #f2cf7b;
}

.dark-note {
  margin-top: 8px;
  border-radius: 6px;
  padding: 12px;
  min-height: 48px;
  background: var(--dark-note);
  color: #eff6ff;
  font-size: 0.86rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.small-output .dark-note {
  min-height: 64px;
}

.order-card button {
  width: 100%;
}

.assistant-dialog {
  width: min(880px, calc(100% - 24px));
}

.assistant-panel {
  gap: 14px;
}

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

.assistant-head h3 {
  margin: 0;
}

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

.assistant-tabs .tab {
  min-height: 38px;
}

.assistant-tab-panel {
  display: grid;
  gap: 12px;
}

.drop-zone {
  border: 1px dashed #9db7e8;
  border-radius: 8px;
  background: #f6f9ff;
  padding: 18px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.dragging {
  border-color: var(--accent);
  background: #edf5ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone span {
  color: var(--muted);
  line-height: 1.5;
}

.drop-zone input {
  display: none;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.attachment-list span {
  border-radius: 999px;
  background: #eaf2ff;
  color: #174ea6;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.attachment-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
}

.attachment-list button {
  min-height: 30px;
  padding: 0 10px;
  background: #eef4ff;
  color: #174ea6;
}

.gpt-page {
  min-height: calc(100vh - 170px);
}

.gpt-shell {
  min-height: calc(100vh - 170px);
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
}

.gpt-context-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.gpt-model-card {
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 16px;
}

.gpt-model-card span,
.gpt-model-card strong,
.gpt-model-card p {
  display: block;
}

.gpt-model-card span {
  color: #9db7e8;
  font-size: 0.78rem;
  font-weight: 900;
}

.gpt-model-card strong {
  margin-top: 7px;
  font-size: 1.15rem;
}

.gpt-model-card p {
  margin: 10px 0 0;
  color: #d9e6ff;
  font-size: 0.9rem;
  line-height: 1.6;
}

.gpt-context-list {
  display: grid;
  gap: 8px;
}

.gpt-context-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.gpt-context-list span,
.gpt-context-list strong {
  display: block;
}

.gpt-context-list span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.gpt-context-list strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.gpt-chat-panel {
  min-width: 0;
  min-height: calc(100vh - 170px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto auto;
  overflow: hidden;
}

.gpt-chat-head {
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.gpt-chat-head h3 {
  margin: 0;
  font-size: 1.22rem;
}

.gpt-chat-head p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.gpt-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gpt-mode-switch {
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3fb;
  display: inline-flex;
  gap: 3px;
}

.gpt-mode-switch button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  border: 0;
}

.gpt-mode-switch button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 5px rgba(16, 24, 40, 0.12);
}

.gpt-thread {
  min-height: 300px;
  overflow: auto;
  padding: 18px;
  background: #f6f8fb;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-message {
  display: grid;
  grid-template-columns: 36px minmax(0, 760px);
  gap: 10px;
  align-items: flex-start;
}

.chat-message.user {
  grid-template-columns: minmax(0, 760px) 36px;
  justify-content: flex-end;
}

.chat-message.user .chat-avatar {
  grid-column: 2;
  grid-row: 1;
  background: var(--accent);
  color: #fff;
}

.chat-message.user .chat-bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  background: #eaf2ff;
  border-color: #bdd3ff;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
}

.chat-bubble {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  line-height: 1.65;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.05);
}

.chat-bubble strong {
  display: block;
  margin-bottom: 4px;
}

.chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-bubble.error {
  border-color: #f3b1b1;
  background: #fff5f5;
  color: var(--danger);
}

.chat-files {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-files span {
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.gpt-attachment-list {
  padding: 10px 18px 0;
  background: #fff;
}

.gpt-composer {
  margin: 12px 18px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.08);
}

.gpt-composer.dragging,
.gpt-composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13), 0 12px 24px rgba(16, 24, 40, 0.08);
}

.gpt-composer input[type="file"] {
  display: none;
}

.gpt-composer textarea {
  min-height: 42px;
  max-height: 160px;
  resize: none;
  border: 0;
  padding: 10px 4px;
  box-shadow: none;
  line-height: 1.55;
}

.gpt-composer textarea:focus {
  box-shadow: none;
}

.assistant-status {
  min-height: 28px;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.assistant-status.error {
  color: var(--danger);
}

.generated-image-card {
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.generated-image-card img {
  width: min(520px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.generated-image-card figcaption {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.assistant-output {
  min-height: 170px;
  border-radius: 8px;
  padding: 14px;
  background: var(--dark-note);
  color: #eff6ff;
  line-height: 1.7;
  white-space: pre-wrap;
}

.panel {
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.doc-page {
  display: grid;
  gap: 12px;
}

.doc-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.doc-hero h3 {
  margin: 0;
  font-size: 1.35rem;
}

.doc-hero p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.doc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.doc-toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doc-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-tabs button {
  min-height: 34px;
  background: transparent;
  color: #475467;
  border: 1px solid transparent;
  padding: 0 12px;
}

.doc-tabs button.active,
.doc-tabs button:hover {
  background: #eef4ff;
  color: #174ea6;
  border-color: #d7e5fb;
}

.doc-search {
  width: min(360px, 100%);
}

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

.doc-stats article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.doc-stats span,
.doc-stats strong {
  display: block;
}

.doc-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.doc-stats strong {
  margin-top: 6px;
  font-size: 1.35rem;
}

.doc-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.doc-table table {
  min-width: 1280px;
}

.doc-table th {
  background: #f7f9fc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.doc-table td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.ledger-save-status {
  border: 1px solid #d7e5fb;
  border-radius: 8px;
  background: #f6f9ff;
  color: #174ea6;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 700;
}

.ledger-save-status.error {
  border-color: #ffd0d0;
  background: #fff5f5;
  color: #b42318;
}

.editable-cell {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 6px;
  line-height: 1.45;
  outline: none;
  cursor: text;
  white-space: pre-wrap;
}

.editable-cell + .editable-cell {
  margin-top: 4px;
}

.editable-cell.multi {
  min-width: 220px;
  max-height: 82px;
  overflow: auto;
}

.editable-cell:hover {
  background: #f6f9ff;
  border-color: #d7e5fb;
}

.editable-cell.editing,
.editable-cell:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.editable-cell:empty::before {
  content: attr(data-placeholder);
  color: #98a2b3;
}

.sheet-select {
  min-width: 118px;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 28px 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.sheet-select.red {
  background-color: #ffe8e8;
  color: #b42318;
}

.sheet-select.orange {
  background-color: #fff4df;
  color: #b7791f;
}

.sheet-select.blue {
  background-color: #eaf2ff;
  color: #174ea6;
}

.sheet-select.gray {
  background-color: #eef2f7;
  color: #475467;
}

.pin-col {
  color: #174ea6;
  background: #fbfdff;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #eef2f7;
  color: #475467;
}

.status-badge.blue {
  background: #eaf2ff;
  color: #174ea6;
}

.status-badge.orange {
  background: #fff4df;
  color: #b7791f;
}

.status-badge.red {
  background: #ffe8e8;
  color: #b42318;
}

.status-badge.green {
  background: #e6f6ef;
  color: #0f8a65;
}

.status-badge.gray {
  background: #eef2f7;
  color: #475467;
}

.status-badge.archived {
  background: #f2f4f7;
  color: #667085;
}

.product-archive-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.product-archive-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: #475467;
}

.product-archive-tabs button.active,
.product-archive-tabs button:hover {
  background: #eef4ff;
  border-color: #d7e5fb;
  color: #174ea6;
}

.product-archive-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e6f6ef;
  color: #0f8a65;
  font-size: 0.8rem;
  font-weight: 800;
}

.product-archive-status.archived {
  background: #f2f4f7;
  color: #667085;
}

.archived-row {
  background: #fbfcfe;
}

.archived-row .editable-cell,
.archived-row .sheet-select {
  color: #667085;
}

.actions-cell {
  white-space: nowrap;
}

.table-action {
  min-height: 28px;
  padding: 0 10px;
  margin-top: 6px;
  font-size: 0.78rem;
}

.detail-dialog {
  width: min(860px, calc(100% - 24px));
}

.customer-detail {
  gap: 16px;
}

.detail-head,
.timeline-head,
.timeline-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.detail-head h3,
.timeline-head h4 {
  margin: 0;
}

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

.detail-meta article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 11px;
}

.detail-meta span,
.timeline-head span,
.timeline-title span,
.timeline-event small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.detail-meta strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-event {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.timeline-event.quote .timeline-dot {
  background: var(--warning);
}

.timeline-event.order .timeline-dot {
  background: var(--success);
}

.timeline-event.record .timeline-dot {
  background: #7c3aed;
}

.timeline-title {
  align-items: center;
}

.timeline-event p {
  margin: 8px 0;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
}

@media (max-width: 1500px) {
  .workbench-board {
    grid-template-columns: 340px minmax(420px, 1fr);
  }

  .right-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .workbench-board,
  .right-rail,
  .knowledge-manager {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 14px;
  }

  .topbar,
  .topbar-actions,
  .card-head,
  .doc-hero,
  .doc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .field-grid.two,
  .product-toolbar,
  .button-row,
  .workflow-actions,
  .assistant-tabs,
  .doc-stats,
  .knowledge-edit-list article,
  .attachment-list article {
    grid-template-columns: 1fr;
  }

  .knowledge-edit-list textarea {
    grid-column: auto;
  }

  .workflow-actions button:first-child {
    grid-column: auto;
  }
}


.content-distribution-panel {
  min-height: calc(100vh - 140px);
}

.content-distribution-head {
  align-items: center;
  gap: 16px;
}

.content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.content-link {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: #12315f;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
}

.content-link.secondary {
  background: #eef4ff;
  color: #12315f;
  border: 1px solid #c9d8f2;
}

.content-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.content-status-grid div {
  border: 1px solid #d8e2f0;
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}

.content-status-grid span {
  display: block;
  color: #5e6b7c;
  font-size: 12px;
  margin-bottom: 6px;
}

.content-status-grid strong {
  display: block;
  color: #162238;
  font-size: 14px;
}

.content-distribution-frame {
  width: 100%;
  min-height: 720px;
  border: 1px solid #d8e2f0;
  border-radius: 8px;
  background: #ffffff;
}

@media (max-width: 920px) {
  .content-status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .content-distribution-frame {
    min-height: 680px;
  }
}

@media (max-width: 640px) {
  .content-status-grid {
    grid-template-columns: 1fr;
  }
}

/* Market-inspired B2B operations layer */
.command-center {
  grid-column: 1 / -1;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.command-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.command-head h3 {
  margin: 0;
  font-size: 1.22rem;
}

.command-head p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.command-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.command-metrics article {
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  min-height: 88px;
}

.command-metrics span,
.command-metrics strong,
.command-metrics small {
  display: block;
}

.command-metrics span {
  color: #667085;
  font-size: 0.8rem;
  font-weight: 800;
}

.command-metrics strong {
  margin-top: 8px;
  color: #102a56;
  font-size: 1.55rem;
  line-height: 1;
}

.command-metrics small {
  margin-top: 8px;
  color: #7b8798;
  line-height: 1.35;
}

.command-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 0.85fr;
  gap: 12px;
}

.command-grid > div {
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background: #fbfcff;
  padding: 12px;
  min-width: 0;
}

.pipeline-strip,
.action-queue,
.buyer-insight {
  display: grid;
  gap: 8px;
}

.pipeline-strip article {
  position: relative;
  overflow: hidden;
  min-height: 48px;
  border: 1px solid #e2e8f3;
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
}

.pipeline-strip article div {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-strip strong,
.pipeline-strip span {
  display: block;
}

.pipeline-strip span {
  color: #667085;
  font-size: 0.82rem;
}

.pipeline-strip em {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  min-width: 3px;
  background: #2563eb;
  border-radius: 0 999px 999px 0;
}

.action-queue article {
  border: 1px solid #e2e8f3;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.action-queue strong,
.action-queue span,
.action-queue small {
  display: block;
}

.action-queue span,
.action-queue small {
  margin-top: 4px;
  color: #667085;
  line-height: 1.45;
}

.buyer-insight article {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.buyer-insight article div {
  border: 1px solid #e2e8f3;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.buyer-insight span,
.buyer-insight strong {
  display: block;
}

.buyer-insight span {
  color: #667085;
  font-size: 0.78rem;
  font-weight: 800;
}

.buyer-insight strong {
  margin-top: 5px;
  color: #102a56;
}

.buyer-insight p {
  margin: 2px 0 0;
  color: #475467;
  line-height: 1.55;
}

.quote-guard {
  display: grid;
  gap: 10px;
}

.quote-score {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid #dbe7fb;
  border-radius: 8px;
  background: #f6f9ff;
  padding: 12px;
}

.quote-score strong {
  color: #174ea6;
  font-size: 1.45rem;
}

.quote-score span {
  color: #667085;
  font-weight: 800;
}

.quote-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quote-checks span {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.quote-checks .ok {
  background: #e6f6ef;
  color: #0f8a65;
}

.quote-checks .warn {
  background: #fff4df;
  color: #b7791f;
}

.quote-guard p {
  margin: 0;
  color: #667085;
  line-height: 1.55;
}

@media (max-width: 1320px) {
  .command-metrics,
  .command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .command-head,
  .command-grid,
  .command-metrics,
  .buyer-insight article {
    grid-template-columns: 1fr;
  }

  .command-head {
    flex-direction: column;
  }
}

/* Practical V2 workbench reset */
.ops-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-bottom: 24px;
}

.ops-command {
  grid-column: auto;
  padding: 14px;
  box-shadow: none;
}

.ops-command .command-head {
  margin-bottom: 12px;
}

.ops-command .command-head h3 {
  font-size: 1.12rem;
}

.command-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-command .command-metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-bottom: 0;
}

.ops-command .command-metrics article {
  min-height: 72px;
  padding: 10px 12px;
  background: #f9fbff;
}

.ops-command .command-metrics strong {
  font-size: 1.28rem;
}

.ops-body {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(520px, 1fr) minmax(360px, 420px);
  gap: 12px;
  align-items: start;
}

.ops-left,
.ops-center,
.ops-right {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ops-right {
  position: sticky;
  top: 16px;
  grid-column: auto;
  grid-template-columns: minmax(0, 1fr);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding-right: 2px;
}

.ops-workbench .wb-card {
  padding: 14px;
  box-shadow: none;
}

.ops-workbench .card-head {
  margin-bottom: 12px;
  align-items: flex-start;
}

.ops-workbench .card-head h3 {
  font-size: 1rem;
}

.ops-workbench .card-head p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 0.86rem;
  line-height: 1.45;
}

.compact-head {
  margin-top: 14px;
}

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

.ops-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.ops-workbench textarea {
  min-height: auto;
}

.intake-card #customerMessage {
  min-height: 150px;
}

.intake-card #customerContext {
  min-height: 82px;
}

.product-quote-card #productSellingPoints,
.product-quote-card #productSpec {
  min-height: 92px;
}

.ops-workbench .workflow-actions {
  grid-template-columns: 1.2fr repeat(3, minmax(120px, 0.85fr));
  gap: 8px;
}

.ops-workbench .workflow-actions button:first-child {
  grid-column: auto;
}

.queue-card .pipeline-strip article {
  min-height: 42px;
  padding: 8px 9px;
}

.queue-card .action-queue article {
  padding: 9px;
}

.insight-card .buyer-insight article {
  grid-template-columns: 1fr 1fr;
}

.quote-guard-card .quote-score {
  padding: 10px;
}

.quote-guard-card .quote-checks {
  gap: 6px;
}

.output-card {
  display: grid;
  gap: 12px;
}

.output-card .intent-strip {
  min-height: 34px;
  padding-bottom: 2px;
  border-bottom: 1px solid #e6edf7;
}

.output-section {
  display: grid;
  gap: 8px;
}

.output-section .mini-head {
  margin-bottom: 0;
}

.output-section .inline-actions {
  gap: 6px;
}

.output-section .inline-actions select {
  min-width: 116px;
  max-width: 150px;
  padding: 8px 9px;
}

.output-section .inline-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.output-section .inline-actions #saveAiReplyButton {
  min-width: 120px;
}

.output-card .output-area {
  min-height: 150px;
  line-height: 1.55;
}

.reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #dbe6f5;
  border-radius: 10px;
  background: #f7faff;
  color: #36506f;
  font-size: 0.78rem;
}

.reference-list strong {
  color: #1f2a44;
}

.reference-list span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e3ebf7;
}

.output-card #quoteDraft {
  min-height: 132px;
}

.output-card .dark-note,
.follow-card .dark-note {
  min-height: 42px;
  padding: 10px;
  font-size: 0.82rem;
  line-height: 1.55;
}

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

.follow-card .card-head,
.report-head {
  margin-bottom: 0;
}

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

.follow-card #saveDealButton {
  width: 100%;
}

.product-toolbar {
  grid-template-columns: minmax(0, 1fr) minmax(96px, auto) minmax(96px, auto);
}

.product-quote-card .field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-workbench label > span {
  font-size: 0.8rem;
}

.ops-workbench input,
.ops-workbench textarea,
.ops-workbench select {
  padding: 9px 10px;
}

.ops-workbench button {
  min-height: 38px;
}

@media (max-width: 1580px) {
  .ops-body {
    grid-template-columns: minmax(250px, 290px) minmax(500px, 1fr) minmax(340px, 380px);
  }
}

@media (max-width: 1320px) {
  .ops-body {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }

  .ops-right {
    position: static;
    max-height: none;
    overflow: visible;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
    align-items: start;
  }

  .ops-command .command-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-grid.four,
  .ops-workbench .workflow-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .ops-body,
  .ops-form-grid,
  .ops-right,
  .field-grid.four {
    grid-template-columns: 1fr;
  }

  .ops-command .command-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ops-command .command-metrics,
  .ops-workbench .workflow-actions,
  .deal-grid {
    grid-template-columns: 1fr;
  }

  .product-toolbar {
    grid-template-columns: 1fr;
  }
}

/* Product-grade admin shell */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5eaf2;
  --soft: #eaf3ff;
  --accent: #1677ff;
  --accent-strong: #0f5fd7;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --sidebar: #0b1f3a;
  --sidebar-soft: #12345f;
  --dark-note: #0b1f3a;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

.admin-shell.app {
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--bg);
}

.admin-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.admin-shell .sidebar {
  width: 240px;
  padding: 16px 12px;
  gap: 12px;
  background: var(--sidebar);
}

.admin-shell.sidebar-collapsed .sidebar {
  width: 72px;
  padding: 14px 8px;
}

.admin-shell .brand {
  min-height: 72px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.admin-shell.sidebar-collapsed .brand div:not(.brand-mark),
.admin-shell.sidebar-collapsed .nav-group-head strong,
.admin-shell.sidebar-collapsed .nav-group-head em,
.admin-shell.sidebar-collapsed .nav-children {
  display: none;
}

.sidebar-collapse {
  width: 100%;
  min-height: 34px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #dbeafe;
}

.admin-shell.sidebar-collapsed .sidebar-collapse {
  min-width: 0;
  padding: 0;
  font-size: 0.78rem;
}

#nav {
  overflow: auto;
  padding-right: 2px;
}

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

.nav-group-head {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  color: #dbeafe;
  justify-content: flex-start;
}

.nav-group-head span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
}

.nav-group-head strong {
  flex: 1;
  text-align: left;
  font-size: 0.9rem;
}

.nav-group-head em {
  font-style: normal;
  color: #93c5fd;
}

.nav-group.active .nav-group-head,
.nav-group-head:hover {
  background: var(--sidebar-soft);
  border-color: rgba(255, 255, 255, 0.12);
}

.nav-group.collapsed .nav-children {
  display: none;
}

.nav-children {
  display: grid;
  gap: 2px;
  padding-left: 38px;
}

.nav-children button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: #b8c7dc;
  justify-content: flex-start;
  font-weight: 700;
  font-size: 0.84rem;
}

.nav-children button i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6684aa;
}

.nav-children button.active,
.nav-children button:hover {
  background: rgba(22, 119, 255, 0.18);
  color: #fff;
}

.admin-shell .main {
  padding: 0;
  background: var(--bg);
}

.admin-shell .topbar {
  height: 64px;
  padding: 0 24px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.admin-shell .topbar h2 {
  font-size: 20px;
  font-weight: 600;
}

.admin-shell .topbar-copy {
  margin-top: 3px;
  font-size: 12px;
}

.admin-shell .page-panel {
  margin: 24px;
}

.compact-hero {
  padding: 18px 20px;
}

.page-hero {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.page-hero h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.page-hero p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.home-metrics article {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.home-metrics span,
.home-metrics small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-metrics strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 24px;
  color: var(--ink);
}

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

.home-grid.two {
  grid-template-columns: 1fr 1fr;
}

.home-quick-card {
  margin-bottom: 16px;
}

.trade-hotspot-card {
  margin-bottom: 16px;
  border-color: #dbe5f3;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.hotspot-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.hotspot-filters label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-hotspot-metrics {
  margin: 8px 0 14px;
}

.compact-hotspot-metrics article {
  min-height: 86px;
  box-shadow: none;
}

.hotspot-workbench:empty {
  display: none;
}

.hotspot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-top: 12px;
}

.hotspot-news-list,
.hotspot-opportunity-list {
  display: grid;
  gap: 10px;
}

.hotspot-news-card,
.hotspot-row {
  border: 1px solid #dfe8f5;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.hotspot-news-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.hotspot-news-card strong,
.hotspot-row strong {
  display: block;
  margin: 8px 0 6px;
  color: #101828;
  font-size: 14px;
}

.hotspot-news-card p,
.hotspot-row p {
  margin: 0;
  color: #475467;
  line-height: 1.65;
  font-size: 13px;
}

.hotspot-news-card small,
.hotspot-row small {
  display: block;
  margin-top: 8px;
  color: #667085;
  font-size: 12px;
}

.hotspot-row span {
  display: block;
  color: #667085;
  font-size: 12px;
}

.hotspot-source-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 150px;
}

.hotspot-source-list a {
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  padding: 6px 9px;
  color: #1d4ed8;
  background: #f3f7ff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.hotspot-source-list a:hover {
  border-color: var(--accent);
  background: #eaf1ff;
}

.lead-preview-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 8px 0 12px;
}

.lead-preview-list {
  display: grid;
  gap: 10px;
}

.lead-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #dfe8f5;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
}

.lead-preview-row:hover,
.clickable-kpi:hover {
  border-color: #9fc0ff;
  background: #f6f9ff;
}

.lead-preview-row strong,
.lead-preview-row span {
  display: block;
}

.lead-preview-row span {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.lead-preview-row em {
  color: #1d4ed8;
  font-style: normal;
  font-weight: 900;
}

.lead-preview-row small {
  color: #667085;
}

.clickable-kpi {
  cursor: pointer;
}

.lead-feed-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.lead-feed-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.lead-channel-list {
  display: grid;
  gap: 8px;
}

.lead-channel-list button {
  justify-content: flex-start;
  background: #fff;
  color: #344054;
  border: 1px solid #dfe8f5;
  font-weight: 800;
}

.lead-channel-list button.active {
  color: #1d4ed8;
  border-color: #9fc0ff;
  background: #eef5ff;
}

.lead-feed-list {
  display: grid;
  gap: 10px;
}

.lead-feed-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 12px;
  border: 1px solid #dfe8f5;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  cursor: pointer;
}

.lead-feed-item.active,
.lead-feed-item:hover {
  border-color: #3370ff;
  box-shadow: 0 8px 24px rgba(51, 112, 255, 0.08);
}

.lead-feed-main strong {
  display: block;
  margin: 8px 0 6px;
  color: #101828;
  font-size: 15px;
}

.lead-feed-main p {
  margin: 0;
  color: #475467;
  line-height: 1.6;
  font-size: 13px;
}

.lead-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: #667085;
  font-size: 12px;
}

.lead-feed-item aside {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-left: 1px solid #edf2fa;
}

.lead-feed-item aside strong {
  color: #1d4ed8;
  font-size: 24px;
}

.lead-feed-item aside span {
  color: #667085;
  font-size: 12px;
}

.lead-detail-block h3 {
  margin: 10px 0 8px;
  line-height: 1.45;
}

.lead-detail-block p {
  color: #475467;
  line-height: 1.7;
}

.lead-detail-block dl {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.lead-detail-block dl div {
  border: 1px solid #e4ebf5;
  border-radius: 10px;
  padding: 10px;
  background: #f8fbff;
}

.lead-detail-block dt {
  color: #667085;
  font-size: 12px;
}

.lead-detail-block dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.lead-action-tags,
.lead-push-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-link-button {
  border: 1px solid rgba(51, 112, 255, 0.24);
  background: rgba(51, 112, 255, 0.08);
  color: #1f5eff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.lead-link-button.disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.commerce-reach-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 104px);
  gap: 14px;
}

.commerce-reach-frame {
  width: 100%;
  min-height: calc(100vh - 250px);
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.lead-action-tags span {
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  padding: 6px 9px;
  color: #1d4ed8;
  background: #f3f7ff;
  font-size: 12px;
  font-weight: 800;
}

.lead-push-actions {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .hotspot-filters,
  .hotspot-grid,
  .hotspot-news-card {
    grid-template-columns: 1fr;
  }

  .hotspot-source-list {
    justify-content: flex-start;
    min-width: 0;
  }

  .lead-feed-filters,
  .lead-feed-layout,
  .lead-preview-row {
    grid-template-columns: 1fr;
  }

  .lead-feed-item {
    grid-template-columns: 1fr;
  }

  .lead-feed-item aside {
    border-left: 0;
    border-top: 1px solid #edf2fa;
    padding-top: 10px;
  }
}

.admin-shell .wb-card,
.module-card {
  border-radius: 12px;
  border-color: var(--line);
  background: #fff;
}

.task-list,
.compact-list,
.module-grid {
  display: grid;
  gap: 10px;
}

.task-list article,
.compact-list article {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-list strong,
.compact-list strong,
.task-list span,
.compact-list span {
  display: block;
}

.task-list span,
.compact-list span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

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

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

.quick-grid button {
  min-height: 48px;
  white-space: normal;
  line-height: 1.35;
}

.module-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  min-height: 132px;
}

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

.module-card span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.module-card em {
  justify-self: start;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  padding: 4px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.module-card.active {
  border-color: rgba(22, 119, 255, 0.4);
  box-shadow: 0 10px 24px rgba(22, 119, 255, 0.08);
}

.product-center-grid,
.order-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 16px;
}

.product-library-card {
  display: grid;
  gap: 12px;
}

.product-action-panel {
  display: grid;
  gap: 16px;
  align-self: start;
}

.compact-modules {
  grid-template-columns: 1fr;
}

.compact-modules .module-card {
  min-height: auto;
}

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

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

.automation-row.compact-row {
  grid-template-columns: minmax(240px, 1.4fr) minmax(160px, 0.6fr);
}

.section-focus {
  outline: 3px solid rgba(22, 119, 255, 0.24);
  box-shadow: 0 0 0 6px rgba(22, 119, 255, 0.08);
}

.agent-log-card {
  margin-top: 4px;
}

.agent-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 112px);
}

.agent-list-panel,
.agent-workbench {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.agent-list {
  display: grid;
  gap: 8px;
}

.agent-list button {
  width: 100%;
  min-height: 72px;
  background: #f8fbff;
  color: var(--ink);
  border: 1px solid var(--line);
  justify-content: flex-start;
  padding: 10px;
  text-align: left;
}

.agent-list button.active,
.agent-list button:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.agent-list button span,
.agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex: 0 0 auto;
}

.agent-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.agent-workbench {
  display: grid;
  grid-template-rows: auto auto auto minmax(260px, 1fr) auto auto auto;
  gap: 12px;
}

.agent-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.agent-head h3 {
  margin: 0;
  font-size: 20px;
}

.agent-head p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tags button {
  min-height: 30px;
  padding: 0 10px;
  background: #f3f7ff;
  color: var(--accent);
  border: 1px solid #cfe1ff;
}

.skill-tags button.active,
.skill-tags button:hover {
  background: var(--accent);
  color: #fff;
}

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

.agent-thread {
  min-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f8fb;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 18px;
  color: var(--muted);
}

.table-row {
  display: grid;
  grid-template-columns: 170px 1fr 120px 80px minmax(200px, 1.2fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.automation-page {
  display: grid;
  gap: 16px;
}

.automation-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.automation-tabs button {
  min-height: 34px;
  background: #fff;
  color: var(--ink);
  border: 1px solid transparent;
  padding: 0 12px;
}

.automation-tabs button.active,
.automation-tabs button:hover {
  background: var(--soft);
  border-color: var(--line);
  color: var(--accent);
}

.automation-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 16px;
  min-height: calc(100vh - 240px);
}

.automation-templates,
.automation-chat,
.automation-side .wb-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.automation-templates {
  align-self: start;
  display: grid;
  gap: 12px;
}

.automation-prompt-list {
  display: grid;
  gap: 8px;
}

.automation-prompt-list button {
  min-height: 42px;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.45;
  background: #f8fbff;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 700;
  padding: 9px 10px;
}

.automation-prompt-list button:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.automation-chat {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto auto;
  gap: 12px;
  min-width: 0;
}

.automation-thread {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f8fb;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.automation-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.automation-composer textarea {
  min-height: 58px;
}

.automation-side {
  display: grid;
  gap: 16px;
  align-self: start;
}

.automation-side .compact-list article {
  position: relative;
  padding-right: 0;
}

.automation-side .compact-list button {
  margin-top: 8px;
  min-height: 32px;
}

.automation-table,
.automation-config-grid {
  display: grid;
  gap: 10px;
}

.automation-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(90px, 0.5fr) minmax(120px, 0.8fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(140px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.automation-row div {
  min-width: 0;
}

.automation-row strong,
.automation-row span,
.automation-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.automation-row span,
.automation-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.automation-row button {
  min-height: 34px;
}

.automation-config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.automation-config-grid .module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .home-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-layout {
    grid-template-columns: 1fr;
  }

  .product-center-grid,
  .order-page-grid,
  .automation-layout {
    grid-template-columns: 1fr;
  }

  .automation-row {
    grid-template-columns: 1fr 120px 140px;
  }

  .automation-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-shell.app,
  .admin-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .admin-shell .sidebar {
    position: static;
    width: auto;
    height: auto;
  }

  .home-grid,
  .quick-grid,
  .module-grid,
  .archive-list,
  .detail-meta,
  .agent-context-grid,
  .automation-composer {
    grid-template-columns: 1fr;
  }

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

/* Final login breakpoint override. This must stay at the end of the stylesheet. */
@media (min-width: 1101px) {
  .auth-enterprise-shell {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 430px) !important;
    align-items: center;
  }

  .auth-card {
    width: 100% !important;
    max-width: none !important;
  }
}

@media (max-width: 1100px) {
  .auth-enterprise-shell {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .auth-card {
    order: -1;
  }

  .auth-story-panel h1 {
    font-size: clamp(38px, 13vw, 48px);
  }
}

/* Login density base lock: an early layer kept for older bundled reset blocks. */
#authView.auth-shell {
  overflow: auto;
  place-items: center;
  padding: 28px 18px;
}

#authView .auth-enterprise-shell {
  width: min(1280px, calc(100vw - 48px)) !important;
  gap: 22px;
}

#authView .auth-story-panel {
  min-height: 720px;
  padding: 34px 38px;
  align-content: center;
  gap: 14px;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(31, 35, 41, 0.07);
}

#authView .auth-story-panel h1 {
  margin: 4px 0 0;
  font-size: clamp(50px, 5vw, 76px);
  line-height: 0.98;
}

#authView .auth-slogan {
  margin: 0;
  color: #273b68;
  font-size: 19px;
  font-weight: 700;
}

#authView .auth-story-copy {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

#authView .auth-ops-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#authView .auth-ops-strip article {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dfe5f2;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 6px 16px rgba(31, 35, 41, 0.04);
}

#authView .auth-ops-strip span,
#authView .auth-ops-strip em {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#authView .auth-ops-strip strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

#authView .auth-feature-grid {
  gap: 10px;
}

#authView .auth-feature-grid article,
#authView .auth-case-card,
#authView .auth-role-grid article {
  position: relative;
  z-index: 1;
  border-color: #dfe5f2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

#authView .auth-feature-grid article {
  padding: 13px 15px;
}

#authView .auth-role-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#authView .auth-role-grid article {
  padding: 12px 13px;
}

#authView .auth-role-grid b {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

#authView .auth-role-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

#authView .auth-flow-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  align-items: start;
  gap: 16px;
  padding: 14px 16px;
}

#authView .auth-flow-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#authView .auth-flow-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

#authView .auth-flow-card li i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(51, 112, 255, 0.12);
  flex: 0 0 auto;
}

#authView .auth-proof-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#authView .auth-proof-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

#authView .auth-story-panel .company-lockup {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

@media (min-width: 1101px) {
  #authView .auth-enterprise-shell {
    grid-template-columns: minmax(680px, 1.35fr) minmax(390px, 430px) !important;
  }

  #authView .auth-card {
    width: 100% !important;
    max-width: none !important;
  }
}

@media (max-width: 1280px) {
  #authView .auth-story-panel {
    min-height: auto;
  }

  #authView .auth-ops-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #authView.auth-shell {
    place-items: start center;
  }

  #authView .auth-enterprise-shell {
    width: 100% !important;
  }

  #authView .auth-story-panel {
    padding: 24px;
    gap: 12px;
  }

  #authView .auth-story-panel h1 {
    font-size: clamp(42px, 12vw, 56px);
  }

  #authView .auth-role-grid,
  #authView .auth-flow-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #authView .auth-ops-strip,
  #authView .auth-feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Automation export sidebar fix: long filenames must not push the right panel out. */
.automation-layout,
.automation-templates,
.automation-chat,
.automation-side,
.automation-side .wb-card,
.automation-side .compact-list {
  min-width: 0;
}

.automation-side {
  overflow: hidden;
}

.automation-side .compact-list article.export-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  overflow: hidden;
}

.export-file-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.export-file-row strong,
.export-file-row span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-side .compact-list article.export-file-row button {
  width: 48px;
  min-width: 48px;
  min-height: 34px;
  margin-top: 0;
  padding: 0;
  justify-content: center;
  flex: 0 0 auto;
}

@media (max-width: 1320px) {
  .automation-layout {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .automation-side {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .automation-layout,
  .automation-side {
    grid-template-columns: 1fr;
  }
}

/* Account center refinement: compact identity panel, not a full dashboard. */
#accountDialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

#accountDialog::backdrop {
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(2px);
}

#accountDialog .account-panel {
  max-height: min(680px, calc(100vh - 32px));
  overflow: auto;
  padding: 16px 18px 18px;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

#accountDialog .detail-head {
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f7;
}

#accountDialog .detail-head .eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0;
}

#accountDialog .detail-head h3 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

#accountDialog .detail-head .fine-print {
  margin: 6px 0 0;
  color: #667085;
  font-size: 12px;
}

#accountDialog .account-head-actions {
  flex: 0 0 auto;
}

#accountDialog .account-head-actions button {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
}

#accountDialog .detail-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

#accountDialog .detail-meta article {
  min-height: 56px;
  padding: 9px 11px;
  border-color: #e4e9f2;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.035);
}

#accountDialog .detail-meta .permission-summary {
  grid-column: 1 / -1;
}

#accountDialog .detail-meta span {
  color: #667085;
  font-size: 11px;
  font-weight: 600;
}

#accountDialog .detail-meta strong {
  margin-top: 5px;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

#accountDialog .detail-meta .permission-summary strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

#accountDialog .permission-summary em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid #d6e4ff;
  border-radius: 999px;
  background: #f3f7ff;
  color: #245bdb;
  font-size: 12px;
  font-weight: 600;
  font-style: normal;
  line-height: 1;
}

#accountDialog .stack {
  gap: 10px;
}

#accountDialog .stack h4,
#accountDialog .account-session h4 {
  margin: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

#accountDialog #accountProfileForm,
#accountDialog #passwordForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid #edf1f7;
}

#accountDialog #passwordForm {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#accountDialog #accountProfileForm h4,
#accountDialog #passwordForm h4,
#accountDialog #accountProfileForm button,
#accountDialog #passwordForm button {
  grid-column: 1 / -1;
}

#accountDialog input {
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
}

#accountDialog #accountProfileForm button,
#accountDialog #passwordForm button {
  justify-self: end;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
}

#accountDialog .account-session {
  padding: 10px 11px;
  border: 1px solid #edf1f7;
  border-radius: 12px;
  background: #f8fafc;
}

#accountDialog .account-session p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

#accountDialog .message {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
}

@media (max-width: 720px) {
  #accountDialog {
    width: min(520px, calc(100vw - 20px));
  }

  #accountDialog .detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #accountDialog .detail-meta,
  #accountDialog #accountProfileForm,
  #accountDialog #passwordForm {
    grid-template-columns: 1fr;
  }
}

/* Login density upgrade: keep the first screen useful as a working SaaS entry. */
.auth-enterprise-shell {
  width: min(1280px, calc(100vw - 48px)) !important;
  gap: 22px;
}

.auth-story-panel {
  min-height: 720px;
  padding: 34px 38px;
  align-content: center;
  gap: 14px;
}

.auth-story-panel h1 {
  margin: 4px 0 0;
  font-size: clamp(50px, 5vw, 76px);
  line-height: 0.98;
}

.auth-slogan {
  margin: 0;
  color: #273b68;
  font-size: 19px;
  font-weight: 700;
}

.auth-story-copy {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.auth-ops-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.auth-ops-strip article {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dfe5f2;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 6px 16px rgba(31, 35, 41, 0.04);
}

.auth-ops-strip span,
.auth-ops-strip em {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-ops-strip strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.auth-feature-grid {
  gap: 10px;
}

.auth-feature-grid article,
.auth-case-card,
.auth-role-grid article {
  position: relative;
  z-index: 1;
  border-color: #dfe5f2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.auth-feature-grid article {
  padding: 13px 15px;
}

.auth-role-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-role-grid article {
  padding: 12px 13px;
}

.auth-role-grid b {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.auth-role-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.auth-flow-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  align-items: start;
  gap: 16px;
  padding: 14px 16px;
}

.auth-flow-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-flow-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.auth-flow-card li i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(51, 112, 255, 0.12);
  flex: 0 0 auto;
}

.auth-proof-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-proof-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.auth-story-panel .company-lockup {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

@media (min-width: 1101px) {
  .auth-enterprise-shell {
    grid-template-columns: minmax(680px, 1.35fr) minmax(390px, 430px) !important;
  }
}

@media (max-width: 1280px) {
  .auth-story-panel {
    min-height: auto;
  }

  .auth-ops-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .auth-enterprise-shell {
    width: 100% !important;
  }

  .auth-story-panel {
    padding: 24px;
    gap: 12px;
  }

  .auth-story-panel h1 {
    font-size: clamp(42px, 12vw, 56px);
  }

  .auth-role-grid,
  .auth-flow-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-ops-strip,
  .auth-feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Fixed B2B visual director: role-based SaaS dashboard + permission locks. */
.owner-dashboard {
  --owner-blue: #3370ff;
  --owner-ink: #111827;
  --owner-muted: #667085;
}

.owner-dashboard .compact-hero {
  min-height: 128px;
  background:
    linear-gradient(120deg, rgba(51, 112, 255, 0.08), rgba(255, 255, 255, 0) 58%),
    #ffffff;
}

.owner-dashboard .compact-hero h3 {
  font-size: 26px;
  letter-spacing: 0;
}

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

.owner-kpi-card {
  position: relative;
  min-height: 132px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(31, 35, 41, 0.05);
}

.owner-kpi-card::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #edfdf7;
}

.owner-kpi-card.is-warning::after {
  background: #fff7ed;
}

.owner-kpi-card strong {
  margin-top: 12px;
  font-size: 32px;
}

.owner-health-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.18fr);
  gap: 8px;
}

.owner-score-card,
.owner-bar-card,
.owner-trend-card,
.owner-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.owner-score-card {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-height: 220px;
  padding: 18px;
  color: #ffffff;
  background: linear-gradient(145deg, #3370ff, #2458e6);
}

.owner-score-card span {
  font-weight: 700;
  opacity: 0.9;
}

.owner-score-card strong {
  display: block;
  margin: 16px 0 10px;
  font-size: 46px;
  line-height: 1;
}

.owner-score-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.55;
}

.owner-score-card button,
.owner-score-card .locked-action {
  width: fit-content;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 700;
}

.owner-bar-card {
  display: grid;
  align-content: center;
  gap: 15px;
  min-height: 220px;
  padding: 20px;
}

.owner-bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  color: var(--owner-muted);
  font-size: 13px;
}

.owner-bar-row i {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.owner-bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3370ff, #7aa2ff);
}

.owner-trend-card {
  padding: 14px;
}

.owner-trend-card strong {
  display: block;
  color: var(--owner-ink);
  font-size: 14px;
}

.owner-trend-card span {
  display: block;
  margin-top: 5px;
  color: var(--owner-muted);
  font-size: 12px;
  line-height: 1.5;
}

.owner-line-chart {
  width: 100%;
  min-height: 210px;
  margin-top: 10px;
}

.owner-line-chart .grid {
  stroke: #edf1f7;
  stroke-width: 1;
}

.owner-line-chart .line {
  fill: none;
  stroke: #3370ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.owner-line-chart circle {
  fill: #ffffff;
  stroke: #3370ff;
  stroke-width: 2;
}

.owner-line-chart text {
  fill: #667085;
  font-size: 11px;
  text-anchor: middle;
}

.owner-line-chart .label {
  fill: #7b8494;
}

.owner-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.owner-data-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.owner-data-table th {
  height: 42px;
  padding: 0 12px;
  background: #f8fafc;
  color: #667085;
  font-weight: 700;
  text-align: left;
}

.owner-data-table td {
  padding: 13px 12px;
  border-top: 1px solid #edf1f7;
  color: #1f2937;
  vertical-align: middle;
}

.owner-data-table th:nth-child(1),
.owner-data-table td:nth-child(1) {
  width: 31%;
}

.owner-data-table th:nth-child(2),
.owner-data-table td:nth-child(2) {
  width: 22%;
}

.owner-data-table th:nth-child(3),
.owner-data-table td:nth-child(3) {
  width: 16%;
}

.owner-data-table th:nth-child(4),
.owner-data-table td:nth-child(4) {
  width: 14%;
}

.owner-data-table th:nth-child(5),
.owner-data-table td:nth-child(5) {
  width: 17%;
}

.owner-data-table strong,
.owner-data-table small {
  display: block;
}

.owner-data-table small {
  margin-top: 4px;
  color: #98a2b3;
  font-size: 11px;
}

.owner-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #2563eb;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 700;
}

.owner-status.warn {
  color: #b45309;
  background: #fff7ed;
}

.owner-status.doing {
  color: #047857;
  background: #ecfdf5;
}

.owner-status.paid {
  color: #2563eb;
  background: #eef4ff;
}

.owner-feedback-list,
.owner-event-list {
  display: grid;
  gap: 10px;
}

.owner-event-list {
  margin-top: 14px;
}

.owner-feedback-list article,
.owner-event-list article {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.owner-event-list article {
  grid-template-columns: 1fr;
  background: #f8fafc;
}

.owner-feedback-list article i {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: #98a2b3;
}

.owner-feedback-list article.good i,
.owner-event-list article.good {
  background-color: #ecfdf5;
}

.owner-feedback-list article.good i {
  background: #10b981;
}

.owner-feedback-list article.warning i,
.owner-event-list article.warning {
  background-color: #fff7ed;
}

.owner-feedback-list article.warning i {
  background: #f59e0b;
}

.owner-feedback-list strong,
.owner-event-list strong {
  color: var(--owner-ink);
  font-size: 14px;
}

.owner-feedback-list span,
.owner-event-list em {
  display: block;
  margin-top: 4px;
  color: var(--owner-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}

#nav .nav-children button.nav-lock {
  cursor: not-allowed;
  opacity: 0.58;
  color: #98a2b3;
  background: transparent;
}

#nav .nav-children button.nav-lock:hover {
  border-color: transparent;
  background: transparent;
  color: #98a2b3;
}

#nav .nav-children button.nav-lock em {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #98a2b3;
  font-size: 11px;
  font-style: normal;
}

.locked-action {
  cursor: not-allowed;
  opacity: 0.68;
}

@media (max-width: 1180px) {
  .owner-dashboard .home-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .owner-health-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .owner-dashboard .home-metrics {
    grid-template-columns: 1fr;
  }

  .owner-dashboard .compact-hero h3 {
    font-size: 22px;
  }
}

/* Refined Yilin enterprise logo: clear YL mark with two collaborative orbit lines. */
.enterprise-logo {
  isolation: isolate;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.34) 0 12%, transparent 13%),
    linear-gradient(135deg, #3370ff 0%, #245bdb 62%, #1f4fd1 100%);
}

.enterprise-logo::before,
.enterprise-logo::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.enterprise-logo::before {
  inset: 14px 11px 18px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-left-color: rgba(255, 255, 255, 0.08);
  transform: rotate(-32deg);
}

.enterprise-logo::after {
  inset: 20px 15px 14px;
  border: 2px solid rgba(125, 211, 252, 0.58);
  border-right-color: rgba(255, 255, 255, 0.08);
  transform: rotate(31deg);
}

.enterprise-logo i {
  width: 10px;
  height: 10px;
  right: 15px;
  top: 15px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: -42px 43px 0 rgba(125, 211, 252, 0.88);
  transform: none;
  z-index: 1;
}

.enterprise-logo span {
  z-index: 2;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 1px 10px rgba(17, 24, 39, 0.18);
}

.enterprise-logo.compact span {
  font-size: 17px;
}

/* Final logo legibility pass: keep the mark simple and make YL the primary signal. */
.enterprise-logo::before {
  inset: auto;
  left: 13px;
  right: 13px;
  bottom: 16px;
  height: 2px;
  border: 0;
  background: rgba(255, 255, 255, 0.46);
  transform: rotate(-10deg);
}

.enterprise-logo::after {
  inset: auto;
  width: 8px;
  height: 8px;
  top: 13px;
  right: 13px;
  border: 0;
  background: #7dd3fc;
  box-shadow: -45px 47px 0 rgba(255, 255, 255, 0.72);
  transform: none;
}

.enterprise-logo i {
  display: none;
}

.enterprise-logo span {
  font-size: 24px;
}

/* Login layout breakpoint fix: desktop keeps story + login card side by side. */
@media (min-width: 1101px) {
  .auth-enterprise-shell {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 430px);
    align-items: center;
  }

  .auth-card {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 1100px) {
  .auth-enterprise-shell {
    grid-template-columns: 1fr;
  }
}

/* Feishu-style modern enterprise workspace rebuild 2026-06-20.
   Unified UI for login, dashboard, content, support, CRM and settings. */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1f2329;
  --muted: #646a73;
  --muted-2: #8a9099;
  --line: #e5e6eb;
  --line-strong: #dcdfe5;
  --soft: #f7f8fa;
  --soft-blue: #f0f5ff;
  --accent: #3370ff;
  --accent-strong: #245bdb;
  --success: #2bbf8a;
  --success-soft: #e9f8f2;
  --warning: #f5a623;
  --warning-soft: #fff6e5;
  --danger: #e25555;
  --danger-soft: #fff1f0;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 6px 18px rgba(31, 35, 41, 0.045);
  --shadow-float: 0 12px 32px rgba(31, 35, 41, 0.08);
}

html,
body {
  background: var(--bg) !important;
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
.button {
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.secondary,
.ghost,
.tab,
.workspace-tabs button,
.automation-tabs button,
.doc-tabs button,
.skill-tags button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.secondary:hover,
.ghost:hover,
.tab:hover,
.workspace-tabs button:hover,
.automation-tabs button:hover,
.doc-tabs button:hover,
.skill-tags button:hover {
  background: var(--soft-blue);
  border-color: #c8d8ff;
  color: var(--accent);
}

input,
textarea,
select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #b8bdc7;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.12);
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

/* Login */
.auth-shell {
  min-height: 100vh;
  padding: 32px;
  background:
    linear-gradient(90deg, rgba(229, 230, 235, 0.55) 1px, transparent 1px),
    linear-gradient(180deg, rgba(229, 230, 235, 0.55) 1px, transparent 1px),
    radial-gradient(circle at 12% 18%, rgba(51, 112, 255, 0.10), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(43, 191, 138, 0.10), transparent 28%),
    #f7f9fc !important;
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

.auth-enterprise-shell {
  width: min(1180px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 460px);
  gap: 24px;
  align-items: stretch;
}

.auth-story-panel,
.auth-card {
  border: 1px solid rgba(220, 223, 229, 0.92);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px);
}

.auth-story-panel {
  min-height: 660px;
  padding: 42px;
  display: grid;
  align-content: center;
  gap: 18px;
  overflow: hidden;
  position: relative;
}

.auth-story-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 42px;
  border: 34px solid rgba(51, 112, 255, 0.08);
  transform: rotate(24deg);
}

.enterprise-logo {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3370ff, #245bdb);
  color: #fff;
  box-shadow: 0 14px 28px rgba(51, 112, 255, 0.22);
  overflow: hidden;
}

.enterprise-logo span {
  position: relative;
  z-index: 1;
  font-size: 34px;
  font-weight: 800;
}

.enterprise-logo i {
  position: absolute;
  width: 64px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  transform: rotate(-28deg);
}

.enterprise-logo.compact {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  flex: 0 0 auto;
}

.enterprise-logo.compact span {
  font-size: 25px;
}

.auth-story-panel h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.02;
  font-weight: 800;
  color: #111827;
}

.auth-slogan {
  margin: 0;
  color: #273b67;
  font-size: 22px;
  font-weight: 700;
}

.auth-story-copy {
  width: min(620px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.auth-feature-grid article,
.auth-case-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 15px;
  box-shadow: var(--shadow-card);
}

.auth-feature-grid strong,
.auth-feature-grid span,
.auth-case-card span,
.auth-case-card strong,
.auth-case-card p {
  display: block;
}

.auth-feature-grid strong,
.auth-case-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.auth-feature-grid span,
.auth-case-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-case-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-story-panel .company-lockup {
  margin-top: 8px;
}

.auth-card {
  width: 100%;
  max-width: none;
  padding: 32px;
  align-self: center;
}

.auth-brand-hero {
  display: flex;
  gap: 14px;
  align-items: center;
}

.auth-brand-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
}

.auth-brand-copy p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
}

.auth-card > .summary {
  margin: 22px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--muted);
}

.auth-card .tabs {
  margin: 22px 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  gap: 4px;
}

.auth-card .tab {
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
}

.auth-card .tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(31, 35, 41, 0.08);
}

.auth-card input,
.auth-card select,
.auth-card textarea,
.auth-card form button[type="submit"] {
  min-height: 42px;
}

/* Shell */
.admin-shell.app {
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--bg) !important;
}

.admin-shell .sidebar {
  width: 248px;
  padding: 16px 12px;
  background: #fff !important;
  border-right: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

.admin-shell .brand {
  min-height: 64px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(51, 112, 255, 0.16);
}

.brand span,
.brand strong {
  color: var(--ink) !important;
}

.brand small,
.admin-shell .brand small {
  color: var(--muted) !important;
  font-weight: 500;
}

.sidebar-collapse {
  border-radius: var(--radius-sm);
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

#nav {
  gap: 6px;
}

#nav .nav-group {
  margin-bottom: 4px;
}

#nav .nav-group-head,
#nav .nav-children button {
  border-radius: var(--radius-sm);
}

#nav .nav-group-head {
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
}

#nav .nav-group-head span {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
}

#nav .nav-group.active > .nav-group-head,
#nav .nav-group-head:hover {
  background: var(--soft-blue);
  color: var(--accent);
}

#nav .nav-group.active > .nav-group-head strong,
#nav .nav-group.active > .nav-group-head em {
  color: var(--accent);
}

#nav .nav-children {
  padding-left: 28px;
  gap: 3px;
}

#nav .nav-children button {
  min-height: 34px;
  color: #51565e;
  font-weight: 500;
}

#nav .nav-children button.active {
  background: var(--soft-blue);
  border-color: #dbe7ff;
  color: var(--accent);
}

#nav .nav-children button.active::before {
  background: var(--accent);
}

.admin-shell .main {
  background: var(--bg) !important;
}

.admin-shell .topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 420px) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(31, 35, 41, 0.035);
  backdrop-filter: blur(16px);
}

.admin-shell .topbar h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.admin-shell .topbar-copy {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.global-search span {
  color: var(--muted);
}

.global-search input {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.icon-button,
.user-avatar {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button {
  padding: 0;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.user-avatar {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.service-badge,
.user-badge {
  border-radius: 999px;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
}

.admin-shell .page-panel {
  margin: 20px 24px 28px;
}

/* Unified components */
.page-hero,
.command-center,
.wb-card,
.ops-card,
.module-card,
.gpt-model-card,
.agent-list-panel,
.agent-workbench,
.support-suggest-panel .wb-card,
.automation-templates,
.automation-chat,
.automation-side .wb-card,
.auth-card,
dialog .dialog-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.page-hero,
.compact-hero {
  padding: 20px;
}

.page-hero h3,
.command-head h3,
.card-head h3,
.section-title h3 {
  color: var(--ink);
  font-weight: 700;
}

.page-hero p:last-child,
.command-head p:not(.eyebrow),
.card-head p,
.section-title p,
.fine-print {
  color: var(--muted);
}

.home-metrics,
.command-metrics,
.doc-stats,
.content-status-grid {
  gap: 14px;
}

.home-metrics article,
.command-metrics article,
.content-status-card,
.detail-meta article {
  position: relative;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.home-metrics span,
.command-metrics span,
.home-metrics small,
.command-metrics small {
  color: var(--muted);
  font-weight: 500;
}

.home-metrics strong,
.command-metrics strong,
.detail-meta strong {
  color: var(--ink);
  font-size: 28px;
  font-weight: 750;
  font-feature-settings: "tnum" on;
}

.home-metrics em {
  display: inline-flex;
  margin-top: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  color: var(--success);
  background: var(--success-soft);
}

.home-metrics em.trend-warn {
  color: var(--warning);
  background: var(--warning-soft);
}

.quick-grid,
.module-grid,
.task-list,
.compact-list {
  gap: 12px;
}

.quick-grid button,
.module-card {
  border-radius: var(--radius);
}

.quick-grid button {
  min-height: 48px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}

.quick-grid button:hover,
.module-card:hover,
.task-list article:hover,
.compact-list article:hover {
  background: var(--soft-blue);
  border-color: #c8d8ff;
  box-shadow: none;
}

.module-card {
  min-height: 132px;
  padding: 16px;
}

.module-card em,
.card-head span,
.status-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid #dbe7ff;
  background: var(--soft-blue);
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.status-pill.success {
  border-color: #c8f0df;
  background: var(--success-soft);
  color: #168a63;
}

.status-pill.warning {
  border-color: #ffe1a8;
  background: var(--warning-soft);
  color: #b46a00;
}

.status-pill.info {
  border-color: #dbe7ff;
  background: var(--soft-blue);
  color: var(--accent);
}

.task-list article,
.compact-list article,
.pipeline-strip article,
.action-queue article,
.buyer-insight article div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table,
.enterprise-table {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.enterprise-table th {
  height: 42px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.table td,
.enterprise-table td {
  border-top: 1px solid #edf0f5;
  color: var(--ink);
}

.table tr:nth-child(even) td,
.enterprise-table tr:nth-child(even) td {
  background: #fbfcfe;
}

dialog::backdrop {
  background: rgba(17, 24, 39, 0.28);
}

dialog {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}

.dialog-form {
  padding: 22px;
}

/* Core page layouts */
.ops-body {
  grid-template-columns: minmax(260px, 310px) minmax(560px, 1fr) minmax(340px, 400px);
  gap: 16px;
}

.ops-left,
.ops-center,
.ops-right {
  gap: 16px;
}

.agent-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.agent-list-panel,
.agent-workbench,
.support-suggest-panel {
  min-width: 0;
}

.support-suggest-panel {
  display: grid;
  gap: 16px;
}

.support-suggestion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 14px;
}

.support-suggestion strong,
.support-suggestion p {
  display: block;
  margin: 0;
}

.support-suggestion p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.support-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.product-center-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.product-ai-card {
  display: grid;
  gap: 10px;
}

.product-content-controls {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.product-content-history {
  display: grid;
  gap: 10px;
}

.product-content-history article {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e1e8f3;
  border-radius: 12px;
  background: #fff;
}

.product-content-history article > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.product-content-history span {
  color: #64748b;
  font-size: 0.82rem;
}

.product-content-history pre {
  margin: 0;
  white-space: pre-wrap;
  color: #334155;
  font-family: inherit;
  font-size: 0.86rem;
}

@media (max-width: 760px) {
  .product-content-controls {
    grid-template-columns: 1fr;
  }
}

.generation-history-card {
  margin-top: 18px;
}

.system-detail,
.automation-layout {
  gap: 18px;
}

/* Responsive */
@media (max-width: 1280px) {
  .auth-enterprise-shell,
  .agent-layout,
  .ops-body,
  .product-center-grid,
  .automation-layout {
    grid-template-columns: 1fr;
  }

  .auth-story-panel {
    min-height: auto;
  }

  .admin-shell .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .global-search {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-enterprise-shell {
    width: 100%;
    gap: 14px;
  }

  .auth-story-panel,
  .auth-card {
    padding: 22px;
  }

  .auth-feature-grid,
  .home-grid,
  .home-grid.two,
  .quick-grid,
  .module-grid,
  .support-action-grid,
  .field-grid.two,
  .field-grid.four {
    grid-template-columns: 1fr;
  }

  .admin-shell.app,
  .admin-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .admin-shell .sidebar {
    width: auto;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-shell .page-panel {
    margin: 14px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }
}

/* Artistic login brand pass 2026-06-20.
   Company lockup: 湖南创作者有限公司 x 超启数字（云南）有限公司. */
.auth-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 34px 18px;
  background:
    linear-gradient(90deg, rgba(220, 223, 229, 0.38) 1px, transparent 1px),
    linear-gradient(180deg, rgba(220, 223, 229, 0.34) 1px, transparent 1px),
    linear-gradient(135deg, #fbfcff 0%, #f5f7fb 48%, #eef3ff 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 26%, rgba(51, 112, 255, 0.08) 26% 27%, transparent 27% 100%),
    linear-gradient(155deg, transparent 0 42%, rgba(0, 186, 136, 0.07) 42% 43%, transparent 43% 100%);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 32px));
  max-width: 100%;
  padding: 34px;
  border: 1px solid rgba(220, 223, 229, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(31, 35, 41, 0.10), 0 2px 10px rgba(31, 35, 41, 0.04);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.auth-card *,
.auth-card *::before,
.auth-card *::after {
  min-width: 0;
}

.auth-brand-hero {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.auth-logo {
  position: relative;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(51, 112, 255, 0.12), rgba(0, 186, 136, 0.10)),
    #ffffff;
  border: 1px solid #dbe7ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 12px 30px rgba(51, 112, 255, 0.16);
}

.auth-logo::before,
.auth-logo::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.auth-logo::before {
  inset: 14px;
  border: 1px solid rgba(51, 112, 255, 0.32);
  transform: rotate(-22deg);
}

.auth-logo::after {
  width: 58px;
  height: 28px;
  border: 2px solid rgba(0, 186, 136, 0.36);
  transform: rotate(26deg);
}

.auth-logo-ring {
  position: absolute;
  width: 66px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid transparent;
  pointer-events: none;
}

.auth-logo-ring.ring-a {
  border-top-color: var(--accent);
  border-left-color: rgba(51, 112, 255, 0.54);
  transform: rotate(-34deg);
}

.auth-logo-ring.ring-b {
  border-right-color: var(--success);
  border-bottom-color: rgba(0, 186, 136, 0.54);
  transform: rotate(34deg);
}

.auth-logo-mark {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 8px 20px rgba(31, 35, 41, 0.14);
}

.auth-logo-mark.mark-creator {
  left: 16px;
  top: 18px;
  background: linear-gradient(135deg, #3370ff 0%, #245bdb 100%);
}

.auth-logo-mark.mark-qi {
  right: 14px;
  bottom: 14px;
  background: linear-gradient(135deg, #00ba88 0%, #0a8f72 100%);
}

.auth-brand-copy .eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.auth-brand-copy h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 750;
  line-height: 1.05;
}

.company-lockup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
}

.company-lockup i {
  color: var(--accent);
  font-style: normal;
  font-weight: 800;
}

.auth-card > .summary {
  margin: 22px 0 0;
  padding: 14px 16px;
  border: 1px solid #ebedf0;
  border-radius: 10px;
  background: #f7f9fc;
  color: #51565e;
  line-height: 1.65;
}

.auth-card .tabs {
  margin: 22px 0 14px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f6f7;
}

.auth-card .tab {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #51565e;
  font-weight: 600;
}

.auth-card .tab.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(31, 35, 41, 0.08);
}

.auth-card .stack {
  gap: 10px;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  min-height: 42px;
  border-radius: 8px;
  background: #ffffff;
}

.auth-card form button[type="submit"] {
  min-height: 42px;
  margin-top: 2px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3370ff 0%, #245bdb 100%);
  border-color: #3370ff;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(51, 112, 255, 0.20);
}

.auth-card form button[type="submit"]:hover {
  background: linear-gradient(135deg, #2a5fe6 0%, #1d4ed8 100%);
  border-color: #245bdb;
}

.auth-card .message {
  margin: 12px 0 0;
  min-height: 22px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .auth-shell {
    place-items: start center;
    padding: 24px 12px;
  }

  .auth-card {
    width: calc(100vw - 24px);
    max-width: 100%;
    padding: 24px;
    overflow: hidden;
  }

  .auth-brand-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .auth-logo {
    width: 76px;
    height: 76px;
  }

  .auth-logo-mark {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .company-lockup {
    display: grid;
    gap: 4px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .company-lockup i {
    display: none;
  }

  .auth-brand-copy h1,
  .auth-card > .summary,
  .auth-card input,
  .auth-card select,
  .auth-card textarea,
  .auth-card form button[type="submit"] {
    max-width: 100%;
  }

  .auth-brand-copy h1 {
    font-size: clamp(1.75rem, 10vw, 2.2rem);
    overflow-wrap: anywhere;
  }

  .auth-card > .summary {
    overflow-wrap: anywhere;
  }

  .auth-card form button[type="submit"] {
    width: 100%;
  }
}

/* Feishu nav specificity fix 2026-06-20.
   Overrides legacy #nav button.active dark states. */
#nav .nav-group-head,
#nav .nav-children button {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

#nav .nav-group-head {
  color: var(--ink);
}

#nav .nav-group-head span {
  background: var(--soft);
  color: var(--muted);
}

#nav .nav-group-head strong {
  color: var(--ink);
}

#nav .nav-group-head em {
  color: var(--muted);
}

#nav .nav-group.active > .nav-group-head,
#nav .nav-group-head:hover {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

#nav .nav-group.active > .nav-group-head span,
#nav .nav-group-head:hover span {
  background: #dbe7ff;
  color: var(--accent);
}

#nav .nav-group.active > .nav-group-head strong,
#nav .nav-group-head:hover strong,
#nav .nav-group.active > .nav-group-head em,
#nav .nav-group-head:hover em {
  color: var(--accent);
}

#nav .nav-children button {
  color: #51565e;
  font-weight: 400;
  opacity: 1;
}

#nav .nav-children button i {
  background: #c5cacf;
}

#nav .nav-children button:hover {
  background: var(--soft);
  border-color: transparent;
  color: var(--accent);
}

#nav .nav-children button.active {
  background: var(--accent-soft);
  border-color: #dbe7ff;
  color: var(--accent);
  font-weight: 500;
}

#nav .nav-children button.active i,
#nav .nav-children button:hover i {
  background: var(--accent);
}

#nav .nav-children button.active::before {
  background: var(--accent);
}

#nav .nav-children button.active span,
#nav .nav-children button:hover span {
  background: transparent;
  color: inherit;
}

#nav .nav-children button:not(.active) {
  background: transparent;
  border-color: transparent;
}

/* Awesome Design HTML layout polish 2026-06-20.
   Feishu/Tencent Cloud inspired operations UI. */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1f2329;
  --muted: #646a73;
  --line: #dfe3eb;
  --soft: #f7f9fc;
  --accent: #3370ff;
  --accent-strong: #245bdb;
  --accent-soft: #e8f0ff;
  --success: #00a870;
  --warning: #d46b08;
  --danger: #d92d20;
  --sidebar: #101828;
  --sidebar-soft: #1d2939;
  --shadow-card: 0 8px 22px rgba(16, 24, 40, 0.055);
  --shadow-hover: 0 12px 30px rgba(16, 24, 40, 0.095);
}

body {
  background:
    radial-gradient(circle at 18% -10%, rgba(51, 112, 255, 0.09), transparent 28%),
    linear-gradient(180deg, #f8faff 0%, var(--bg) 42%, #eef3f9 100%);
  color: var(--ink);
}

button,
.button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: none;
}

button:focus-visible,
.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(51, 112, 255, 0.35);
  outline-offset: 2px;
}

.secondary,
.ghost {
  border-color: #d9e2ef;
  background: #ffffff;
  color: #27528f;
}

.secondary:hover,
.ghost:hover {
  border-color: #b7ccf8;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

input,
textarea,
select {
  border-radius: 8px;
  border-color: var(--line);
  background: #ffffff;
}

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

.admin-shell.app {
  grid-template-columns: 252px minmax(0, 1fr);
  background: transparent;
}

.admin-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.admin-shell .sidebar {
  width: 252px;
  padding: 18px 14px;
  gap: 14px;
  background: linear-gradient(180deg, #0f172a 0%, #111827 54%, #172033 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.admin-shell.sidebar-collapsed .sidebar {
  width: 72px;
  padding: 14px 8px;
}

.admin-shell .brand {
  min-height: 68px;
  padding: 6px 4px 16px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.brand-mark {
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(51, 112, 255, 0.26);
}

.admin-shell .brand small {
  color: #98a2b3;
}

.sidebar-collapse {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

#nav {
  gap: 6px;
}

.nav-group {
  gap: 4px;
}

.nav-group-head,
.nav-children button,
#nav button {
  position: relative;
  border-radius: 8px;
}

.nav-group-head {
  min-height: 38px;
  padding: 0 10px;
  color: #d0d5dd;
}

.nav-group-head span {
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
}

.nav-group.active .nav-group-head,
.nav-group-head:hover {
  background: rgba(51, 112, 255, 0.14);
  border-color: rgba(132, 173, 255, 0.2);
  color: #ffffff;
}

.nav-children {
  gap: 3px;
  padding-left: 34px;
}

.nav-children button {
  min-height: 32px;
  color: #bdc6d4;
}

.nav-children button::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-children button.active,
.nav-children button:hover {
  background: rgba(51, 112, 255, 0.16);
  color: #ffffff;
}

.nav-children button.active::before {
  background: #84adff;
}

.admin-shell .main {
  min-width: 0;
  background: transparent;
}

.admin-shell .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: auto;
  min-height: 64px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(216, 222, 233, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.admin-shell .topbar h2 {
  color: var(--ink);
  font-size: 21px;
  font-weight: 650;
}

.admin-shell .topbar-copy {
  color: #667085;
}

.topbar-actions {
  gap: 8px;
}

.service-badge,
.user-badge {
  border-radius: 999px;
  padding: 8px 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.service-badge {
  border-color: rgba(0, 168, 112, 0.28);
  color: var(--success);
}

.user-badge {
  border-color: var(--line);
  color: #344054;
}

.admin-shell .page-panel {
  margin: 22px 28px 30px;
}

.page-hero,
.command-center,
.wb-card,
.ops-card,
.module-card,
.gpt-model-card,
.automation-templates,
.automation-chat,
.automation-side .wb-card {
  border: 1px solid rgba(214, 222, 234, 0.95);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.page-hero {
  padding: 18px 20px;
}

.page-hero h3 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
}

.page-hero p:last-child,
.command-head p:not(.eyebrow),
.card-head p {
  color: #667085;
}

.home-metrics,
.command-metrics,
.content-status-grid {
  gap: 12px;
}

.home-metrics article,
.command-metrics article,
.content-status-card,
.detail-meta article {
  border: 1px solid #e1e7f0;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.035);
}

.home-metrics article {
  padding: 14px 16px;
}

.home-metrics strong,
.command-metrics strong,
.detail-meta strong {
  color: #172b4d;
}

.home-grid,
.home-grid.two,
.product-center-grid,
.order-page-grid,
.automation-page {
  gap: 14px;
}

.home-quick-card,
.admin-shell .wb-card {
  padding: 16px;
}

.task-list article,
.compact-list article,
.pipeline-strip article,
.action-queue article,
.buyer-insight article div,
.command-grid > div,
.automation-row,
.table-row {
  border-color: #e1e7f0;
  border-radius: 10px;
  background: #fbfdff;
}

.task-list article:hover,
.compact-list article:hover,
.module-card:hover,
.table-row:hover {
  border-color: #c8d8f8;
  box-shadow: 0 8px 18px rgba(51, 112, 255, 0.075);
}

.module-card {
  min-height: 122px;
  padding: 14px;
}

.module-card em,
.card-head span {
  border: 1px solid #d6e4ff;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.module-card.active {
  border-color: rgba(51, 112, 255, 0.42);
  box-shadow: 0 10px 24px rgba(51, 112, 255, 0.09);
}

.command-center {
  padding: 16px;
}

.command-grid {
  gap: 12px;
}

.ops-body {
  grid-template-columns: minmax(270px, 310px) minmax(540px, 1fr) minmax(360px, 400px);
  gap: 14px;
}

.ops-left,
.ops-center,
.ops-right {
  gap: 14px;
}

.ops-right {
  top: 78px;
  max-height: calc(100vh - 96px);
}

.ops-workbench .wb-card {
  padding: 15px;
  box-shadow: var(--shadow-card);
}

.ops-workbench .card-head {
  padding-bottom: 11px;
  border-bottom: 1px solid #edf1f7;
}

.ops-workbench .card-head h3 {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
}

.ops-workbench label > span {
  color: #344054;
  font-weight: 700;
}

.ops-workbench input,
.ops-workbench textarea,
.ops-workbench select {
  background: #ffffff;
}

.ops-workbench .workflow-actions {
  gap: 8px;
}

.output-card .intent-strip,
.agent-thread,
.automation-thread {
  border-color: #e1e7f0;
  background: #f8fbff;
}

.table {
  border-color: var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.table th {
  background: #f7f9fc;
  color: #344054;
  font-weight: 800;
}

.table td {
  border-top-color: #edf1f7;
}

@media (max-width: 1580px) {
  .ops-body {
    grid-template-columns: minmax(250px, 292px) minmax(500px, 1fr) minmax(330px, 380px);
  }
}

@media (max-width: 1320px) {
  .ops-body {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }

  .ops-right {
    top: auto;
    max-height: none;
  }
}

@media (max-width: 900px) {
  .admin-shell.app,
  .admin-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .admin-shell .topbar {
    position: static;
    padding: 12px 16px;
  }

  .admin-shell .page-panel {
    margin: 16px;
  }
}

/* Feishu operations UI reset 2026-06-20.
   Strong visual pass: light navigation, calm canvas, dense business panels. */
:root {
  --bg: #f5f6f7;
  --panel: #ffffff;
  --ink: #1f2329;
  --muted: #646a73;
  --line: #dcdfe5;
  --soft: #f7f8fa;
  --accent: #3370ff;
  --accent-strong: #245bdb;
  --accent-soft: #eff4ff;
  --success: #00ba88;
  --warning: #ff9226;
  --danger: #f53f3f;
  --sidebar: #ffffff;
  --sidebar-soft: #f5f6f7;
  --shadow-card: none;
  --shadow-hover: 0 2px 8px rgba(31, 35, 41, 0.08);
}

html,
body {
  background: var(--bg) !important;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

body {
  background: var(--bg) !important;
}

button,
.button {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.secondary,
.ghost,
.tab,
.workspace-tabs button,
.automation-tabs button,
.skill-tags button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.secondary:hover,
.ghost:hover,
.tab:hover,
.workspace-tabs button:hover,
.automation-tabs button:hover,
.skill-tags button:hover {
  background: var(--accent-soft);
  border-color: #bacefd;
  color: var(--accent);
}

input,
textarea,
select {
  min-height: 34px;
  border-radius: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

textarea {
  line-height: 1.5;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #b7bbc2;
}

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

.admin-shell.app {
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--bg) !important;
}

.admin-shell.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.admin-shell .sidebar {
  width: 236px;
  padding: 12px 10px;
  gap: 10px;
  background: #ffffff !important;
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.admin-shell.sidebar-collapsed .sidebar {
  width: 64px;
  padding: 10px 8px;
}

.admin-shell .brand {
  min-height: 58px;
  padding: 6px 8px 12px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(51, 112, 255, 0.24);
}

.brand span,
.brand strong {
  color: var(--ink) !important;
  font-weight: 600;
}

.brand span {
  font-size: 13px;
}

.brand strong {
  margin-top: 2px;
  font-size: 15px;
}

.brand small,
.admin-shell .brand small {
  margin-top: 2px;
  color: var(--muted) !important;
  font-size: 12px;
  font-weight: 400;
}

.sidebar-collapse {
  min-height: 30px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.sidebar-collapse:hover {
  background: var(--soft);
  border-color: var(--line);
  color: var(--accent);
}

#nav {
  gap: 4px;
  padding-right: 0;
}

.nav-group {
  gap: 2px;
  margin-bottom: 4px;
}

.nav-group-head {
  min-height: 34px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  border-radius: 6px;
}

.nav-group-head span {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}

.nav-group-head strong {
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
}

.nav-group-head em {
  color: var(--muted);
  font-size: 12px;
}

.nav-group.active .nav-group-head,
.nav-group-head:hover {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.nav-group.active .nav-group-head span,
.nav-group-head:hover span {
  background: #dbe7ff;
  color: var(--accent);
}

.nav-group.active .nav-group-head strong,
.nav-group-head:hover strong,
.nav-group.active .nav-group-head em,
.nav-group-head:hover em {
  color: var(--accent);
}

.nav-children {
  gap: 1px;
  padding-left: 28px;
}

.nav-children button {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #51565e;
  font-size: 13px;
  font-weight: 400;
}

.nav-children button i {
  background: #c5cacf;
}

.nav-children button::before {
  left: -12px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: transparent;
}

.nav-children button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.nav-children button.active i {
  background: var(--accent);
}

.nav-children button.active::before {
  background: var(--accent);
}

.nav-children button:hover {
  background: var(--soft);
  color: var(--accent);
}

.side-assistant,
.sidebar-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  box-shadow: none;
}

.side-assistant span,
.sidebar-note span {
  color: var(--muted);
}

.side-assistant strong,
.sidebar-note strong {
  color: var(--ink);
}

.side-assistant button {
  background: var(--accent);
  color: #ffffff;
}

.admin-shell .main {
  background: var(--bg) !important;
}

.admin-shell .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 56px;
  height: auto;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: saturate(180%) blur(16px);
}

.admin-shell .topbar h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.admin-shell .topbar-copy {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.topbar-actions {
  gap: 8px;
}

.service-badge,
.user-badge {
  min-height: 30px;
  border-radius: 6px;
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  box-shadow: none;
}

.service-badge {
  border-color: #bdebdc;
  color: var(--success);
  background: #f0fbf8;
}

.user-badge,
.user-avatar {
  cursor: pointer;
}

.user-badge:hover,
.user-avatar:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef5ff;
}

.account-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.account-session h4 {
  margin: 0 0 6px;
}

.account-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.danger-action {
  border-color: #ffd2d2;
  color: var(--danger);
  white-space: nowrap;
}

.danger-action:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fff2f2;
}

.service-badge.warn {
  border-color: #ffd2d2;
  color: var(--danger);
  background: #fff2f2;
}

.admin-shell .page-panel {
  margin: 16px 20px 24px;
}

.page-hero {
  margin-bottom: 12px;
  padding: 14px 16px;
  align-items: center;
}

.page-hero,
.command-center,
.wb-card,
.ops-card,
.module-card,
.gpt-model-card,
.automation-templates,
.automation-chat,
.automation-side .wb-card,
.content-distribution-frame,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.page-hero h3,
.command-head h3,
.card-head h3,
.agent-head h3 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
}

.page-hero h3 {
  font-size: 18px;
}

.page-hero p:last-child,
.command-head p:not(.eyebrow),
.card-head p,
.agent-head p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.hero-actions,
.inline-actions,
.command-actions {
  gap: 8px;
}

.home-metrics {
  gap: 10px;
  margin-bottom: 12px;
}

.home-metrics article,
.command-metrics article,
.content-status-card,
.detail-meta article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.home-metrics article {
  padding: 12px;
  min-height: 88px;
}

.home-metrics span,
.home-metrics small,
.command-metrics span,
.command-metrics small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.home-metrics strong,
.command-metrics strong,
.detail-meta strong {
  margin: 6px 0 2px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
}

.home-grid,
.home-grid.two,
.product-center-grid,
.order-page-grid,
.automation-page,
.command-grid {
  gap: 12px;
}

.home-quick-card,
.admin-shell .wb-card,
.command-center,
.module-card {
  padding: 14px;
}

.quick-grid {
  gap: 8px;
}

.quick-grid button {
  min-height: 40px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
}

.quick-grid button:hover {
  background: var(--accent-soft);
  border-color: #bacefd;
  color: var(--accent);
}

.module-card {
  min-height: 112px;
  gap: 8px;
}

.module-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.module-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.module-card em,
.card-head span {
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
}

.module-card.active {
  border-color: #9dbdff;
  background: #f7faff;
  box-shadow: none;
}

.task-list,
.compact-list,
.module-grid {
  gap: 8px;
}

.task-list article,
.compact-list article,
.pipeline-strip article,
.action-queue article,
.buyer-insight article div,
.command-grid > div,
.automation-row,
.table-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.task-list article,
.compact-list article {
  min-height: 48px;
  padding: 9px 10px;
}

.task-list article:hover,
.compact-list article:hover,
.module-card:hover,
.table-row:hover {
  border-color: #bacefd;
  background: #f7faff;
  box-shadow: none;
}

.command-center {
  border-radius: 8px;
}

.command-head {
  margin-bottom: 12px;
}

.command-metrics {
  gap: 8px;
  margin-bottom: 12px;
}

.command-metrics article {
  min-height: 72px;
  padding: 10px 12px;
}

.command-grid > div {
  padding: 10px;
  background: #ffffff;
}

.ops-body {
  grid-template-columns: minmax(248px, 288px) minmax(560px, 1fr) minmax(330px, 376px);
  gap: 12px;
}

.ops-left,
.ops-center,
.ops-right {
  gap: 12px;
}

.ops-right {
  top: 68px;
  max-height: calc(100vh - 84px);
}

.ops-workbench .wb-card {
  padding: 12px;
  box-shadow: none;
}

.ops-workbench .card-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}

.ops-workbench .card-head h3 {
  font-size: 15px;
  font-weight: 600;
}

.ops-workbench .card-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

label {
  gap: 5px;
}

label > span,
.ops-workbench label > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.field-grid {
  gap: 10px;
  margin-bottom: 10px;
}

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

.ops-form-grid {
  gap: 10px;
}

.ops-workbench input,
.ops-workbench textarea,
.ops-workbench select {
  padding: 7px 9px;
  border-radius: 6px;
  background: #ffffff;
}

.ops-workbench button {
  min-height: 34px;
}

.ops-workbench .workflow-actions {
  gap: 8px;
  grid-template-columns: 1fr repeat(3, minmax(108px, 0.72fr));
}

.output-card .intent-strip,
.agent-thread,
.automation-thread {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.output-card .output-area,
.dark-note {
  border-radius: 8px;
}

.pipeline-strip article,
.action-queue article,
.buyer-insight article div {
  padding: 8px 9px;
}

.pipeline-strip em {
  height: 3px;
  background: var(--accent);
}

.quote-score {
  border-radius: 8px;
}

.table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: none;
}

.table th {
  height: 38px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.table td {
  min-height: 42px;
  border-top: 1px solid #ebedf0;
  color: var(--ink);
}

.table-row {
  padding: 9px 10px;
}

.automation-tabs {
  border-radius: 8px;
  padding: 6px;
}

.automation-tabs button {
  min-height: 30px;
}

.automation-tabs button.active,
.automation-tabs button:hover,
.skill-tags button.active {
  background: var(--accent-soft);
  border-color: #bacefd;
  color: var(--accent);
}

.agent-list button span,
.agent-avatar {
  border-radius: 8px;
  background: var(--accent);
}

@media (max-width: 1580px) {
  .ops-body {
    grid-template-columns: minmax(236px, 276px) minmax(520px, 1fr) minmax(318px, 356px);
  }
}

@media (max-width: 1320px) {
  .ops-body {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  }

  .ops-right {
    top: auto;
    max-height: none;
  }
}

@media (max-width: 900px) {
  .admin-shell.app,
  .admin-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .admin-shell .sidebar {
    width: auto;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-shell .topbar {
    position: static;
    padding: 10px 14px;
  }

  .admin-shell .page-panel {
    margin: 12px;
  }

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

/* Final login breakpoint override. This block intentionally sits after legacy responsive rules. */
@media (min-width: 1101px) {
  .auth-enterprise-shell {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 430px) !important;
    align-items: center;
  }

  .auth-card {
    width: 100% !important;
    max-width: none !important;
  }
}

@media (max-width: 1100px) {
  .auth-enterprise-shell {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .auth-card {
    order: -1;
  }

  .auth-story-panel h1 {
    font-size: clamp(38px, 13vw, 48px);
  }
}

/* Login density EOF lock: true final layer for the working SaaS login screen. */
#authView.auth-shell {
  overflow: auto;
  place-items: center;
  padding: 28px 18px;
}

#authView .auth-enterprise-shell {
  width: min(1280px, calc(100vw - 48px)) !important;
  gap: 22px;
}

#authView .auth-story-panel {
  min-height: 720px;
  padding: 34px 38px;
  align-content: center;
  gap: 14px;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(31, 35, 41, 0.07);
}

#authView .auth-story-panel h1 {
  margin: 4px 0 0;
  font-size: clamp(50px, 5vw, 76px);
  line-height: 0.98;
}

#authView .auth-slogan {
  margin: 0;
  color: #273b68;
  font-size: 19px;
  font-weight: 700;
}

#authView .auth-story-copy {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

#authView .auth-ops-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#authView .auth-ops-strip article {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dfe5f2;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 6px 16px rgba(31, 35, 41, 0.04);
}

#authView .auth-ops-strip span,
#authView .auth-ops-strip em {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#authView .auth-ops-strip strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

#authView .auth-feature-grid {
  gap: 10px;
}

#authView .auth-feature-grid article,
#authView .auth-case-card,
#authView .auth-role-grid article {
  position: relative;
  z-index: 1;
  border-color: #dfe5f2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

#authView .auth-feature-grid article {
  padding: 13px 15px;
}

#authView .auth-role-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#authView .auth-role-grid article {
  padding: 12px 13px;
}

#authView .auth-role-grid b {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

#authView .auth-role-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

#authView .auth-flow-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  align-items: start;
  gap: 16px;
  padding: 14px 16px;
}

#authView .auth-flow-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#authView .auth-flow-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

#authView .auth-flow-card li i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(51, 112, 255, 0.12);
  flex: 0 0 auto;
}

#authView .auth-proof-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#authView .auth-proof-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

#authView .auth-story-panel .company-lockup {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

@media (min-width: 1101px) {
  #authView .auth-enterprise-shell {
    grid-template-columns: minmax(680px, 1.35fr) minmax(390px, 430px) !important;
  }

  #authView .auth-card {
    width: 100% !important;
    max-width: none !important;
  }
}

@media (max-width: 1280px) {
  #authView .auth-story-panel {
    min-height: auto;
  }

  #authView .auth-ops-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #authView.auth-shell {
    place-items: start center;
  }

  #authView .auth-enterprise-shell {
    width: 100% !important;
  }

  #authView .auth-story-panel {
    padding: 24px;
    gap: 12px;
  }

  #authView .auth-story-panel h1 {
    font-size: clamp(42px, 12vw, 56px);
  }

  #authView .auth-role-grid,
  #authView .auth-flow-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #authView .auth-ops-strip,
  #authView .auth-feature-grid {
    grid-template-columns: 1fr;
  }
}


/* Product image chat workbench: OpenAI-like conversational entry, B2B visual baseline */
.product-image-chat-mode .product-center-grid,
.product-image-chat-mode .generation-history-card {
  display: none;
}
.product-image-chat-mode .page-hero {
  margin-bottom: 14px;
}
.product-image-workbench {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: stretch;
}
.pi-agent-panel,
.pi-chat-panel,
.pi-preview-panel {
  background: #fff;
  border: 1px solid #dfe5f0;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .04);
}
.pi-agent-panel,
.pi-preview-panel {
  padding: 14px;
}
.pi-agent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.pi-agent-head strong,
.pi-preview-head strong {
  display: block;
  font-size: 14px;
  color: #111827;
}
.pi-agent-head p,
.pi-agent-card small,
.pi-agent-note,
.pi-preview-empty p,
.pi-checklist p,
.pi-product-strip span,
.pi-chat-head span {
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}
.pi-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #3370ff;
  box-shadow: 0 0 0 5px rgba(51, 112, 255, .12);
}
.pi-agent-card {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  margin-bottom: 8px;
  border: 1px solid #e6ebf3;
  border-radius: 13px;
  background: #fff;
  text-align: left;
  transition: border-color .16s, background .16s, transform .16s;
}
.pi-agent-card:hover,
.pi-agent-card.active {
  border-color: rgba(51, 112, 255, .45);
  background: #f7faff;
  transform: translateY(-1px);
}
.pi-agent-card > span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: #3370ff;
  font-weight: 700;
}
.pi-agent-card strong {
  display: block;
  color: #111827;
  font-size: 13px;
}
.pi-agent-card em {
  font-style: normal;
  color: #3370ff;
  font-size: 12px;
  white-space: nowrap;
}
.pi-agent-note {
  border-top: 1px solid #edf1f7;
  margin-top: 12px;
  padding-top: 12px;
}
.pi-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 680px;
  overflow: hidden;
}
.pi-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf1f7;
}
.pi-chat-head h3 {
  font-size: 20px;
  margin: 2px 0 4px;
  color: #111827;
}
.pi-product-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 18px 0;
  padding: 10px;
  border: 1px solid #e6ebf3;
  border-radius: 12px;
  background: #f8fafc;
}
.pi-product-strip select {
  max-width: 260px;
}
.pi-product-strip strong {
  display: block;
  color: #111827;
  font-size: 14px;
}
.pi-thread {
  flex: 1;
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pi-message {
  display: flex;
  gap: 10px;
  max-width: 84%;
}
.pi-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.pi-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: #3370ff;
  font-weight: 700;
  font-size: 12px;
}
.pi-message.user .pi-avatar {
  background: #3370ff;
  color: #fff;
}
.pi-bubble {
  border: 1px solid #e6ebf3;
  background: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  color: #1f2937;
  line-height: 1.65;
}
.pi-message.user .pi-bubble {
  background: #f2f6ff;
  border-color: #dbe7ff;
}
.pi-bubble strong {
  display: block;
  margin-bottom: 4px;
}
.pi-bubble p {
  margin: 0;
  white-space: pre-wrap;
}
.pi-bubble ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: #667085;
}
.pi-bubble.error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b42318;
}
.pi-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 12px;
}
.pi-prompt-chips button {
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #fff;
  color: #475467;
  padding: 7px 11px;
  font-size: 12px;
}
.pi-prompt-chips button:hover {
  border-color: #3370ff;
  color: #3370ff;
}
.pi-composer {
  margin: 0 18px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}
.pi-composer textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  min-height: 72px;
  outline: none;
  font: inherit;
  color: #111827;
}
.pi-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #edf1f7;
  padding-top: 10px;
}
#productImageStatus {
  margin: 0 18px 16px;
}
.pi-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.pi-preview-head span {
  color: #3370ff;
  background: #eef4ff;
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}
.pi-preview-empty,
.pi-preview-result {
  min-height: 260px;
  border: 1px dashed #cfd8e6;
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc, #fff);
  padding: 18px;
}
.pi-preview-empty span {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: #3370ff;
  font-weight: 700;
  margin-bottom: 8px;
}
.pi-preview-result {
  display: block;
}
.pi-preview-result img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #edf1f7;
  margin-bottom: 10px;
}
.pi-checklist {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #edf1f7;
}
.pi-checklist strong {
  color: #111827;
  display: block;
  margin-bottom: 4px;
}
@media (max-width: 1280px) {
  .product-image-workbench {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .pi-preview-panel {
    grid-column: 1 / -1;
  }
}
@media (max-width: 900px) {
  .product-image-workbench {
    grid-template-columns: 1fr;
  }
  .pi-chat-head,
  .pi-product-strip {
    flex-direction: column;
    align-items: stretch;
  }
  .pi-message {
    max-width: 100%;
  }
}


.operation-log-list {
  display: grid;
  gap: 10px;
}

.operation-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 220px;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid #e5eaf3;
  border-radius: 12px;
  background: #fff;
}

.operation-log-row strong,
.operation-log-row span,
.operation-log-row small {
  display: block;
}

.operation-log-row strong {
  color: #111827;
  font-size: 14px;
}

.operation-log-row span,
.operation-log-row small,
.operation-log-row em,
.operation-log-row time {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.operation-log-row time {
  text-align: right;
}

@media (max-width: 900px) {
  .operation-log-row {
    grid-template-columns: 1fr;
  }

  .operation-log-row time {
    text-align: left;
  }
}
