:root {
  --ink: #171714;
  --muted: #6f6d65;
  --quiet: #a3a096;
  --line: #e6e3da;
  --paper: #f5f5f3;
  --white: #ffffff;
  --orange: #e85d24;
  --orange-dark: #bd4313;
  --orange-soft: #fff0e8;
  --green: #287451;
  --green-soft: #e8f5ee;
  --red: #a23a32;
  --red-soft: #fbecea;
  --blue: #376d8c;
  --blue-soft: #eaf3f8;
  --purple: #6d578b;
  --purple-soft: #f0ecf6;
  --shadow: 0 8px 24px rgba(20, 20, 18, .08);
  --radius: 10px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font-family: var(--font); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 212px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px 18px; background: #171715; color: white; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 7px; display: grid; place-items: center; background: var(--orange); color: white; font-size: 13px; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { margin-top: 2px; color: rgba(255,255,255,.55); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; }
.nav { margin-top: 36px; display: grid; gap: 4px; }
.nav-button { width: 100%; border: 0; border-radius: 9px; padding: 11px 12px; background: transparent; color: rgba(255,255,255,.58); display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left; font-weight: 600; font-size: 14px; }
.nav-button:hover { color: white; background: rgba(255,255,255,.06); }
.nav-button.active { color: white; background: rgba(255,255,255,.11); }
.nav-icon { width: 20px; text-align: center; font-size: 15px; }
.sidebar-footer { margin-top: auto; padding: 15px 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.user strong, .user small { display: block; }
.user strong { font-size: 13px; }.user small { color: rgba(255,255,255,.45); font-size: 11px; margin-top: 2px; }
.text-button { border: 0; background: none; color: rgba(255,255,255,.48); padding: 10px 0 0; font-size: 11px; cursor: pointer; }
.text-button:hover { color: white; }
.main { min-width: 0; }
.topbar { min-height: 84px; padding: 20px 32px 17px; display: flex; align-items: flex-end; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(245,245,243,.96); position: sticky; top: 0; z-index: 20; }
.topbar > div:first-child { flex: 1; }
.eyebrow { margin: 0 0 5px; color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
h2 { margin-bottom: 6px; font-size: 19px; letter-spacing: -.02em; }
h3 { font-size: 14px; margin-bottom: 4px; }
.content { padding: 24px 32px 70px; max-width: 1600px; margin: 0 auto; }
.button { border: 1px solid var(--line); border-radius: 7px; padding: 9px 13px; background: var(--white); color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; }
.button:hover { border-color: #c5c1b7; }
.button.primary { color: white; background: var(--orange); border-color: var(--orange); }
.button.primary:hover { background: var(--orange-dark); }
.button.ghost { background: transparent; }
.button.danger { color: var(--red); border-color: #e8c6c2; }
.button.wide { width: 100%; padding: 12px; }
.button:disabled { opacity: .55; cursor: wait; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.hero h2 { font-weight: 750; font-size: 22px; }
.hero p { color: var(--muted); margin: 0; font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 22px; }
.metric { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.metric strong { display: block; font-size: 28px; font-weight: 750; line-height: 1; }
.metric span { display: block; color: var(--muted); font-size: 11px; margin-top: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.split { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(300px,.8fr); gap: 18px; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-header { min-height: 62px; padding: 17px 19px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.panel-header > div:first-child { flex: 1; }
.panel-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.list { display: grid; }
.list-row { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 13px; cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fbfaf7; }
.list-row .body { flex: 1; min-width: 0; }
.list-row .body strong { display: block; font-size: 14px; }
.list-row .body small { display: block; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-chip { min-width: 48px; text-align: center; border-radius: 8px; padding: 7px 6px; background: var(--paper); color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.date-chip.overdue { color: var(--red); background: var(--red-soft); }
.stage-pill, .outcome-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.stage-target { color: #6e685e; background: #efede7; }
.stage-qualified { color: var(--blue); background: var(--blue-soft); }
.stage-interest { color: var(--purple); background: var(--purple-soft); }
.stage-closed { color: var(--green); background: var(--green-soft); }
.empty { padding: 42px 24px; text-align: center; color: var(--muted); }
.empty strong { color: var(--ink); display: block; margin-bottom: 5px; }
.pipeline-tools { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pipeline-tools .search { max-width: 420px; }
.pipeline-tools span { color: var(--muted); font-size: 12px; }
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(245px,1fr)); gap: 10px; overflow-x: auto; padding-bottom: 16px; align-items: start; }
.pipeline-column { min-height: 480px; max-height: calc(100vh - 190px); overflow-y: auto; border: 1px solid #e5e3dd; border-radius: var(--radius); background: #ecebe7; padding: 10px; transition: background .12s, border-color .12s; }
.pipeline-column.drag-over { background: #fff0e8; border-color: var(--orange); }
.pipeline-header { padding: 5px 3px 13px; display: flex; align-items: center; gap: 8px; }
.pipeline-header strong { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.pipeline-header span { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 700; }
.deal-card { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 12px 30px 12px 12px; margin-bottom: 7px; cursor: grab; box-shadow: 0 1px 1px rgba(0,0,0,.025); }
.deal-card:hover { border-color: #bdb9af; }
.deal-card:active { cursor: grabbing; }
.deal-card.is-dragging { opacity: .35; }
.drag-handle { position: absolute; right: 10px; top: 11px; color: #aaa69d; font-size: 13px; letter-spacing: -4px; }
.deal-card h3 { font-size: 14px; }
.deal-card p { color: var(--muted); font-size: 11px; margin: 6px 0 0; }
.deal-next { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink); font-size: 11px; }
.deal-next.overdue { color: var(--red); }
.closed-label { color: var(--green) !important; font-weight: 700; text-transform: capitalize; }
.load-more { width: 100%; border: 1px dashed #c9c5bc; border-radius: 7px; padding: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.load-more:hover { border-color: var(--orange); color: var(--orange-dark); }
.load-more small { display: block; margin-top: 2px; font-weight: 500; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; }
.search { flex: 1; min-width: 180px; }
input, select, textarea { width: 100%; border: 1px solid #d7d3ca; border-radius: 8px; padding: 10px 11px; background: var(--white); color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
textarea { min-height: 88px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 14px; color: var(--muted); background: #fbfaf7; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 13px 14px; border-top: 1px solid var(--line); }
tbody tr { cursor: pointer; } tbody tr:hover { background: #fbfaf7; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(18,18,16,.38); display: flex; justify-content: flex-end; }
.drawer { width: min(590px,100%); height: 100%; overflow-y: auto; background: var(--paper); box-shadow: var(--shadow); }
.drawer-head { position: sticky; top: 0; z-index: 3; padding: 22px 24px; background: rgba(247,246,241,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.drawer-head > div { flex: 1; }.drawer-head h2 { margin: 0; font-size: 23px; font-weight: 750; }
.drawer-head p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.icon-button { width: 35px; height: 35px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); cursor: pointer; }
.drawer-body { padding: 18px; display: grid; gap: 14px; }
.section-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.section-title { display: flex; align-items: center; margin-bottom: 15px; }
.section-title h3 { flex: 1; margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.full { grid-column: 1/-1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.conditional { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.person, .activity { padding: 12px 0; border-top: 1px solid var(--line); }
.person:first-of-type, .activity:first-of-type { border-top: 0; }
.person-head, .activity-head { display: flex; align-items: center; gap: 8px; }
.person-head strong, .activity-head strong { flex: 1; font-size: 13px; }
.person p, .activity p { color: var(--muted); font-size: 12px; margin: 5px 0 0; white-space: pre-wrap; }
.mini-pill { padding: 3px 6px; border-radius: 5px; background: var(--orange-soft); color: var(--orange-dark); font-size: 9px; font-weight: 800; }
.activity time { color: var(--quiet); font-size: 10px; }
.segmented { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }
.segmented button { padding: 9px 5px; border: 1px solid var(--line); background: var(--white); font-size: 10px; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.segmented button:first-child { border-radius: 8px 0 0 8px; }.segmented button:last-child { border-radius: 0 8px 8px 0; }
.segmented button.active { background: var(--ink); color: white; border-color: var(--ink); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(18,18,16,.48); display: grid; place-items: center; padding: 18px; }
.modal { width: min(480px,100%); max-height: 92vh; overflow-y: auto; background: var(--white); border-radius: 16px; padding: 23px; box-shadow: var(--shadow); }
.modal-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }.modal-head > div { flex: 1; }
.modal h2 { font-size: 23px; font-weight: 750; margin: 0; }
.form-stack { display: grid; gap: 13px; }
.form-error { color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 9px 10px; font-size: 12px; margin: 0; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 26px; transform: translate(-50%,20px); background: var(--ink); color: white; padding: 10px 14px; border-radius: 9px; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #ececea; }
.login-shell { width: min(860px,100%); min-height: 500px; display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; background: var(--white); border: 1px solid #dcdad4; border-radius: 12px; box-shadow: var(--shadow); }
.login-purpose { padding: 38px; background: #171715; color: white; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand { color: white; }.login-brand small { color: rgba(255,255,255,.58); }
.login-purpose h1 { max-width: 360px; font-size: 34px; line-height: 1.08; }
.login-purpose p:not(.login-kicker) { max-width: 350px; margin: 14px 0 0; color: rgba(255,255,255,.68); font-size: 15px; line-height: 1.55; }
.login-purpose > small { color: rgba(255,255,255,.42); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.login-kicker { margin: 0 0 10px; color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.login-form-panel { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-copy h2 { margin: 0; font-size: 26px; }.login-copy > p:last-child { color: var(--muted); font-size: 13px; margin: 7px 0 26px; }
.mobile-nav { display: none; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { min-height: 92px; padding: 22px 20px 18px; }
  .topbar h1 { font-size: 34px; }
  .content { padding: 22px 18px 92px; }
  .mobile-nav { position: fixed; z-index: 50; left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(3,1fr); padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
  .mobile-nav .nav-button { color: var(--muted); justify-content: center; padding: 9px; }.mobile-nav .nav-button.active { color: white; background: var(--ink); }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar .button { padding: 9px 10px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .metric-grid { gap: 8px; }.metric { padding: 15px; }
  .pipeline { grid-template-columns: repeat(4, 270px); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }.full { grid-column: auto; }
  .drawer-body { padding: 10px; }.section-card { padding: 15px; }
  .segmented { grid-template-columns: repeat(2,1fr); }.segmented button { border-radius: 8px !important; }
  .hide-mobile { display: none; }
  .pipeline-tools { align-items: stretch; flex-direction: column; }
  .pipeline-tools .search { max-width: none; }
  .login-page { padding: 0; background: var(--white); }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-purpose { min-height: 285px; padding: 28px 24px; }
  .login-purpose h1 { font-size: 29px; }
  .login-form-panel { padding: 34px 24px; }
}
