:root {
  --ink: #1c211c;
  --muted: #6f746c;
  --faint: #979b94;
  --line: #e4e3dd;
  --paper: #ffffff;
  --canvas: #f5f5f1;
  --green: #365f42;
  --green-dark: #24462f;
  --green-soft: #e7eee8;
  --lime: #dbe7a1;
  --amber: #b66a2c;
  --amber-soft: #fbecdc;
  --red: #a94b43;
  --red-soft: #f8e4e1;
  --blue: #486985;
  --blue-soft: #e5edf3;
  --shadow: 0 8px 28px rgba(31, 43, 33, 0.07);
  --radius: 16px;
}

* { box-sizing: border-box; }

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

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { display: grid; grid-template-columns: 222px 1fr; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 222px;
  display: flex;
  flex-direction: column;
  padding: 27px 18px 18px;
  background: #fbfbf8;
  border-right: 1px solid var(--line);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 28px; font-size: 19px; font-weight: 750; letter-spacing: -0.4px; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; background: var(--green); color: white; border-radius: 9px 9px 9px 3px; }
.brand-mark svg { width: 17px; }

.nav-label { padding: 0 10px; margin: 3px 0 8px; color: #9a9d96; font-size: 10px; font-weight: 700; letter-spacing: 1.25px; text-transform: uppercase; }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: #72766f; display: flex; align-items: center; gap: 12px;
  padding: 10px 11px; border-radius: 9px; font-size: 13px; font-weight: 550; text-align: left;
}
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.8; }
.nav-item:hover { background: #f0f1eb; color: var(--ink); }
.nav-item.active { background: #e8ede7; color: var(--green-dark); font-weight: 700; }
.nav-count { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 10px; background: var(--green); color: white; text-align: center; font-size: 10px; }
.sidebar-spacer { flex: 1; }
.demo-badge { margin: 0 6px 17px; padding: 12px; border: 1px solid #dfe6d5; border-radius: 12px; background: #f2f5e9; }
.demo-badge strong { display: block; margin-bottom: 4px; font-size: 11px; color: var(--green); }
.demo-badge span { color: #73796d; font-size: 10px; line-height: 1.45; }
.user-chip { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 8px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.avatar { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: #d7c3aa; color: #49392b; font-size: 11px; font-weight: 750; }
.user-meta { min-width: 0; }
.user-meta strong { display: block; font-size: 11px; }
.user-meta span { display: block; max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; color: var(--faint); }
.signout-label { margin-left: auto; color: var(--faint); font-size: 8px; opacity: 0; transition: opacity .15s; }
.user-chip:hover .signout-label { opacity: 1; }

.main { grid-column: 2; min-width: 0; }
.topbar { height: 67px; padding: 0 34px; display: flex; align-items: center; gap: 18px; background: rgba(255,255,255,.8); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 7; }
.topbar-title { font-size: 14px; font-weight: 700; }
.topbar-title span { color: #a2a49f; font-weight: 500; margin-left: 8px; }
.search { max-width: 350px; min-width: 220px; height: 37px; margin-left: auto; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafaf7; color: #979a94; }
.search svg { width: 15px; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.top-icon { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 10px; background: white; display: grid; place-items: center; color: #6e736c; position: relative; }
.top-icon svg { width: 16px; }
.notification-dot { position: absolute; width: 6px; height: 6px; background: #c95f4d; border: 1px solid white; border-radius: 50%; top: 7px; right: 7px; }

.content { padding: 29px 34px 48px; max-width: 1560px; margin: 0 auto; }
.welcome { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.eyebrow { margin-bottom: 7px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 30px; font-weight: 500; letter-spacing: -1px; }
.welcome p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.sync { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #6ea06f; box-shadow: 0 0 0 3px #dce9dc; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 19px; }
.stat-card { min-height: 106px; padding: 17px 18px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; }
.stat-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; font-weight: 650; }
.stat-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: #f1f2ed; color: var(--green); }
.stat-icon svg { width: 14px; }
.stat-value { margin-top: 3px; font-family: Georgia, 'Times New Roman', serif; font-size: 27px; }
.stat-foot { color: var(--faint); font-size: 9px; }
.stat-foot.good { color: var(--green); }
.stat-foot.alert { color: var(--red); }

.workspace { display: grid; grid-template-columns: minmax(370px, .85fr) minmax(520px, 1.55fr); gap: 15px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 5px rgba(31,43,33,.02); }
.panel-head { min-height: 60px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-title { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; }
.panel-sub { margin-top: 3px; color: var(--faint); font-size: 9px; }
.segmented { display: flex; padding: 3px; background: #f2f2ee; border-radius: 8px; }
.segment { border: 0; background: transparent; color: #858982; border-radius: 6px; padding: 5px 9px; font-size: 9px; font-weight: 650; }
.segment.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.request-list { max-height: 582px; overflow: auto; }
.request-card { position: relative; padding: 16px 17px; border-bottom: 1px solid #ecece7; cursor: pointer; transition: background .15s; }
.request-card:last-child { border-bottom: 0; }
.request-card:hover { background: #fafbf7; }
.request-card.selected { background: #f0f4ed; }
.request-card.selected::before { content: ''; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.request-top { display: flex; align-items: center; gap: 8px; }
.source-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: white; font-size: 10px; font-weight: 800; }
.source-icon.email { background: #61746d; }
.source-icon.instagram { background: linear-gradient(135deg,#7853a8,#d96f63); }
.source-icon.linkedin { background: #39749b; }
.request-contact { font-size: 10px; font-weight: 750; }
.request-time { margin-left: auto; color: var(--faint); font-size: 9px; }
.request-title { margin: 10px 0 6px; font-size: 12px; font-weight: 730; letter-spacing: -.1px; }
.request-preview { color: var(--muted); font-size: 10px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-meta { margin-top: 10px; display: flex; align-items: center; gap: 7px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 6px; font-size: 8px; font-weight: 750; letter-spacing: .15px; }
.pill.urgent { background: var(--red-soft); color: var(--red); }
.pill.soon { background: var(--amber-soft); color: var(--amber); }
.pill.flexible { background: var(--green-soft); color: var(--green); }
.pill.new { background: var(--blue-soft); color: var(--blue); }
.pill.sourcing { background: #eee8f6; color: #755b91; }
.pill.ready { background: var(--green-soft); color: var(--green); }
.items-count { margin-left: auto; color: var(--faint); font-size: 9px; }

.detail { min-height: 642px; }
.detail-head { padding: 18px 21px 14px; border-bottom: 1px solid var(--line); }
.detail-line { display: flex; align-items: flex-start; gap: 12px; }
.contact-avatar { width: 37px; height: 37px; flex: 0 0 37px; border-radius: 10px; display: grid; place-items: center; background: #dce5d8; color: var(--green-dark); font-size: 11px; font-weight: 800; }
.detail-title { margin: 0 0 4px; font-family: Georgia, 'Times New Roman', serif; font-size: 19px; font-weight: 500; }
.detail-contact { color: var(--muted); font-size: 9px; }
.detail-actions { margin-left: auto; display: flex; gap: 7px; }
.btn { border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); padding: 8px 11px; font-size: 9px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.btn svg { width: 13px; height: 13px; }
.btn:hover { background: #f6f7f2; }
.btn.primary { border-color: var(--green); background: var(--green); color: white; }
.btn.primary:hover { background: var(--green-dark); }
.btn.ghost { border: 0; background: transparent; color: var(--green); }
.request-brief { margin: 14px 0 0 49px; padding: 11px 13px; border-radius: 9px; background: #f7f7f3; color: #5e645c; font-size: 10px; line-height: 1.55; }
.brief-tags { margin-top: 10px; display: flex; gap: 7px; flex-wrap: wrap; }
.brief-tag { color: #70756d; border: 1px solid #dedfd9; background: white; padding: 4px 7px; border-radius: 6px; font-size: 8px; }

.detail-tabs { height: 42px; padding: 0 21px; display: flex; align-items: flex-end; gap: 24px; border-bottom: 1px solid var(--line); }
.detail-tab { height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--faint); font-size: 9px; font-weight: 700; }
.detail-tab.active { color: var(--green); border-color: var(--green); }
.options-area { padding: 16px 21px 21px; }
.options-intro { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.options-intro span { color: var(--muted); font-size: 9px; }
.recommendation { color: var(--green); font-size: 8px; font-weight: 750; }
.option-list { display: grid; gap: 9px; }
.option-card { display: grid; grid-template-columns: minmax(180px,1.55fr) .65fr .72fr .78fr 28px; align-items: center; gap: 10px; padding: 13px 13px; border: 1px solid var(--line); border-radius: 11px; transition: border-color .15s, box-shadow .15s; }
.option-card:hover { border-color: #bac8b9; box-shadow: 0 4px 15px rgba(43,64,46,.05); }
.option-card.recommended { border-color: #a9c0a7; background: linear-gradient(90deg,#f5f8f2 0%,white 55%); }
.product { display: flex; align-items: center; gap: 10px; min-width: 0; }
.product-thumb { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 8px; background: #e8e6dc; overflow: hidden; }
.product-thumb svg { width: 34px; height: 34px; }
.product-name { font-size: 10px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vendor { margin-top: 3px; color: var(--faint); font-size: 8px; }
.match { margin-top: 4px; color: var(--green); font-size: 7px; font-weight: 750; }
.metric label { display: block; color: var(--faint); font-size: 7px; text-transform: uppercase; letter-spacing: .6px; }
.metric strong { display: block; margin-top: 4px; font-family: Georgia, 'Times New Roman', serif; font-size: 13px; font-weight: 500; }
.metric small { color: var(--faint); font-size: 7px; }
.timeline.good strong { color: var(--green); }
.timeline.risk strong { color: var(--red); }
.option-check { width: 19px; height: 19px; appearance: none; border: 1px solid #cdd1ca; border-radius: 5px; background: white; position: relative; }
.option-check:checked { background: var(--green); border-color: var(--green); }
.option-check:checked::after { content: '✓'; position: absolute; inset: 0; color: white; display: grid; place-items: center; font-size: 12px; }
.risk-note { grid-column: 1 / -1; margin: -2px 0 0 52px; padding-top: 8px; border-top: 1px solid #f0e7df; color: var(--red); font-size: 8px; }
.proposal-bar { margin-top: 14px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; background: #f4f6f0; border-radius: 10px; }
.proposal-bar span { color: var(--muted); font-size: 9px; }
.proposal-bar strong { color: var(--ink); }
.proposal-bar .btn { margin-left: auto; }

.empty { padding: 60px 30px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); font-family: Georgia,serif; font-weight: 500; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; background: #203a29; color: white; box-shadow: var(--shadow); font-size: 10px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-mark { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: #d8e69f; color: #253e2a; }

.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(20,26,21,.42); backdrop-filter: blur(3px); }
.modal { width: min(590px, 100%); max-height: 90vh; overflow: auto; background: white; border-radius: 16px; box-shadow: 0 24px 70px rgba(20,30,22,.25); }
.modal-head { padding: 19px 21px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: Georgia,serif; font-size: 20px; font-weight: 500; }
.modal-close { margin-left: auto; border: 0; background: transparent; font-size: 20px; color: var(--muted); }
.modal-body { padding: 20px 21px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; outline: 0; color: var(--ink); font-size: 11px; }
.field input:focus, .field textarea:focus { border-color: #94ab95; box-shadow: 0 0 0 3px #edf2e9; }
.field textarea { height: 165px; resize: vertical; line-height: 1.5; }
.modal-note { margin-bottom: 13px; padding: 10px; border-radius: 8px; background: var(--amber-soft); color: #855027; font-size: 9px; line-height: 1.45; }
.modal-actions { padding: 14px 21px; display: flex; justify-content: flex-end; gap: 8px; background: #fafaf7; border-top: 1px solid var(--line); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 15%, #eef2e7 0, var(--canvas) 42%, #efeee8 100%); }
.login-card { width: min(410px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 20px 65px rgba(35,48,37,.11); text-align: center; }
.login-mark { width: 42px; height: 42px; margin: 0 auto 22px; border-radius: 12px 12px 12px 4px; }
.login-mark svg { width: 23px; }
.login-card h1 { font-size: 32px; }
.login-card p { margin: 12px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-card small { display: block; margin-top: 16px; color: var(--faint); font-size: 9px; }
.login-button { width: 100%; padding: 12px 16px; font-size: 11px; }
.login-error { margin: -8px 0 16px; padding: 10px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 10px; line-height: 1.45; text-align: left; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .request-list { max-height: 410px; }
  .stats { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 15px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .nav-label,.demo-badge,.user-chip,.sidebar-spacer { display: none; }
  .nav-list { display: flex; margin-left: auto; }
  .nav-item { width: auto; font-size: 0; padding: 9px; }
  .nav-count { position: absolute; }
  .topbar { padding: 0 17px; }
  .topbar-title span,.search { display: none; }
  .main { display: block; }
  .content { padding: 22px 15px 36px; }
  .welcome { align-items: flex-start; }
  .sync { display: none; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .option-card { grid-template-columns: 1fr 1fr 25px; }
  .product { grid-column: 1 / -1; }
  .metric:nth-of-type(3) { display: none; }
  .risk-note { margin-left: 0; }
  .detail-actions .btn:first-child { display: none; }
}
