:root {
  --bg: #171013;
  --panel: #fff8ea;
  --paper: #fffdf8;
  --wine: #7f1835;
  --gold: #e6c071;
  --ink: #241b18;
  --muted: #765f58;
  --line: rgba(127, 24, 53, .16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(230, 192, 113, .18), transparent 32%),
    linear-gradient(135deg, #171013, #2b1420 48%, #42182a);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 850;
}

.primary {
  color: #28140c;
  background: linear-gradient(135deg, #f7d986, var(--gold));
}

.ghost {
  color: #fff8ea;
  background: rgba(255, 255, 255, .12);
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  color: #fff8ea;
  font-weight: 850;
  text-decoration: none;
}

.console-app {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.panel {
  border: 1px solid rgba(230, 192, 113, .22);
  border-radius: 20px;
  background: rgba(255, 248, 234, .96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
}

.login-card {
  width: min(440px, 100%);
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--wine);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

.stack-form,
.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 110px;
  padding: 10px 12px;
  resize: vertical;
}

.layout {
  display: grid;
  min-height: 100vh;
}

.sidebar {
  padding: 20px;
  color: #fff8ea;
  background: rgba(20, 13, 16, .82);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff8ea;
  background: linear-gradient(135deg, var(--wine), #4e1628);
  font-weight: 900;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  color: #fff8ea;
  background: rgba(255, 255, 255, .10);
  text-align: left;
}

.nav button.is-active {
  color: #27170e;
  background: var(--gold);
}

.user-box {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}

.content {
  padding: 18px;
}

.topbar,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.panel {
  padding: 20px;
}

.grid {
  display: grid;
  gap: 16px;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.report-funnel {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.copy-box {
  width: 100%;
  min-height: 220px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.pilot-setup-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
}

.pilot-qr {
  display: block;
  width: min(320px, 100%);
  aspect-ratio: 1;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--wine);
  font-size: 28px;
}

.console-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.console-action-card {
  display: grid;
  min-height: 112px;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid rgba(127, 24, 53, .18);
  border-radius: 16px;
  color: var(--ink);
  background: #fffdf8;
  text-align: left;
  box-shadow: 0 12px 30px rgba(76, 36, 18, .08);
}

.console-action-card strong {
  color: var(--wine);
  font-size: 1rem;
}

.console-action-card span {
  color: #5b4740;
  font-size: .9rem;
  line-height: 1.65;
}

.console-action-card:hover {
  border-color: rgba(127, 24, 53, .34);
  background: #fff7e6;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: #6a2740;
  background: #f7ead1;
  font-size: 12px;
  font-weight: 900;
}

.table-note {
  color: var(--muted);
  font-size: 12px;
}

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

.qr-action-stack {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.qr-thumb {
  width: 84px;
  height: 84px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.qr-url-line {
  margin: 0;
  overflow-wrap: anywhere;
}

.empty,
.message {
  padding: 14px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, .74);
}

.compact-form {
  align-items: end;
}

.lead-detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.detail-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}

.detail-card.wide {
  grid-column: 1 / -1;
}

.detail-card h3 {
  margin: 0;
  color: var(--wine);
  font-size: 18px;
}

.detail-line {
  display: grid;
  gap: 4px;
  margin: 0;
}

.detail-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-line strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.lead-analysis-form {
  margin-top: 16px;
}

.lead-analysis-form textarea {
  min-height: 92px;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .content {
    padding: 28px;
  }

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

.delivery-box {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  line-height: 1.7;
}

.simple-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.inline-input {
  width: min(260px, 100%);
  min-width: 160px;
}

/* Console contrast polish: clearer text on warm panels */
:root {
  --text: #241b18;
  --ink: #211713;
  --muted: #5b433b;
  --line: rgba(127, 24, 53, .24);
}

.login-card,
.panel {
  color: var(--ink);
  background: rgba(255, 248, 234, .98);
}

.login-card p,
.panel p,
label,
.metric span,
.table-note,
.empty,
.message,
.simple-list,
.delivery-box {
  color: #5b433b;
}

h1,
h2,
h3,
.metric strong,
td {
  color: #211713;
}

th {
  color: #604238;
}

input,
select,
.inline-input {
  color: #211713;
  border-color: rgba(127, 24, 53, .28);
  background: #fff;
}

select option,
select optgroup {
  color: #211713;
  background: #fff8ea;
}

button:disabled,
input:disabled,
select:disabled {
  color: #6f564e;
  opacity: .82;
  cursor: not-allowed;
}

input::placeholder {
  color: #7a625a;
}

.empty,
.message,
.delivery-box {
  border: 1px solid rgba(127, 24, 53, .18);
  background: rgba(255, 255, 255, .90);
}

.sidebar .brand span,
.sidebar .user-box span {
  color: #ead7be;
}

.nav button,
.ghost,
.link-button {
  color: #fff8ea;
}

.nav button:not(.is-active),
.ghost {
  background: rgba(255, 255, 255, .16);
}

.tag {
  color: #561c2d;
  background: #f4dfb9;
}

/* WiWi Console readability update */
.topbar [data-status] {
  color: #f7e4c6;
  font-weight: 850;
}

.content .ghost,
.panel .ghost,
.login-card .ghost,
.table-wrap .ghost {
  color: #5a1930;
  border: 1px solid rgba(127, 24, 53, .20);
  background: #f7ead1;
}

.content .ghost:hover,
.panel .ghost:hover,
.login-card .ghost:hover,
.table-wrap .ghost:hover {
  color: #34111d;
  background: #efcf8b;
}

.sidebar .ghost {
  color: #fff8ea;
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .16);
}

.form-note {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid rgba(127, 24, 53, .18);
  border-radius: 14px;
  color: #3b2a24;
  background: rgba(255, 255, 255, .84);
  line-height: 1.65;
}

.plan-help {
  display: grid;
  gap: 6px;
}

.plan-help strong,
.plan-name {
  color: #5a1930;
  font-weight: 950;
}

.plan-help span {
  color: #4f3932;
  font-size: 13px;
  font-weight: 800;
}

.plan-feature-list {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 20px;
  color: #3b2a24;
  font-size: 13px;
}

td .table-note,
.plan-name + br + .table-note {
  color: #5b433b;
}

@media (max-width: 860px) {
  .pilot-setup-grid {
    grid-template-columns: 1fr;
  }
}

.adjustment-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.adjustment-card,
.compact-option-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.adjustment-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.adjustment-card h3 {
  margin: 0;
  font-size: 1rem;
}

.adjustment-card label,
.compact-option-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.adjustment-card input,
.adjustment-card select,
.compact-option-form input {
  width: 100%;
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
}

.inline-check input {
  width: auto;
}

.compact-option-form {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) 88px 76px auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  margin-top: 8px;
}

.workbench-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workbench-hero h2 {
  margin: 2px 0 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.workbench-hero p {
  margin: 0;
  color: #5b433b;
  line-height: 1.55;
}

.workbench-hero-actions,
.workbench-task,
.workbench-risk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workbench-task-list,
.workbench-risk-list,
.workbench-suggestion-list {
  display: grid;
  gap: 10px;
}

.workbench-task-list.compact {
  margin-top: 10px;
}

.workbench-task-archive {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .68);
}

.workbench-task-archive summary {
  cursor: pointer;
  color: #5d2732;
  font-weight: 900;
}

.workbench-task,
.workbench-risk,
.workbench-action,
.workbench-module-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
}

.workbench-task strong,
.workbench-risk strong,
.workbench-action strong,
.workbench-module-card h3 {
  color: var(--ink);
}

.workbench-task p,
.workbench-risk p,
.workbench-action span,
.workbench-module-card p,
.workbench-suggestion-list li {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.workbench-task-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.workbench-task-title span {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff9ef;
  background: #5d2732;
  font-size: .74rem;
  font-weight: 900;
}

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

.workbench-task.is-done {
  border-color: rgba(49, 132, 87, .28);
}

.workbench-task.is-snoozed {
  border-color: rgba(180, 93, 49, .26);
}

.workbench-task.is-needs_ai {
  border-color: rgba(93, 39, 50, .35);
  background: rgba(93, 39, 50, .055);
}

.workbench-metrics,
.workbench-module-grid,
.workbench-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.workbench-module-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.workbench-module-card h3 {
  margin: 8px 0 0;
  font-size: 1.02rem;
}

.workbench-module-card > div > span,
.workbench-suggestion-list span {
  display: inline-flex;
  width: max-content;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff9ef;
  background: #5d2732;
  font-size: .76rem;
  font-weight: 900;
}

.workbench-module-card.is-missing > div > span {
  background: #b45d31;
}

.workbench-action {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.workbench-suggestion-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.workbench-suggestion-list li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
}

.module-catalog-grid,
.module-addon-list,
.module-flow {
  display: grid;
  gap: 12px;
}

.module-catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.module-catalog-card,
.module-addon-card,
.module-flow article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
}

.module-catalog-card,
.module-flow article {
  display: grid;
  gap: 10px;
}

.module-catalog-card span,
.module-flow span {
  display: inline-flex;
  width: max-content;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff9ef;
  background: #5d2732;
  font-size: .76rem;
  font-weight: 900;
}

.module-catalog-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.04rem;
}

.module-catalog-card p,
.module-catalog-card em,
.module-addon-card p,
.module-flow p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.module-addon-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.module-catalog-card em {
  font-style: normal;
}

.module-addon-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.module-flow {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.ai-feedback-mini,
.ai-feedback-decision {
  display: grid;
  gap: 10px;
}

.ai-feedback-mini strong,
.ai-feedback-decision strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.ai-feedback-mini p,
.ai-feedback-decision p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.ai-feedback-stats {
  margin-bottom: 12px;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 760px) {
  .workbench-hero,
  .workbench-hero-actions,
  .workbench-task,
  .workbench-risk {
    align-items: stretch;
    flex-direction: column;
  }

  .workbench-hero-actions .primary,
  .workbench-hero-actions .ghost,
  .workbench-task .ghost,
  .workbench-task-actions .ghost,
  .workbench-risk .ghost {
    width: 100%;
  }

  .workbench-task-actions {
    justify-content: stretch;
  }

  .module-addon-card {
    align-items: stretch;
    flex-direction: column;
  }
}

.console-copilot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  width: min(360px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  color: #34221c;
}

.console-copilot-toggle {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(77, 33, 16, .16);
  border-radius: 999px;
  color: #fff9ef;
  background: #5d2732;
  box-shadow: 0 14px 35px rgba(22, 10, 8, .22);
  font-weight: 950;
  cursor: pointer;
}

.console-copilot-body {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 16px;
  border: 1px solid rgba(77, 33, 16, .12);
  border-radius: 18px;
  background: rgba(255, 252, 246, .97);
  box-shadow: 0 18px 50px rgba(22, 10, 8, .24);
  overflow: auto;
  max-height: calc(100vh - 96px);
}

.console-copilot.is-collapsed .console-copilot-body {
  display: none;
}

.console-copilot-head h2 {
  margin: 2px 0 0;
  font-size: 1.05rem;
  color: #351b22;
}

.console-copilot-desc,
.console-copilot-safe,
.console-copilot-section p,
.console-copilot-section li {
  margin: 0;
  color: #66504a;
  font-size: .88rem;
  line-height: 1.55;
}

.console-copilot-section {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(93, 39, 50, .07);
}

.console-copilot-section strong,
.console-copilot-answer strong {
  color: #5d2732;
}

.console-copilot-section ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.console-copilot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.console-copilot-chips button {
  border: 1px solid rgba(93, 39, 50, .18);
  border-radius: 999px;
  color: #5d2732;
  background: #fff7eb;
  padding: 7px 10px;
  font-weight: 850;
  cursor: pointer;
}

.console-copilot-form {
  display: grid;
  gap: 8px;
}

.console-copilot-form textarea {
  width: 100%;
  min-height: 88px;
  border-radius: 12px;
  resize: vertical;
}

.console-copilot-answer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(93, 39, 50, .18);
  border-radius: 14px;
  color: #241713;
  background: #fff9ed;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .62);
}

.console-copilot-answer p {
  margin: 0;
  color: #241713;
  line-height: 1.65;
}

.console-copilot-answer .ghost {
  border: 1px solid rgba(93, 39, 50, .24);
  color: #4a1f28;
  background: #fff4df;
}

.console-copilot-answer .ghost:hover {
  border-color: rgba(93, 39, 50, .42);
  color: #2f1218;
  background: #ffe8bd;
}

.console-copilot-answer .ghost.is-selected {
  border-color: rgba(93, 39, 50, .54);
  color: #fff9ef;
  background: #5d2732;
}

.console-copilot-feedback-status {
  margin: 0;
  color: #5d2732;
  font-size: .84rem;
  font-weight: 850;
  line-height: 1.5;
}

.console-copilot-learning {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(93, 39, 50, .12);
  border-radius: 14px;
  background: rgba(255, 249, 237, .92);
  color: #2d1a16;
}

.console-copilot-learning strong {
  color: #4a1f28;
  font-size: .94rem;
}

.console-copilot-learning p,
.console-copilot-learning li {
  margin: 0;
  color: #5b463f;
  font-size: .86rem;
  line-height: 1.55;
}

.console-copilot-learning ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.console-copilot-learning-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.console-copilot-learning-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff4df;
  color: #5d2732;
  font-size: .78rem;
  font-weight: 850;
}

.progress-meter {
  --progress: 0%;
  display: grid;
  gap: 7px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(93, 39, 50, .12);
  border-radius: 14px;
  background: rgba(255, 249, 237, .82);
}

.progress-meter.is-compact {
  margin: 10px 0 0;
  padding: 8px 10px;
}

.progress-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #4a1f28;
  font-size: .84rem;
  font-weight: 900;
}

.progress-meter-head strong {
  color: #2d1a16;
  font-size: .9rem;
}

.progress-meter-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 39, 50, .12);
}

.progress-meter-bar i {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: #d96a61;
}

.progress-meter.tone-warn .progress-meter-bar i {
  background: #d7a840;
}

.progress-meter.tone-good .progress-meter-bar i {
  background: #38a46d;
}

.progress-meter p {
  margin: 0;
  color: #6c5148;
  font-size: .82rem;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .compact-option-form {
    grid-template-columns: 1fr 1fr;
  }

  .console-copilot {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .console-copilot-body {
    max-height: 62vh;
  }
}

/* Backoffice layout readability polish: make the AI helper a right rail on desktop and tighten dashboard density. */
@media (min-width: 900px) {
  .content {
    padding: 22px;
  }

  .topbar,
  .panel-head {
    gap: 10px;
  }

  .grid,
  .metrics,
  .workbench-task-list,
  .workbench-risk-list,
  .workbench-suggestion-list,
  .workbench-module-grid,
  .workbench-action-grid,
  .console-action-grid {
    gap: 10px;
  }

  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .metric,
  .workbench-task,
  .workbench-risk,
  .workbench-action,
  .workbench-module-card,
  .console-action-card {
    padding: 12px;
    border-radius: 12px;
  }

  .metric strong {
    margin-top: 4px;
    font-size: 24px;
  }

  .workbench-hero {
    gap: 12px;
  }

  .workbench-hero h2 {
    font-size: clamp(1.22rem, 2vw, 1.65rem);
  }

  .workbench-hero p,
  .workbench-task p,
  .workbench-risk p,
  .workbench-action span,
  .workbench-module-card p,
  .workbench-suggestion-list li,
  .console-action-card span {
    line-height: 1.45;
  }

  .workbench-module-grid,
  .workbench-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  th,
  td {
    padding: 9px 10px;
    font-size: .9rem;
  }
}

@media (min-width: 1180px) {
  .layout {
    grid-template-columns: 260px minmax(0, 1fr) minmax(300px, 352px);
  }

  .sidebar {
    padding: 18px;
  }

  .console-copilot {
    position: sticky;
    top: 18px;
    right: auto;
    bottom: auto;
    align-self: start;
    z-index: 18;
    width: auto;
    max-height: calc(100vh - 36px);
    padding: 18px 18px 18px 0;
  }

  .console-copilot-toggle {
    min-height: 38px;
  }

  .console-copilot-body {
    gap: 10px;
    max-height: calc(100vh - 96px);
    padding: 14px;
    border-radius: 16px;
  }

  .console-copilot-section,
  .console-copilot-answer {
    padding: 10px;
  }
}

@media (min-width: 900px) and (max-width: 1179px) {
  .content {
    padding-bottom: 168px;
  }

  .console-copilot-body {
    max-height: 45vh;
  }
}

/* V-1 restaurant operations visual system */
body {
  background:
    radial-gradient(circle at 14% 14%, rgba(184, 130, 58, .15), transparent 30%),
    linear-gradient(135deg, #fff9ed 0%, #f0e2cf 48%, #1f1819 100%);
}

.content {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .18)),
    transparent;
}

.panel {
  border-color: rgba(93, 39, 50, .14);
  background:
    linear-gradient(145deg, rgba(255, 252, 245, .96), rgba(255, 247, 233, .9));
  box-shadow: 0 22px 52px rgba(65, 38, 24, .12);
}

.workbench-hero {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 24px;
  border-color: rgba(184, 130, 58, .28);
  background:
    linear-gradient(112deg, rgba(24, 21, 22, .96) 0%, rgba(41, 34, 33, .93) 55%, rgba(172, 121, 55, .24) 100%);
  box-shadow: 0 24px 68px rgba(36, 24, 20, .22);
}

.workbench-hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -54% 45%;
  height: 165%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(217, 163, 87, .34), transparent 60%);
}

.workbench-hero > * {
  position: relative;
  z-index: 1;
}

.workbench-hero h2 {
  color: #fff9ef;
  font-size: 2.32rem;
  line-height: 1.08;
}

.workbench-hero p {
  max-width: 44rem;
  color: #f5e6d1;
  font-size: 1.04rem;
}

.workbench-hero .eyebrow {
  color: #e1b676;
}

.command-metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(182px, 1fr));
  gap: 14px;
}

.command-metric-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  min-height: 130px;
  padding: 18px;
  border: 1px solid rgba(184, 130, 58, .24);
  border-radius: 14px;
  color: #fff9ef;
  background:
    linear-gradient(145deg, rgba(38, 33, 32, .98), rgba(18, 16, 17, .94)),
    #1d1818;
  box-shadow: 0 20px 48px rgba(46, 31, 22, .2);
}

.command-metric-card span,
.command-metric-card small {
  display: block;
}

.command-metric-card span {
  color: #e1b676;
  font-size: .86rem;
  font-weight: 950;
}

.command-metric-card strong {
  display: block;
  margin: 8px 0 6px;
  color: #fff9ef;
  font-size: 2.18rem;
  line-height: 1;
}

.command-metric-card small {
  color: #f2dcc4;
  line-height: 1.42;
}

.command-metric-card.tone-good {
  border-color: rgba(80, 153, 108, .38);
}

.command-metric-card.tone-warn {
  border-color: rgba(225, 182, 118, .48);
}

.command-metric-card.tone-risk {
  border-color: rgba(190, 77, 73, .46);
}

.command-metric-card.tone-accent {
  border-color: rgba(82, 127, 146, .42);
}

.mini-bars {
  display: flex;
  align-items: end;
  gap: 5px;
  width: 58px;
  height: 58px;
}

.mini-bars i {
  flex: 1;
  min-width: 8px;
  height: var(--bar);
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, #efca89, #a96f33);
}

.workbench-task,
.workbench-risk,
.workbench-action,
.workbench-module-card,
.workbench-suggestion-list li {
  border-color: rgba(184, 130, 58, .18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(255, 247, 234, .86));
  box-shadow: 0 12px 30px rgba(65, 38, 24, .08);
}

.workbench-task {
  border-left: 4px solid #b8823a;
}

.workbench-task.is-done {
  border-left-color: #4f996c;
}

.workbench-task.is-snoozed {
  border-left-color: #527f92;
}

.progress-meter {
  padding: 12px;
  border: 1px solid rgba(184, 130, 58, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .7);
}

.progress-meter-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 39, 50, .1);
}

.progress-meter-bar i {
  background: linear-gradient(90deg, #4f996c, #d8a861);
}

.progress-meter.tone-risk .progress-meter-bar i {
  background: linear-gradient(90deg, #be4d49, #d8a861);
}

.progress-meter.tone-warn .progress-meter-bar i {
  background: linear-gradient(90deg, #b8823a, #d8a861);
}

.metric {
  border-color: rgba(184, 130, 58, .18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 248, 236, .9));
  box-shadow: 0 12px 28px rgba(65, 38, 24, .08);
}

.chart-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.boss-insight-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.boss-insight-card {
  min-width: 0;
  min-height: 136px;
  padding: 16px;
  border: 1px solid rgba(184, 130, 58, .2);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 247, 234, .9));
  box-shadow: 0 14px 34px rgba(65, 38, 24, .08);
}

.boss-insight-card span,
.boss-insight-card strong,
.boss-insight-card p {
  display: block;
}

.boss-insight-card span {
  color: #8b612d;
  font-size: .84rem;
  font-weight: 950;
}

.boss-insight-card strong {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.06;
}

.boss-insight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.boss-insight-card.tone-good {
  border-color: rgba(79, 153, 108, .36);
}

.boss-insight-card.tone-warn {
  border-color: rgba(184, 130, 58, .38);
}

.boss-insight-card.tone-risk {
  border-color: rgba(190, 77, 73, .4);
}

.boss-insight-card.tone-accent {
  border-color: rgba(82, 127, 146, .38);
}

.ops-health-board {
  display: grid;
  grid-template-columns: minmax(210px, .82fr) minmax(0, 1.9fr);
  gap: 14px;
  align-items: stretch;
}

.ops-health-lead,
.ops-health-card {
  min-width: 0;
  border: 1px solid rgba(184, 130, 58, .2);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 247, 234, .9));
  box-shadow: 0 14px 34px rgba(65, 38, 24, .08);
}

.ops-health-lead {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border-radius: 20px;
}

.ops-health-lead span,
.ops-health-card-head strong {
  color: #8b612d;
  font-size: .86rem;
  font-weight: 950;
}

.ops-health-lead strong {
  color: var(--ink);
  font-size: clamp(2.7rem, 8vw, 5.5rem);
  line-height: .95;
}

.ops-health-lead p,
.ops-health-card p,
.ops-health-card em {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.ops-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.ops-health-card {
  display: grid;
  gap: 10px;
  padding: 15px;
  border-radius: 16px;
}

.ops-health-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.ops-health-card-head span {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 950;
}

.ops-health-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(51, 38, 28, .12);
}

.ops-health-bar i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c08a42, #8b612d);
}

.ops-health-card em {
  display: block;
  color: var(--ink);
  font-style: normal;
  font-weight: 850;
}

.ops-health-board.tone-good .ops-health-lead,
.ops-health-card.tone-good {
  border-color: rgba(79, 153, 108, .38);
}

.ops-health-board.tone-warn .ops-health-lead,
.ops-health-card.tone-warn {
  border-color: rgba(184, 130, 58, .45);
}

.ops-health-board.tone-risk .ops-health-lead,
.ops-health-card.tone-risk {
  border-color: rgba(190, 77, 73, .46);
}

.ops-health-card.tone-good .ops-health-bar i {
  background: linear-gradient(90deg, #4f996c, #a8d5ad);
}

.ops-health-card.tone-warn .ops-health-bar i {
  background: linear-gradient(90deg, #b8823a, #e7c887);
}

.ops-health-card.tone-risk .ops-health-bar i {
  background: linear-gradient(90deg, #be4d49, #e5a18c);
}

.analysis-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(184, 130, 58, .18);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 247, 234, .9));
  box-shadow: 0 14px 34px rgba(65, 38, 24, .08);
}

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

.analysis-head strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.analysis-head span {
  border: 1px solid rgba(184, 130, 58, .28);
  border-radius: 999px;
  padding: 4px 8px;
  color: #7b4f22;
  background: rgba(184, 130, 58, .09);
  font-size: .76rem;
  font-weight: 950;
}

.analysis-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.analysis-bar-list,
.analysis-rank {
  display: grid;
  gap: 10px;
}

.analysis-bar-row,
.rank-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.analysis-bar-row span,
.rank-row span {
  color: var(--ink);
  font-size: .9rem;
  font-weight: 850;
}

.analysis-bar-row > div,
.rank-row > div {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 39, 50, .1);
}

.analysis-bar-row i,
.rank-row i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8a861, #9a662e);
}

.analysis-bar-row strong,
.rank-row strong {
  color: var(--ink);
  font-size: .94rem;
}

.analysis-bar-row.tone-good i {
  background: linear-gradient(90deg, #4f996c, #b8dfbe);
}

.analysis-bar-row.tone-warn i {
  background: linear-gradient(90deg, #b8823a, #e1b676);
}

.analysis-bar-row.tone-risk i {
  background: linear-gradient(90deg, #be4d49, #e1b676);
}

.analysis-bar-row.tone-accent i {
  background: linear-gradient(90deg, #527f92, #abc8d2);
}

.donut-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff8ec 0 55%, transparent 56%),
    conic-gradient(#b8823a calc(var(--p) * 1%), rgba(93, 39, 50, .1) 0);
}

.donut strong {
  color: var(--ink);
  font-size: 1.45rem;
}

.spark-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
  min-height: 132px;
  align-items: end;
}

.spark-bars div {
  display: grid;
  gap: 7px;
  align-items: end;
  min-width: 0;
}

.spark-bars i {
  display: block;
  height: var(--h);
  min-height: 12px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #d8a861, #6f4626);
}

.spark-bars span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  text-align: center;
}

@media (max-width: 760px) {
  .workbench-hero {
    display: grid;
    padding: 18px;
  }

  .workbench-hero h2 {
    font-size: 1.72rem;
  }

  .command-metric-strip,
  .command-metric-card {
    grid-template-columns: 1fr;
  }

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

  .mini-bars {
    width: 100%;
    height: 38px;
  }

  .workbench-task,
  .workbench-risk {
    display: grid;
  }

  .analysis-bar-row,
  .rank-row {
    grid-template-columns: 74px minmax(0, 1fr) auto;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }
}

/* V-3 backend design system unification */
.content {
  min-width: 0;
  padding: clamp(18px, 2.6vw, 34px);
}

.layout {
  background:
    radial-gradient(circle at 8% 0%, rgba(230, 192, 113, .16), transparent 34%),
    linear-gradient(135deg, #171013, #2b1420 48%, #42182a);
}

.topbar {
  border-bottom: 1px solid rgba(230, 192, 113, .18);
  background:
    linear-gradient(90deg, rgba(255, 248, 234, .96), rgba(255, 255, 255, .9)),
    rgba(255, 248, 234, .94);
  backdrop-filter: blur(18px);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(20, 13, 16, .95), rgba(34, 20, 25, .9)),
    rgba(20, 13, 16, .88);
}

.nav button,
.nav a {
  min-height: 46px;
  border-radius: 14px;
}

.nav button.is-active,
.nav a.is-active {
  border-color: rgba(230, 192, 113, .32);
  background: linear-gradient(135deg, rgba(230, 192, 113, .18), rgba(255, 255, 255, .08));
}

.panel,
.metric,
.workbench-task,
.workbench-risk,
.workbench-action,
.workbench-module-card,
.module-catalog-card,
.module-addon-card,
.module-flow article,
.command-metric-card,
.analysis-card,
.detail-card,
.adjustment-card,
.compact-option-form {
  border-color: rgba(184, 130, 58, .22);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(65, 38, 24, .1);
}

.panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(255, 248, 236, .88)),
    #fffdf8;
}

.panel-head {
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2,
.panel-head h3,
.workbench-hero h2,
.module-catalog-card h3 {
  color: #241b18;
  font-size: var(--font-section);
  letter-spacing: 0;
}

.panel-head p,
.workbench-hero p,
.workbench-task p,
.workbench-risk p,
.workbench-action span,
.workbench-module-card p,
.module-catalog-card p,
.module-addon-card p,
.module-flow p,
.analysis-card p {
  color: #6f5a51;
  font-size: .96rem;
  line-height: 1.55;
}

.workbench-hero {
  border: 1px solid rgba(184, 130, 58, .2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 0%, rgba(230, 192, 113, .24), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(255, 246, 232, .84));
  box-shadow: 0 26px 70px rgba(65, 38, 24, .14);
}

.metrics,
.workbench-metrics,
.command-metric-strip,
.chart-analysis-grid,
.module-catalog-grid,
.module-addon-list,
.module-flow {
  gap: 16px;
}

.metric {
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 246, 232, .9));
}

.metric span,
.command-metric-card span,
.analysis-head span {
  color: #8b612d;
  font-size: .84rem;
  font-weight: 950;
}

.metric strong,
.command-metric-card strong {
  color: #241b18;
  font-size: clamp(1.85rem, 3vw, 3.05rem);
  line-height: 1.05;
}

.command-metric-card {
  background:
    linear-gradient(145deg, rgba(35, 25, 30, .96), rgba(18, 23, 28, .94));
}

.command-metric-card strong {
  color: #fff9ef;
}

.command-metric-card small {
  color: #f2dcc4;
}

.workbench-task,
.workbench-risk,
.workbench-action,
.workbench-module-card,
.module-catalog-card,
.module-addon-card,
.module-flow article,
.analysis-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 247, 234, .9));
}

.workbench-task.is-done {
  border-color: rgba(79, 153, 108, .36);
}

.workbench-task.is-snoozed {
  border-color: rgba(184, 130, 58, .38);
}

.workbench-task.is-needs_ai {
  border-color: rgba(82, 127, 146, .38);
}

.workbench-task-title span,
.workbench-module-card > div > span,
.workbench-suggestion-list span,
.module-catalog-card span,
.module-flow span,
.tag {
  min-height: 30px;
  border: 1px solid rgba(184, 130, 58, .28);
  border-radius: 999px;
  color: #7b4f22;
  background: rgba(184, 130, 58, .1);
  font-size: .82rem;
  font-weight: 950;
}

.primary,
.ghost,
.link-button {
  min-height: 46px;
  border-radius: 14px;
  font-size: .96rem;
  font-weight: 950;
}

.primary {
  color: #28140c;
  background: linear-gradient(135deg, #f7d986, #d8a861);
  box-shadow: 0 12px 28px rgba(184, 130, 58, .2);
}

.content .ghost,
.panel .ghost,
.login-card .ghost,
.table-wrap .ghost,
.workbench-task .ghost,
.workbench-risk .ghost {
  color: #5a1930;
  border-color: rgba(127, 24, 53, .2);
  background: #f7ead1;
}

.table-wrap {
  border: 1px solid rgba(184, 130, 58, .2);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  color: #7b4f22;
  font-size: .82rem;
  font-weight: 950;
  letter-spacing: 0;
}

td {
  color: #241b18;
  line-height: 1.5;
}

.progress-meter {
  border-color: rgba(184, 130, 58, .18);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
}

.progress-meter-head strong {
  color: #241b18;
}

.progress-meter-bar {
  height: 12px;
  background: rgba(93, 39, 50, .1);
}

.progress-meter-bar i {
  background: linear-gradient(90deg, #527f92, #d8a861);
}

.progress-meter.tone-good .progress-meter-bar i {
  background: linear-gradient(90deg, #4f996c, #b8dfbe);
}

.progress-meter.tone-warn .progress-meter-bar i {
  background: linear-gradient(90deg, #b8823a, #e1b676);
}

.progress-meter.tone-risk .progress-meter-bar i {
  background: linear-gradient(90deg, #be4d49, #e1b676);
}

.console-copilot {
  z-index: 60;
}

.console-copilot-body,
.console-copilot-answer,
.console-copilot-section {
  border-color: rgba(93, 39, 50, .16);
  box-shadow: 0 16px 44px rgba(65, 38, 24, .12);
}

.console-copilot-answer p {
  color: #241713;
  font-weight: 650;
}

.console-copilot-answer .ghost {
  min-height: 42px;
}

.analysis-bar-row > div,
.rank-row > div,
.mini-bars {
  background: rgba(93, 39, 50, .1);
}

@media (max-width: 860px) {
  .content {
    padding: 14px;
  }

  .panel,
  .workbench-hero,
  .command-metric-card,
  .analysis-card {
    border-radius: 18px;
  }

  .primary,
  .ghost,
  .link-button,
  .console-copilot-answer .ghost {
    min-height: 52px;
  }

  .table-wrap {
    border-radius: 16px;
  }
}
