:root {
  --ink: #17211e;
  --muted: #687571;
  --soft-muted: #94a09c;
  --forest: #102a25;
  --forest-2: #173d35;
  --emerald: #16866f;
  --emerald-dark: #0e6c59;
  --mint: #dff4ed;
  --cream: #f5f4ef;
  --warm: #eee9df;
  --card: #fff;
  --line: #e3e7e4;
  --amber: #d69022;
  --amber-soft: #fff2d8;
  --red: #c54a45;
  --red-soft: #fce7e5;
  --blue: #3976b8;
  --blue-soft: #e7f0fb;
  --purple: #7357a8;
  --purple-soft: #eee9f8;
  --shadow-sm: 0 1px 2px rgba(16, 42, 37, .04), 0 6px 18px rgba(16, 42, 37, .04);
  --shadow-lg: 0 24px 60px rgba(12, 36, 31, .18);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--cream); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
svg { display: block; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(410px, .92fr); background: #fff; }
.login-story { position: relative; overflow: hidden; min-height: 100vh; padding: 48px 56px; color: #fff; background: var(--forest); display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.login-story::before { content: ""; position: absolute; inset: 0; z-index: -2; opacity: .23; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent 88%); }
.login-story::after { content: ""; position: absolute; width: 600px; height: 600px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; right: -230px; top: 130px; box-shadow: 0 0 0 75px rgba(255,255,255,.025), 0 0 0 150px rgba(255,255,255,.018); z-index: -1; }
.story-glow { position: absolute; border-radius: 999px; filter: blur(1px); pointer-events: none; z-index: -1; }
.story-glow-one { width: 430px; height: 430px; right: -90px; top: -150px; background: radial-gradient(circle, rgba(31, 173, 139, .26), transparent 68%); }
.story-glow-two { width: 440px; height: 440px; left: -190px; bottom: -210px; background: radial-gradient(circle, rgba(218, 170, 87, .14), transparent 68%); }
.brand-lockup { display: flex; align-items: center; gap: 12px; color: var(--forest); }
.brand-lockup.light { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--emerald); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .04em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.brand-lockup > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand-lockup strong { font-size: 15px; letter-spacing: -.01em; }
.brand-lockup small { margin-top: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .16em; opacity: .68; }
.story-copy { max-width: 650px; margin: 80px 0 auto; }
.story-copy h1 { max-width: 620px; margin: 17px 0 20px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 72px); line-height: .99; letter-spacing: -.048em; font-weight: 500; }
.story-copy p { max-width: 560px; margin: 0; color: rgba(255,255,255,.68); font-size: 17px; line-height: 1.7; }
.eyebrow, .panel-kicker { display: block; color: var(--emerald); font-size: 10px; line-height: 1; font-weight: 800; text-transform: uppercase; letter-spacing: .19em; }
.eyebrow.light { color: #6bd2b6; }
.story-proof { display: flex; align-items: center; gap: 12px; padding-top: 40px; }
.story-proof > div { display: flex; flex-direction: column; gap: 4px; }
.story-proof strong { font-size: 13px; }
.story-proof small { color: rgba(255,255,255,.52); font-size: 11px; }
.pulse-dot, .live-dot { position: relative; display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #4fd5ad; }
.pulse-dot::after { content: ""; position: absolute; inset: -5px; border: 1px solid rgba(79,213,173,.32); border-radius: inherit; }
.login-panel { display: grid; place-items: center; min-height: 100vh; padding: 46px; background: #fff; }
.login-card { width: min(100%, 410px); }
.login-card h2 { margin: 14px 0 8px; font-size: 32px; letter-spacing: -.035em; }
.login-card > .muted { margin: 0 0 34px; font-size: 14px; }
.muted { color: var(--muted); }
.mobile-brand { display: none; margin-bottom: 46px; }
.login-card label { display: block; margin: 18px 0 8px; font-size: 12px; font-weight: 700; color: #35423e; }
.input-shell { height: 50px; display: flex; align-items: center; gap: 11px; border: 1px solid #d9dedb; border-radius: 11px; padding: 0 14px; transition: border .15s, box-shadow .15s; }
.input-shell:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(22,134,111,.1); }
.input-shell > svg { width: 18px; height: 18px; fill: none; stroke: #82908b; stroke-width: 1.7; }
.input-shell input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.input-shell input::placeholder { color: #a6afac; }
.icon-button { display: grid; place-items: center; border: 0; background: transparent; padding: 0; }
.password-toggle { width: 30px; height: 30px; color: var(--soft-muted); }
.password-toggle svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.form-error { min-height: 19px; padding-top: 10px; color: var(--red); font-size: 12px; }
.button { min-height: 43px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; padding: 0 16px; font-weight: 750; font-size: 12px; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button.primary { color: #fff; background: var(--emerald); box-shadow: 0 7px 17px rgba(22,134,111,.17); }
.button.primary:hover { background: var(--emerald-dark); }
.button.secondary { border-color: var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.button.secondary:hover { border-color: #bdc7c3; }
.button.danger { color: var(--red); border-color: #edc5c2; background: var(--red-soft); }
.button.ghost { box-shadow: none; }
.button.compact { min-height: 36px; padding: 0 13px; }
.button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.login-button { width: 100%; justify-content: space-between; min-height: 51px; margin-top: 5px; padding: 0 18px; }
.security-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 18px 0 0; color: var(--soft-muted); font-size: 10px; }
.security-note svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 238px; display: flex; flex-direction: column; padding: 25px 17px 17px; color: rgba(255,255,255,.74); background: var(--forest); }
.sidebar-brand { padding: 0 8px 28px; }
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { padding: 15px 12px 9px; color: rgba(255,255,255,.35); font-size: 9px; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 9px; padding: 0 12px; color: inherit; background: transparent; text-align: left; font-size: 12px; font-weight: 650; transition: background .15s, color .15s; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: rgba(65,199,165,.16); box-shadow: inset 3px 0 #40c4a1; }
.nav-count { margin-left: auto; min-width: 26px; border-radius: 999px; padding: 2px 6px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.08); text-align: center; font-size: 9px; }
.sidebar-foot { margin-top: auto; }
.database-status { display: flex; align-items: center; gap: 10px; margin: 0 6px 13px; padding: 13px 10px; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
.database-status > span { width: 7px; height: 7px; border-radius: 50%; background: #4bd1aa; box-shadow: 0 0 0 4px rgba(75,209,170,.1); }
.database-status > div { display: flex; flex-direction: column; gap: 3px; }
.database-status strong { color: rgba(255,255,255,.78); font-size: 9px; }
.database-status small { color: rgba(255,255,255,.35); font-size: 8px; }
.logout-button { color: rgba(255,255,255,.46); }
.workspace { min-width: 0; grid-column: 2; }
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; gap: 18px; padding: 0 34px; border-bottom: 1px solid rgba(217,222,219,.82); background: rgba(250,250,247,.9); backdrop-filter: blur(18px); }
.topbar-context { display: flex; flex-direction: column; gap: 3px; }
.topbar-context span { color: var(--soft-muted); font-size: 8px; text-transform: uppercase; letter-spacing: .15em; font-weight: 800; }
.topbar-context strong { font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.last-updated { display: flex; align-items: center; gap: 7px; margin-right: 7px; color: var(--soft-muted); font-size: 9px; }
.live-dot { width: 6px; height: 6px; }
.menu-button { display: none; width: 35px; height: 35px; }
.menu-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.plus { font-size: 18px; line-height: 0; font-weight: 400; }
.main-content { width: min(100%, 1460px); margin: 0 auto; padding: 36px 38px 70px; }
.hero-row, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.hero-row h1, .section-heading h1 { margin: 11px 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 3vw, 42px); line-height: 1.1; font-weight: 500; letter-spacing: -.035em; }
.hero-row p, .section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.text-button { border: 0; padding: 0; color: var(--emerald-dark); background: transparent; font-size: 10px; font-weight: 800; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { position: relative; isolation: isolate; min-height: 142px; overflow: hidden; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.metric-card::after { content: ""; position: absolute; z-index: -1; width: 84px; height: 84px; border-radius: 50%; right: -33px; top: -32px; background: var(--metric-soft, var(--mint)); opacity: .8; pointer-events: none; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 700; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--metric-color, var(--emerald)); background: var(--metric-soft, var(--mint)); }
.metric-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.metric-number { margin-top: 18px; font-family: Georgia, serif; font-size: 32px; line-height: 1; letter-spacing: -.04em; }
.metric-meta { margin-top: 7px; color: var(--soft-muted); font-size: 9px; }
.metric-meta strong { color: var(--metric-color, var(--emerald)); }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.panel { min-height: 320px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 17px; border-bottom: 1px solid #edf0ee; }
.panel-header h2 { margin: 7px 0 0; font-family: Georgia, serif; font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.panel-kicker { color: var(--soft-muted); font-size: 8px; }
.upcoming-list, .lead-list { display: flex; flex-direction: column; }
.upcoming-item, .lead-item { display: grid; align-items: center; gap: 12px; min-height: 59px; border-bottom: 1px solid #eff1ef; }
.upcoming-item { grid-template-columns: 9px minmax(0,1fr) auto; }
.upcoming-item:last-child, .lead-item:last-child { border-bottom: 0; }
.priority-line { width: 3px; height: 28px; border-radius: 4px; background: var(--priority-color, #a8b1ae); }
.item-main { min-width: 0; }
.item-main strong { display: block; overflow: hidden; color: #34413d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.item-main small { display: block; margin-top: 4px; color: var(--soft-muted); font-size: 8px; text-transform: capitalize; }
.due-chip { border-radius: 999px; padding: 5px 8px; color: var(--muted); background: #f3f5f3; font-size: 8px; font-weight: 700; white-space: nowrap; }
.due-chip.overdue { color: var(--red); background: var(--red-soft); }
.bar-list { padding-top: 16px; }
.bar-row { margin-bottom: 16px; }
.bar-meta { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.bar-meta strong { color: #44514d; font-weight: 700; }
.bar-track { height: 6px; overflow: hidden; border-radius: 999px; background: #edf0ee; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--bar-color, var(--emerald)); transition: width .5s ease; }
.lead-item { grid-template-columns: 34px minmax(0,1fr) auto; cursor: pointer; }
.lead-item:hover .item-main strong { color: var(--emerald-dark); }
.company-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--emerald-dark); background: var(--mint); font-size: 9px; font-weight: 800; }
.score-ring { width: 34px; height: 34px; display: grid; place-items: center; border: 3px solid var(--mint); border-radius: 50%; color: var(--emerald-dark); font-size: 9px; font-weight: 800; }
.empty-inline { min-height: 190px; display: grid; place-items: center; color: var(--soft-muted); font-size: 11px; text-align: center; }
.skeleton-grid .metric-card, .loading-block { min-height: 110px; border-radius: 12px; background: linear-gradient(90deg, #f0f2f0 25%, #f8f9f8 50%, #f0f2f0 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }

.result-total { color: var(--muted); font-size: 11px; }
.result-total strong { color: var(--ink); font-size: 15px; }
.filter-card { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.search-control { height: 42px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fafbf9; }
.search-control:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(22,134,111,.08); }
.search-control svg { width: 17px; fill: none; stroke: var(--soft-muted); stroke-width: 1.7; }
.search-control input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 11px; }
.search-control kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--soft-muted); background: #fff; font-family: inherit; font-size: 8px; }
.filter-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.filter-row select, .plan-toolbar select { height: 34px; max-width: 165px; border: 1px solid var(--line); border-radius: 8px; padding: 0 28px 0 10px; color: #596660; background: #fff; font-size: 9px; outline: 0; }
.filter-row select:focus, .plan-toolbar select:focus { border-color: var(--emerald); }
.filter-clear { margin-left: auto; color: var(--soft-muted); }
.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 42px; padding: 0 14px; color: #84908c; background: #fafbf9; text-align: left; text-transform: uppercase; letter-spacing: .1em; font-size: 8px; font-weight: 800; white-space: nowrap; }
.data-table td { height: 68px; padding: 9px 14px; border-top: 1px solid #edf0ee; color: #51605b; font-size: 9px; vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: #fbfcfb; }
.company-cell { min-width: 210px; display: flex; align-items: center; gap: 10px; }
.company-cell .company-avatar { flex: none; }
.company-name { min-width: 0; }
.company-name strong { display: block; max-width: 240px; overflow: hidden; color: #293632; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.company-name a, .company-name small { display: block; max-width: 210px; overflow: hidden; margin-top: 4px; color: var(--emerald); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.company-name small { color: var(--soft-muted); }
.sector-cell { max-width: 160px; }
.sector-cell strong { display: block; overflow: hidden; color: #4d5955; text-overflow: ellipsis; white-space: nowrap; }
.sector-cell small { display: block; margin-top: 3px; color: var(--soft-muted); }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; color: #5e6965; background: #f0f2f1; font-size: 8px; font-weight: 750; text-transform: capitalize; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill.high, .pill.qualified, .pill.active { color: #0e765f; background: var(--mint); }
.pill.prospect { color: var(--blue); background: var(--blue-soft); }
.pill.medium, .pill.contacted, .pill.in_progress { color: #9a6814; background: var(--amber-soft); }
.pill.low, .pill.backlog { color: #6f7a76; background: #eff1f0; }
.pill.urgent, .pill.blocked, .pill.disqualified { color: #a63e3a; background: var(--red-soft); }
.pill.done { color: var(--blue); background: var(--blue-soft); }
.score { font-size: 11px; font-weight: 800; }
.score.high { color: var(--emerald-dark); }.score.medium { color: var(--amber); }.score.low { color: var(--soft-muted); }
.row-action { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; color: var(--soft-muted); background: #fff; }
.table-footer { min-height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-top: 1px solid var(--line); color: var(--soft-muted); font-size: 9px; }
.pagination { display: flex; align-items: center; gap: 11px; }
.pagination .icon-button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pagination .icon-button:disabled { opacity: .35; cursor: default; }
.empty-state { padding: 65px 20px; text-align: center; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: auto; border-radius: 14px; color: var(--emerald); background: var(--mint); font-size: 22px; }
.empty-state h3 { margin: 12px 0 5px; font-size: 13px; }.empty-state p { margin: 0; color: var(--muted); font-size: 10px; }

.plan-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.segmented { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.segmented button { height: 29px; border: 0; border-radius: 7px; padding: 0 12px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
.segmented button.active { color: var(--forest); background: var(--mint); }
.task-board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 11px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.task-column { min-height: 410px; border: 1px solid var(--line); border-radius: 14px; padding: 11px; background: rgba(255,255,255,.55); }
.column-head { height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px 9px; }
.column-title { display: flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.column-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--column-color); }
.column-count { min-width: 21px; border-radius: 999px; padding: 3px 6px; color: var(--muted); background: #ecefec; text-align: center; font-size: 8px; }
.task-list { display: flex; flex-direction: column; gap: 8px; min-height: 330px; }
.task-card { padding: 13px; border: 1px solid #e2e7e3; border-left: 3px solid var(--priority-color, #bdc5c2); border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(16,42,37,.035); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,42,37,.08); }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kind-tag { color: var(--emerald-dark); font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.priority-tag { color: var(--soft-muted); font-size: 7px; text-transform: uppercase; font-weight: 800; }
.task-card h3 { margin: 10px 0 7px; color: #34413d; font-size: 10px; line-height: 1.45; }
.task-card p { display: -webkit-box; overflow: hidden; margin: 0 0 10px; color: var(--muted); font-size: 8px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.task-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding-top: 9px; border-top: 1px solid #f0f2f0; color: var(--soft-muted); font-size: 7px; }
.task-card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-empty { min-height: 96px; display: grid; place-items: center; border: 1px dashed #dce2de; border-radius: 10px; color: #a0aaa6; text-align: center; font-size: 8px; }

.drawer { position: fixed; inset: 0 0 0 auto; z-index: 60; width: min(520px, 94vw); transform: translateX(102%); background: #fff; box-shadow: var(--shadow-lg); transition: transform .24s ease; }
.drawer.open { transform: translateX(0); }
.drawer-overlay { position: fixed; inset: 0; z-index: 59; visibility: hidden; opacity: 0; background: rgba(10,29,25,.38); transition: opacity .2s, visibility .2s; }
.drawer-overlay.open { visibility: visible; opacity: 1; }
.drawer-header { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { max-width: 390px; overflow: hidden; margin: 7px 0 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.drawer-header .icon-button, .modal-header .icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 20px; }
.drawer-content { height: calc(100vh - 82px); overflow-y: auto; padding: 24px; }
.drawer-score-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.drawer-stat { padding: 13px; border-radius: 11px; background: #f6f8f6; }
.drawer-stat span { display: block; color: var(--soft-muted); font-size: 7px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.drawer-stat strong { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 10px; color: var(--soft-muted); font-size: 8px; text-transform: uppercase; letter-spacing: .14em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-item { min-width: 0; padding: 11px; border: 1px solid #edf0ee; border-radius: 9px; }
.detail-item span { display: block; color: var(--soft-muted); font-size: 7px; text-transform: uppercase; letter-spacing: .08em; }
.detail-item strong, .detail-item a { display: block; overflow-wrap: anywhere; margin-top: 6px; color: #46534f; font-size: 9px; font-weight: 650; text-decoration: none; }
.detail-item a { color: var(--emerald-dark); }
.drawer-form { display: flex; flex-direction: column; gap: 9px; }
.drawer-form select, .drawer-form input, .drawer-form textarea, .form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; color: var(--ink); background: #fff; outline: 0; font-size: 10px; }
.drawer-form textarea, .form-field textarea { resize: vertical; line-height: 1.5; }
.drawer-form :focus, .form-field :focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(22,134,111,.08); }
.drawer-actions { display: flex; gap: 8px; margin-top: 10px; }
.drawer-actions .button { flex: 1; }
.source-list { display: flex; flex-direction: column; gap: 6px; }
.source-link { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--emerald-dark); font-size: 8px; text-decoration: none; }
.source-note { padding: 12px; border: 1px solid #e8e5dc; border-radius: 9px; color: #6d685c; background: #faf8f2; font-size: 9px; line-height: 1.55; }
.pill.customer, .pill.closed { color: var(--emerald-dark); background: var(--mint); }
.pill.dormant { color: #6f7a76; background: #eff1f0; }
.pill.do_not_contact { color: #a63e3a; background: var(--red-soft); }

.modal-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; visibility: hidden; opacity: 0; padding: 20px; background: rgba(9,30,25,.52); backdrop-filter: blur(3px); transition: opacity .18s, visibility .18s; }
.modal-overlay.open { visibility: visible; opacity: 1; }
.modal-card { width: min(100%, 610px); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 17px; background: #fff; box-shadow: var(--shadow-lg); transform: translateY(8px); transition: transform .18s; }
.modal-overlay.open .modal-card { transform: translateY(0); }
.modal-header { height: 75px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 7px 0 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.modal-body { padding: 21px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: block; margin-bottom: 14px; }
.form-field > span { display: block; margin-bottom: 7px; color: #56635f; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.form-field.full { width: 100%; }
.modal-footer { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
.modal-footer > span { flex: 1; }
.linked-organization { margin-top: 2px; padding: 10px; border-radius: 9px; color: var(--emerald-dark); background: var(--mint); font-size: 9px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border: 1px solid #cce5dd; border-radius: 10px; color: #205247; background: #f1fbf7; box-shadow: 0 12px 30px rgba(16,42,37,.16); font-size: 10px; font-weight: 700; animation: toast-in .2s ease; }
.toast.error { color: #913b37; border-color: #efcac7; background: #fff4f3; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .span-7, .span-5 { grid-column: span 12; }
  .dashboard-grid { grid-template-columns: repeat(12,1fr); }
}
@media (max-width: 820px) {
  .login-page { display: block; }
  .login-story { display: none; }
  .login-panel { padding: 30px 22px; }
  .mobile-brand { display: flex; }
  .app-shell { display: block; }
  .workspace { margin: 0; }
  .sidebar { transform: translateX(-102%); transition: transform .22s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay { position: fixed; inset: 0; z-index: 29; visibility: hidden; opacity: 0; background: rgba(10,29,25,.4); transition: .2s; }
  .mobile-overlay.open { visibility: visible; opacity: 1; }
  .menu-button { display: grid; }
  .topbar { padding: 0 18px; }
  .last-updated, .topbar-actions .secondary { display: none; }
  .main-content { padding: 28px 19px 55px; }
  .task-board { grid-template-columns: repeat(5, 250px); }
}
@media (max-width: 570px) {
  .topbar-context { display: none; }
  .topbar-actions { margin-left: auto; }
  .hero-row, .section-heading { align-items: flex-start; flex-direction: column; }
  .hero-row .button { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 125px; }
  .panel { padding: 17px; }
  .filter-row select { flex: 1; max-width: none; min-width: 125px; }
  .filter-clear { width: 100%; margin: 6px 0 0; text-align: left; }
  .plan-toolbar { align-items: stretch; flex-direction: column; }
  .segmented { overflow-x: auto; }
  .segmented button { flex: none; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .drawer-score-row { grid-template-columns: repeat(3,1fr); }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer > span { display: none; }
  .modal-footer .button { flex: 1; }
}
