:root {
  --ink: #18352f;
  --ink-soft: #547069;
  --paper: #f6f7f3;
  --card: #ffffff;
  --line: #dfe6e1;
  --cream: #f1eadc;
  --accent: #d76f45;
  --accent-soft: #fff0e9;
  --success: #2f7a5c;
  --success-soft: #e9f5ee;
  --warning: #9b6a19;
  --warning-soft: #fff6dd;
  --sidebar: #15322c;
  --shadow: 0 20px 60px rgba(21, 50, 44, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.prototype-banner { height: 30px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #0d2520; color: #dbeae4; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.prototype-banner span { width: 6px; height: 6px; background: #75d0a8; border-radius: 50%; box-shadow: 0 0 0 4px rgba(117, 208, 168, .12); }
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 30px); }

.sidebar { position: sticky; top: 0; height: calc(100vh - 30px); padding: 28px 18px 18px; display: flex; flex-direction: column; background: var(--sidebar); color: #e8f0ed; }
.product-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: white; text-decoration: none; font-size: 16px; }
.product-brand b { font-family: "Newsreader", serif; font-size: 21px; }
.brand-mark { position: relative; width: 29px; height: 29px; border: 1px solid rgba(255,255,255,.5); border-radius: 50% 50% 46% 54%; transform: rotate(-10deg); }
.brand-mark:before, .brand-mark:after, .brand-mark i { content: ""; position: absolute; left: 50%; top: 50%; width: 1px; height: 19px; background: #e1b899; transform-origin: center; }
.brand-mark:before { transform: translate(-50%, -50%) rotate(45deg); }
.brand-mark:after { transform: translate(-50%, -50%) rotate(-45deg); }
.brand-mark i { transform: translate(-50%, -50%) rotate(90deg); }

.workspace-picker { position: relative; margin: 30px 0 22px; }
.workspace-picker > label { display: block; margin: 0 8px 8px; color: #87a49c; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.workspace-button, .workspace-menu button { width: 100%; border: 0; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.workspace-button { padding: 10px; color: white; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 11px; }
.workspace-button > span:nth-child(2), .workspace-menu button > span:nth-child(2) { min-width: 0; display: grid; }
.workspace-button b, .workspace-menu b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.workspace-button small, .workspace-menu small { margin-top: 2px; color: #9cb2ac; font-size: 10px; }
.workspace-avatar { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: #713317; background: #e8a17d; font-size: 10px; font-weight: 700; }
.workspace-avatar.coastal { color: #264254; background: #b5d9e8; }
.chevron { margin-left: auto; color: #aac0ba; }
.workspace-menu { position: absolute; z-index: 20; width: 100%; top: calc(100% + 6px); padding: 6px; border: 1px solid #37524b; border-radius: 12px; background: #1b3c34; box-shadow: 0 18px 40px rgba(0,0,0,.3); }
.workspace-menu button { padding: 8px; color: white; background: transparent; border-radius: 8px; }
.workspace-menu button:hover, .workspace-menu button:focus { background: rgba(255,255,255,.08); outline: none; }

.sidebar-nav { display: grid; gap: 4px; }
.sidebar-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #adc1bb; text-decoration: none; font-size: 12px; font-weight: 500; }
.sidebar-nav a span { width: 18px; color: #87a49c; font-size: 15px; text-align: center; }
.sidebar-nav a b { margin-left: auto; padding: 2px 7px; border-radius: 20px; background: rgba(255,255,255,.1); color: #dfeae6; font-size: 10px; }
.sidebar-nav a.active { color: white; background: rgba(255,255,255,.09); }
.sidebar-nav a.active span { color: #e8a17d; }
.sidebar-scope { margin: auto 8px 18px; padding: 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: rgba(0,0,0,.07); }
.sidebar-scope p { margin: 0 0 11px; color: #77958d; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.sidebar-scope ul { margin: 0; padding: 0; display: grid; gap: 7px; list-style: none; font-size: 10px; color: #bed0ca; }
.sidebar-scope li span { display: inline-block; width: 16px; color: #75d0a8; }
.sidebar-scope li.muted { color: #77958d; }
.sidebar-scope li.muted span { color: #77958d; }
.operator-card { display: flex; align-items: center; gap: 9px; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.operator-card > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: #e7e0d4; color: #3b554e; font-size: 10px; font-weight: 700; }
.operator-card div { min-width: 0; display: grid; }
.operator-card b { font-size: 10px; }
.operator-card small { color: #829c95; font-size: 9px; }
.operator-card button { margin-left: auto; border: 0; background: transparent; color: #86a098; cursor: pointer; }

main { min-width: 0; }
.topbar { min-height: 88px; padding: 20px clamp(24px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.72); backdrop-filter: blur(14px); }
.topbar p, .eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.topbar h1 { margin: 0; font-family: "Newsreader", serif; font-size: clamp(24px, 3vw, 32px); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { position: relative; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; }
.icon-button i { position: absolute; right: 8px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.primary-button, .secondary-button { min-height: 39px; padding: 0 16px; border-radius: 9px; font-size: 11px; font-weight: 700; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; box-shadow: 0 8px 20px rgba(24,53,47,.12); }
.secondary-button { border: 1px solid var(--line); background: white; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.primary-button:disabled { opacity: .65; cursor: default; transform: none; }

.overview { padding: 36px clamp(24px, 4vw, 54px) 28px; display: grid; grid-template-columns: minmax(240px, .8fr) minmax(520px, 1.6fr); gap: 42px; align-items: end; }
.overview-copy h2 { max-width: 430px; margin: 0 0 9px; font-family: "Newsreader", serif; font-size: clamp(30px, 4vw, 44px); line-height: 1; }
.overview-copy > p:last-child { max-width: 500px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.74); }
.metric-grid span { display: block; color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
.metric-grid b { display: block; margin: 7px 0 4px; font-family: "Newsreader", serif; font-size: 29px; }
.metric-grid small { color: #8a9d97; font-size: 9px; }
.metric-grid small i { font-style: normal; color: var(--success); }

.desk { margin: 0 clamp(24px, 4vw, 54px); padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.desk-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.desk-heading h2 { margin: 0 0 4px; font-family: "Newsreader", serif; font-size: 24px; }
.desk-heading p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.filters { display: flex; padding: 3px; border-radius: 9px; background: var(--paper); }
.filters button { padding: 7px 10px; border: 0; border-radius: 7px; color: var(--ink-soft); background: transparent; font-size: 9px; font-weight: 600; cursor: pointer; }
.filters button.active { color: var(--ink); background: white; box-shadow: 0 3px 10px rgba(24,53,47,.08); }
.desk-grid { min-height: 570px; display: grid; grid-template-columns: minmax(245px, .68fr) minmax(420px, 1.32fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lead-list { padding: 8px; border-right: 1px solid var(--line); background: #f8f9f6; }
.lead-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 13px 11px; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; }
.lead-card + .lead-card { margin-top: 3px; }
.lead-card:hover { background: white; }
.lead-card.active { border-color: #d8dfda; background: white; box-shadow: 0 8px 25px rgba(24,53,47,.07); }
.lead-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: #944727; font-size: 10px; font-weight: 700; }
.lead-card-main { min-width: 0; }
.lead-card-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.lead-card-main p { margin: 3px 0 7px; color: var(--ink-soft); font-size: 9px; }
.lead-card-main small { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 20px; background: var(--success-soft); color: var(--success); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.lead-card-main small.waiting { background: var(--warning-soft); color: var(--warning); }
.lead-card > small { color: #91a29d; font-size: 8px; white-space: nowrap; }
.empty-list { padding: 50px 20px; text-align: center; color: var(--ink-soft); font-size: 11px; }

.lead-detail { position: relative; min-width: 0; padding: 22px 24px; background: white; }
.detail-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.detail-head .lead-avatar { width: 43px; height: 43px; border-radius: 12px; font-size: 11px; }
.detail-title-line { display: flex; align-items: center; gap: 8px; }
.detail-head h3 { margin: 0; font-family: "Newsreader", serif; font-size: 20px; }
.detail-head p { margin: 3px 0 0; color: var(--ink-soft); font-size: 9px; }
.language-badge { padding: 2px 6px; border-radius: 5px; background: #eef1f8; color: #536383; font-size: 8px; font-weight: 700; }
.more-button { align-self: start; border: 0; background: transparent; color: #8da09a; cursor: pointer; }
.fit-banner { margin: 17px 0; padding: 12px 14px; display: flex; gap: 10px; border: 1px solid #d7e9de; border-radius: 11px; background: #f1f8f4; }
.fit-banner > span { color: var(--success); }
.fit-banner b { font-size: 10px; }
.fit-banner strong { color: var(--success); }
.fit-banner p { margin: 3px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.45; }
.detail-section { padding: 14px 0; border-top: 1px solid var(--line); }
.section-label { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.section-label > span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: var(--cream); color: #7b6646; font-size: 8px; font-weight: 700; }
.section-label > b { font-size: 10px; }
.section-label button { margin-left: auto; border: 0; background: transparent; color: var(--accent); font-size: 9px; font-weight: 700; cursor: pointer; }
.facts { margin: 0 0 0 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px 20px; }
.facts div { display: grid; gap: 3px; }
.facts dt { color: var(--ink-soft); font-size: 8px; }
.facts dd { margin: 0; font-size: 10px; font-weight: 600; }
.plan-pill { display: inline-flex; padding: 3px 7px; border-radius: 20px; color: #8f4325; background: var(--accent-soft); font-size: 8px; text-transform: uppercase; }
.readiness-row { margin-left: 28px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.readiness-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; color: var(--success); background: var(--success-soft); }
.readiness-row b { font-size: 10px; }
.readiness-row p { margin: 3px 0 0; color: var(--ink-soft); font-size: 8px; line-height: 1.4; }
.complete-chip { padding: 3px 7px; border-radius: 20px; color: var(--success); background: var(--success-soft); font-size: 8px; font-weight: 700; }
.complete-chip.waiting { color: var(--warning); background: var(--warning-soft); }
.message-preview { margin: 0 0 2px 28px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; }
.message-meta { display: flex; justify-content: space-between; color: #8a9b96; font-size: 7px; letter-spacing: .05em; }
.message-preview p { margin: 8px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.55; }
.handoff-card { margin: 5px 0 15px; padding: 11px 13px; display: flex; gap: 11px; border-radius: 10px; background: #f1f3f8; }
.handoff-card > span { color: #65769a; }
.handoff-card small { display: block; margin-bottom: 2px; color: #8791a7; font-size: 7px; font-weight: 700; letter-spacing: .08em; }
.handoff-card b { font-size: 9px; }
.handoff-card p { margin: 2px 0 0; color: #6d788f; font-size: 8px; }
.detail-actions { display: flex; justify-content: flex-end; gap: 8px; }
.detail-actions .primary-button { min-width: 190px; }
.empty-detail { min-height: 510px; display: grid; place-content: center; text-align: center; }
.empty-detail span { width: 45px; height: 45px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.empty-detail h3 { margin: 0; font-family: "Newsreader", serif; }
.empty-detail p { color: var(--ink-soft); font-size: 10px; }

.automation-strip { margin: 22px clamp(24px, 4vw, 54px) 50px; padding: 24px; display: grid; grid-template-columns: .65fr 1.35fr; gap: 34px; align-items: center; border-radius: 16px; color: white; background: var(--sidebar); }
.automation-strip h2 { margin: 0; font-family: "Newsreader", serif; font-size: 25px; }
.automation-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.automation-list article { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; padding: 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(255,255,255,.05); }
.automation-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.08); color: #e7ab8b; }
.automation-list b { display: block; font-size: 9px; }
.automation-list small { display: block; margin-top: 2px; color: #9eb2ac; font-size: 7px; line-height: 1.35; }
.automation-list i { padding: 2px 5px; border-radius: 10px; background: rgba(117,208,168,.12); color: #75d0a8; font-size: 7px; font-style: normal; font-weight: 700; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 360px; padding: 12px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid #cfe4d8; border-radius: 11px; background: white; box-shadow: 0 18px 50px rgba(21,50,44,.18); }
.toast span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--success); background: var(--success-soft); }
.toast p { margin: 0; font-size: 10px; }

@media (max-width: 1080px) {
  .overview { grid-template-columns: 1fr; }
  .metric-grid { max-width: 760px; }
  .automation-strip { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar { padding: 24px 10px 14px; }
  .product-brand > span:last-child, .workspace-picker > label, .workspace-button > span:nth-child(2), .workspace-button .chevron, .sidebar-nav a:not(.active), .sidebar-nav a.active:not(:first-child), .sidebar-nav a.active b, .sidebar-scope, .operator-card div, .operator-card button { display: none; }
  .product-brand { justify-content: center; padding: 0; }
  .workspace-button { justify-content: center; padding: 8px; }
  .workspace-menu { width: 210px; }
  .sidebar-nav a.active { justify-content: center; padding: 10px; }
  .sidebar-nav a.active span { width: auto; }
  .operator-card { justify-content: center; padding: 12px 0 0; }
  .desk-grid { grid-template-columns: 220px minmax(360px,1fr); overflow-x: auto; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .automation-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .prototype-banner { padding: 0 10px; font-size: 8px; }
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 16px; flex-direction: row; align-items: center; gap: 12px; }
  .product-brand { justify-content: flex-start; }
  .product-brand > span:last-child { display: inline; }
  .workspace-picker { margin: 0 0 0 auto; }
  .workspace-button { width: auto; }
  .sidebar-nav, .sidebar-scope, .operator-card { display: none; }
  .topbar { min-height: 70px; padding: 14px 16px; }
  .topbar h1 { font-size: 22px; }
  .topbar .icon-button { display: none; }
  .topbar .primary-button { padding: 0 11px; font-size: 9px; }
  .overview { padding: 26px 16px 20px; gap: 22px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .metric-grid article { padding: 13px; }
  .desk { margin: 0 12px; padding: 14px; }
  .desk-heading { align-items: flex-start; flex-direction: column; }
  .desk-grid { min-height: 0; display: block; overflow: visible; }
  .lead-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .lead-card:not(.active) { display: none; }
  .lead-detail { padding: 18px 15px; }
  .facts { grid-template-columns: 1fr; }
  .detail-actions { flex-direction: column-reverse; }
  .detail-actions button { width: 100%; }
  .automation-strip { margin: 18px 12px 30px; padding: 20px; }
}
