:root { color-scheme: light; --bg:#f8f7f9; --surface:#fff; --line:#e7e2ea; --text:#261e2b; --muted:#665d6e; --accent:#ffa500; --plum:#673780; font:15px/1.5 system-ui,sans-serif; }
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; background:var(--bg); color:var(--text); }
.shell { width:min(1480px,calc(100% - 36px)); margin-inline:auto; }
.top { border-bottom:1px solid var(--line); background:var(--surface); }
.top-inner,.intro,.dialog-head,.record,.record-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.top-inner { min-height:70px; }
.brand { display:flex; align-items:center; gap:10px; font-family:Georgia,serif; font-size:1.2rem; }
.brand img { display:block; width:36px; height:36px; object-fit:contain; border-radius:8px; }
.brand-divider { color:var(--plum); }
main { padding-block:42px; }
.intro { align-items:center; margin-bottom:24px; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { font-family:Georgia,serif; line-height:1.15; }
h1 { font-size:clamp(1.9rem,4vw,2.65rem); margin:0 0 6px; }
h2 { font-size:1.5rem; }
h3 { font-size:1.17rem; }
p,.meta,small { color:var(--muted); }
.eyebrow { font-size:.82rem; color:var(--plum); font-weight:700; }
.card,dialog,.record { background:var(--surface); border:1px solid var(--line); border-radius:13px; }
.login { padding:28px; max-width:480px; margin:24px auto; }
.login form { margin-top:20px; }
.metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:24px; }
.metric { padding:15px; }
.metric strong { display:block; font:700 1.8rem Georgia,serif; color:var(--plum); }
.views { display:flex; flex-wrap:wrap; gap:6px; border-bottom:1px solid var(--line); }
button { font:inherit; cursor:pointer; min-height:44px; }
.primary,.secondary,.views button { padding:8px 14px; border-radius:8px; border:1px solid transparent; font-weight:650; }
.primary { background:var(--accent); color:#27182e; }
.primary:hover { background:#ffb83e; }
.secondary,.views button { background:transparent; color:var(--text); border-color:var(--line); }
.secondary:hover,.views button:hover,.views button[aria-pressed=true] { background:#f2eaf7; }
.views button { border-radius:8px 8px 0 0; }
.views button[aria-pressed=true] { border-bottom:2px solid var(--accent); }
:focus-visible { outline:2px solid var(--plum); outline-offset:3px; }
button:disabled { opacity:.6; cursor:wait; }
.filters,.editor-form { display:grid; gap:12px; }
.filters { grid-template-columns:1fr minmax(150px,220px); margin-bottom:14px; }
label { display:grid; gap:5px; font-size:.9rem; font-weight:650; }
input,textarea,select { width:100%; min-width:0; min-height:44px; font:inherit; padding:8px 10px; background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:8px; }
textarea { resize:vertical; }
.records,.activity,.opportunities { display:grid; gap:9px; }
.record { padding:14px 16px; overflow-wrap:anywhere; }
.opportunity-card { display:grid; width:100%; gap:4px; text-align:left; color:var(--text); }
.opportunity-card:hover { border-color:#c8a6d7; background:#fbf7fd; }
.opportunity-title { font:700 1.17rem/1.15 Georgia,serif; }
.chip { display:inline-block; padding:3px 9px; border-radius:5px; background:#f2eaf7; color:#5b3072; font-size:.78rem; }
.meta { font-size:.86rem; }
.pipeline { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:12px; align-items:start; }
.column {
  display:grid;
  gap:8px;
  padding:12px;
  background:var(--stage-bg,var(--surface));
  border-color:var(--stage-border,var(--line));
  box-shadow:0 2px 5px #261e2b0d,0 1px 2px #261e2b08;
}
.column[data-stage="Contacted"] { --stage-bg:#eef5ff; --stage-border:#d8e5f6; }
.column[data-stage="Qualified"] { --stage-bg:#edf8f6; --stage-border:#d4e9e4; }
.column[data-stage="Audit Booked"] { --stage-bg:#f5effb; --stage-border:#e6daf1; }
.column[data-stage="Proposal Sent"] { --stage-bg:#fff6e7; --stage-border:#efdfc2; }
.column[data-stage="Won"] { --stage-bg:#eef7e9; --stage-border:#dae9d3; }
.column[data-stage="Lost"] { --stage-bg:#fcf0f2; --stage-border:#efdbdf; }
.column .opportunity-card {
  align-items:stretch;
  box-shadow:0 2px 5px #261e2b12,0 1px 2px #261e2b08;
}
.pipeline .opportunity-card { position:relative; cursor:grab; user-select:none; }
.pipeline .opportunity-title { padding-right:20px; }
.drag-handle { position:absolute; inset:6px 5px auto auto; display:grid; place-items:center; width:28px; height:32px; color:var(--muted); touch-action:none; }
.drag-handle svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round; }
.pipeline.is-dragging,.pipeline.is-dragging .opportunity-card { cursor:grabbing; }
.pipeline .is-drag-source { opacity:.4; }
.pipeline .is-drop-target { outline:2px solid var(--plum); outline-offset:-2px; }
.drag-preview {
  position:fixed;
  inset:0 auto auto 0;
  pointer-events:none;
  z-index:30;
  box-shadow:0 8px 20px #261e2b28;
  will-change:transform;
}
.empty { padding:18px; }
#notice,#login-status,.form-status { margin:10px 0; }
#notice:empty,#login-status:empty,.form-status:empty { display:none; }
dialog { width:min(580px,calc(100% - 24px)); max-height:90dvh; color:var(--text); padding:20px; }
dialog::backdrop { background:#0b0712b0; }
.dialog-head { margin-bottom:16px; }
.detail-section { margin-top:20px; }
.detail-section h3 { margin-bottom:9px; }
.detail-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.activity { list-style:none; padding:0; }
.activity li { border-left:2px solid var(--line); padding-left:10px; overflow-wrap:anywhere; white-space:pre-wrap; }
.workspace { display:grid; grid-template-columns:190px minmax(0,1fr); gap:24px; }
.workspace[data-sidebar="collapsed"] { grid-template-columns:56px minmax(0,1fr); }
.sidebar { border-right:1px solid var(--line); padding-right:16px; }
.sidebar-head { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.sidebar-toggle { display:grid; place-items:center; flex:none; width:44px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--text); }
.sidebar-toggle:hover { background:#f2eaf7; }
.sidebar svg { width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.sidebar-toggle[aria-expanded="true"] svg { transform:scaleX(-1); }
.sidebar .views { display:grid; border:0; }
.sidebar .views button { display:flex; align-items:center; gap:10px; text-align:left; border:0; border-radius:8px; white-space:nowrap; }
.sidebar .views button[aria-pressed=true] { color:var(--plum); }
.workspace[data-sidebar="collapsed"] .sidebar { padding-right:10px; }
.workspace[data-sidebar="collapsed"] .sidebar .eyebrow,
.workspace[data-sidebar="collapsed"] .views span { display:none; }
.workspace[data-sidebar="collapsed"] .views button { justify-content:center; width:44px; padding-inline:0; }
.workspace-body { min-width:0; }
.today-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.today-grid h2 { margin-bottom:12px; }
.filters { grid-template-columns:minmax(0,1fr) minmax(120px,175px) minmax(155px,195px) auto; align-items:end; }
.chip-group { display:flex; flex-wrap:wrap; gap:5px; }
.outreach-chip[data-color="neutral"] { background:#eeebf0; color:#4a4251; }
.outreach-chip[data-color="amber"] { background:#fff0cd; color:#67470a; }
.outreach-chip[data-color="peach"] { background:#ffe5d8; color:#773c1e; }
.outreach-chip[data-color="rose"] { background:#ffe1e4; color:#842e40; }
.outreach-chip[data-color="green"] { background:#e2f3e2; color:#245634; }
.outreach-chip[data-color="blue"] { background:#e3efff; color:#264d7f; }
.outreach-chip[data-color="red"] { background:#9d2435; color:white; }
.outreach-chip[data-color="teal"] { background:#def1f1; color:#26535b; }
.source-options { display:flex; flex-wrap:wrap; gap:6px 14px; min-width:0; margin:0; border:1px solid var(--line); border-radius:8px; }
.source-options label { display:inline-flex; align-items:center; gap:6px; }
.source-options input { width:16px; min-height:16px; margin:4px 0; accent-color:var(--plum); }
.data-actions { display:flex; gap:8px; flex-wrap:wrap; }
.table-wrap { overflow:auto; background:var(--surface); border:1px solid var(--line); border-radius:10px; }
table { width:100%; border-collapse:collapse; text-align:left; }
th,td { padding:10px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
th { font-size:.79rem; font-weight:700; color:var(--muted); background:var(--bg); white-space:nowrap; }
td { font-size:.9rem; overflow-wrap:anywhere; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background:#fbf8fc; }
.contact-link { display:flex; gap:10px; align-items:center; padding:2px; background:transparent; color:var(--text); border:0; text-align:left; }
.contact-link small { display:block; }
.contact-link:hover strong { text-decoration:underline; }
.avatar { display:grid; place-items:center; width:32px; height:32px; flex:none; border-radius:8px; background:#efe5f4; color:var(--plum); font-size:.76rem; font-weight:700; }
.workspace .table-wrap table { min-width:700px; }
.workspace .pipeline { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(210px,1fr); grid-template-columns:none; overflow:auto; padding:3px 4px 12px; }
#editor { position:fixed; inset:0 0 0 auto; margin:0; height:100dvh; max-height:none; border-radius:12px 0 0 12px; box-shadow:-10px 0 40px #1e112a29; }
.import-table { margin-top:8px; max-height:290px; }
@media(max-width:1050px) {
  .filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:800px) {
  .workspace,.workspace[data-sidebar="collapsed"] { grid-template-columns:minmax(0,1fr); gap:16px; }
  .sidebar,.workspace[data-sidebar="collapsed"] .sidebar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; border-right:0; border-bottom:1px solid var(--line); padding:0 0 10px; }
  .sidebar-head { margin-bottom:0; }
  .sidebar .views { display:flex; flex-wrap:wrap; }
  .filters { grid-template-columns:1fr 1fr; }
}
@media(max-width:560px) {
  main { padding-block:24px; }
  .intro { align-items:start; flex-direction:column; }
  .filters { grid-template-columns:1fr; }
  .record { align-items:start; }
  .metric { padding:10px; font-size:.8rem; }
  .today-grid { grid-template-columns:1fr; }
  .sidebar .views button { padding-inline:8px; }
}
