:root {
    --ink: #15211d;
    --muted: #66726d;
    --line: #dfe6e2;
    --soft: #f3f7f5;
    --canvas: #f8faf9;
    --white: #fff;
    --green: #087a55;
    --green-dark: #055f42;
    --green-soft: #e6f5ef;
    --amber: #b66a09;
    --amber-soft: #fff3dc;
    --red: #ad3c35;
    --red-soft: #fbeae8;
    --blue: #315f91;
    --blue-soft: #e9f1fb;
    --shadow: 0 12px 36px rgba(25, 49, 40, 0.08);
    --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 4vw, 2.55rem); line-height: 1.12; letter-spacing: -0.035em; }
h2 { margin-bottom: 4px; font-size: 1.15rem; letter-spacing: -0.015em; }
h3 { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.header-inner { max-width: 1440px; height: 72px; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 40px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 160px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: white; background: var(--green); font-weight: 800; font-size: 1.05rem; box-shadow: inset 0 -5px 10px rgba(0,0,0,.12); }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { letter-spacing: -.02em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; }
.primary-nav { display: flex; align-items: center; gap: 24px; }
.primary-nav > a:not(.button) { padding: 24px 0 21px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 650; }
.primary-nav > a[aria-current="page"] { border-color: var(--green); color: var(--ink); }
.account-menu { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; color: var(--green-dark); background: var(--green-soft); font-weight: 800; }
.account-copy { min-width: 125px; max-width: 210px; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: .82rem; }
.account-copy small { color: var(--muted); font-size: .72rem; }
.text-button { padding: 6px 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: .8rem; }
.text-button:hover { color: var(--ink); text-decoration: underline; }

.page-shell { max-width: 1440px; margin: 0 auto; padding: 42px 32px 70px; }
.page-heading { max-width: 820px; margin-bottom: 30px; }
.page-heading > p:last-child, .heading-with-action > div > p:last-child { color: var(--muted); margin-bottom: 0; }
.heading-with-action { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow { margin-bottom: 7px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 22px; color: var(--muted); font-size: .85rem; font-weight: 650; }

.button, .button-secondary { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; padding: 10px 17px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; font-weight: 750; line-height: 1; }
.button { color: white; background: var(--green); box-shadow: 0 6px 16px rgba(8, 122, 85, .16); }
.button:hover { color: white; background: var(--green-dark); text-decoration: none; }
.button-secondary { border-color: var(--line); color: var(--ink); background: white; }
.button-secondary:hover { border-color: #bcc9c3; text-decoration: none; }
.button-small { min-height: 36px; padding: 8px 13px; font-size: .82rem; }
.button-block { width: 100%; }

.messages { position: fixed; z-index: 40; top: 84px; left: 50%; width: min(92vw, 620px); transform: translateX(-50%); }
.message { padding: 13px 16px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: var(--shadow); font-weight: 650; }
.message-success { border-color: #a9d8c6; background: var(--green-soft); color: var(--green-dark); }
.message-error { border-color: #efb5b0; background: var(--red-soft); color: var(--red); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 142px; padding: 21px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(20,45,35,.025); }
.metric-card:hover { border-color: #b9cbc3; text-decoration: none; transform: translateY(-1px); }
.metric-card > span, .metric-card > small { display: block; color: var(--muted); }
.metric-card > span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.metric-card > strong { display: block; margin: 13px 0 4px; font-size: 2rem; line-height: 1; letter-spacing: -.05em; }
.metric-card > small { font-size: .78rem; }
.metric-accent { border: 0; color: white; background: var(--green); }
.metric-accent > span, .metric-accent > small { color: rgba(255,255,255,.78); }
.metric-accent::after { content: ""; position: absolute; width: 115px; height: 115px; right: -35px; bottom: -45px; border: 25px solid rgba(255,255,255,.09); border-radius: 50%; }
.metric-warning > strong { color: var(--red); }

.status-strip { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; }
.summary-group .status-strip { margin-bottom: 10px; }
.summary-label { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.status-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: .75rem; }
.status-chip:hover { border-color: #b8c6bf; text-decoration: none; }
.status-chip strong { min-width: 20px; padding: 1px 6px; border-radius: 20px; color: var(--ink); background: var(--soft); text-align: center; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #89938f; }
.status-not_yet_responded { background: #89938f; }
.status-not_interested { background: var(--red); }
.status-meeting_to_be_scheduled { background: var(--amber); }
.status-meeting_scheduled { background: var(--blue); }
.status-meeting_done { background: var(--green); }

.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 2px 8px rgba(20,45,35,.025); }
.panel-header { min-height: 72px; padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header p { margin-bottom: 0; }
.panel-header p { color: var(--muted); font-size: .78rem; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; align-items: end; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--soft); }
.filter-bar label { display: block; margin: 0 0 4px 2px; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.filter-control { width: 100%; min-height: 37px; padding: 7px 10px; border: 1px solid #ccd6d1; border-radius: 8px; color: var(--ink); background: white; outline: none; }
.filter-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,122,85,.11); }
.filter-actions { display: flex; gap: 6px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; color: var(--muted); background: #fbfcfb; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { min-width: 110px; padding: 15px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #fbfdfc; }
.company-link { display: block; color: var(--ink); font-weight: 780; }
.contact-name { display: block; font-weight: 650; }
.cell-secondary { display: block; max-width: 260px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.owner-pill { display: inline-block; max-width: 170px; overflow: hidden; padding: 5px 8px; border-radius: 6px; background: var(--soft); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.stage-label { display: block; font-size: .78rem; font-weight: 760; }
.stage-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #67500a; background: #fff6d9; font-size: .7rem; font-weight: 750; }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border-radius: 999px; font-size: .69rem; font-weight: 750; white-space: nowrap; }
.badge-not_yet_responded { color: #53605b; background: #edf0ef; }
.badge-not_interested { color: var(--red); background: var(--red-soft); }
.badge-meeting_to_be_scheduled { color: #8a4e00; background: var(--amber-soft); }
.badge-meeting_scheduled { color: var(--blue); background: var(--blue-soft); }
.badge-meeting_done { color: var(--green-dark); background: var(--green-soft); }
.outreach-count { display: inline-flex; align-items: baseline; gap: 2px; font-size: 1rem; font-weight: 800; }
.outreach-count small { color: var(--muted); font-size: .7rem; font-weight: 500; }
.row-arrow { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); background: var(--soft); font-weight: 800; }
.row-arrow:hover { color: white; background: var(--green); text-decoration: none; }
.muted { color: var(--muted); }
.text-danger { color: var(--red) !important; font-weight: 650; }
.text-today { color: var(--green) !important; font-weight: 750; }
.pagination { display: flex; justify-content: space-between; align-items: center; min-height: 62px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.pagination a { font-weight: 700; }
.empty-state { padding: 64px 24px; text-align: center; }
.empty-state h3 { margin-bottom: 5px; }
.empty-state p { color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 1.55rem; }

.record-form { max-width: 1000px; }
.playbook-guidance { margin-bottom: 14px; padding: 15px 18px; border: 1px solid #b9d9cd; border-radius: var(--radius); color: #365149; background: var(--green-soft); }
.playbook-guidance > div { display: grid; gap: 3px; }
.playbook-guidance strong { color: var(--green-dark); }
.playbook-guidance span { font-size: .82rem; }
.form-section { display: grid; grid-template-columns: 190px 1fr; gap: 28px; padding: 28px; border: 1px solid var(--line); border-bottom: 0; background: white; }
.form-section:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.form-section:last-of-type { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.form-section-heading { display: flex; gap: 12px; }
.form-section-heading > span { display: grid; flex: 0 0 auto; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: var(--green); background: var(--green-soft); font-size: .7rem; font-weight: 850; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: .78rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-size: .78rem; font-weight: 750; }
.required { margin-left: 3px; color: var(--red); }
.form-control { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #cbd5d0; border-radius: 8px; color: var(--ink); background: white; outline: none; }
input[type="checkbox"].form-control { width: 20px; min-height: 20px; padding: 0; accent-color: var(--green); }
.checkbox-field label { display: inline-block; margin-left: 30px; }
.checkbox-field input { float: left; }
textarea.form-control { resize: vertical; }
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,122,85,.1); }
.field:has(.field-error) .form-control { border-color: var(--red); }
.help-text, .field-error { display: block; margin-top: 5px; font-size: .7rem; }
.help-text { color: var(--muted); }
.field-error { color: var(--red); font-weight: 650; }
.form-alert { margin-bottom: 16px; padding: 12px; border-radius: 8px; color: var(--red); background: var(--red-soft); }
.form-alert ul { margin: 0; }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; }
.compact-form { max-width: 760px; }
.compact-form .form-section { display: block; border: 1px solid var(--line); border-radius: var(--radius); }

.detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.detail-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-title-row h1 { margin-bottom: 0; }
.detail-actions { display: flex; align-items: center; gap: 10px; }
.detail-actions form { margin: 0; }
.research-notice { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; padding: 16px 20px; border: 1px solid #e0bd68; border-radius: var(--radius); background: #fff7df; color: #59471e; }
.research-notice div { display: grid; gap: 4px; }
.research-notice strong { color: #3f3218; }
.research-notice span, .research-notice a { font-size: .86rem; }
.website-link { display: inline-block; margin-top: 8px; color: var(--muted); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .72fr); gap: 18px; align-items: start; }
.detail-main { display: grid; gap: 18px; }
.detail-panel { overflow: visible; }
.description-copy { padding: 20px 21px 0; color: #3f4e48; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 20px 21px 24px; }
.info-grid > div { min-width: 0; }
.info-grid dt { margin-bottom: 4px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.info-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.info-full { grid-column: 1 / -1; }
.count-label { margin-left: 5px; color: var(--muted); font-size: .75rem; font-weight: 500; }
.timeline { list-style: none; margin: 0; padding: 5px 21px 20px; }
.timeline li { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px 0; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 49px; bottom: -16px; width: 1px; background: var(--line); }
.timeline-number { display: grid; place-items: center; align-self: start; width: 34px; height: 34px; border: 1px solid #b8d9cc; border-radius: 50%; color: var(--green); background: var(--green-soft); font-weight: 800; }
.timeline-content { min-width: 0; padding-bottom: 4px; }
.timeline-head { display: flex; justify-content: space-between; gap: 16px; }
.timeline-head strong, .timeline-head span { display: block; }
.timeline-head span, .timeline-head a, .timeline-content small { color: var(--muted); font-size: .72rem; }
.timeline-content p { margin: 9px 0 7px; }
.inline-form-wrap { padding: 22px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--soft); }
.inline-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.limit-notice { padding: 15px 21px; border-top: 1px solid #badccc; color: var(--green-dark); background: var(--green-soft); font-weight: 650; }
.empty-inline { padding: 20px; color: var(--muted); text-align: center; }
.detail-sidebar { display: grid; gap: 14px; position: sticky; top: 92px; }
.action-card, .side-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.action-card { border: 0; color: white; background: var(--green); box-shadow: var(--shadow); }
.action-card .eyebrow { color: rgba(255,255,255,.72); }
.action-card h2 { font-size: 1.3rem; line-height: 1.25; }
.action-card a { color: white; text-decoration: underline; }
.action-date { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.88); font-weight: 650; }
.action-card .text-danger { color: #ffe1dc !important; }
.side-card strong, .side-card span { display: block; }
.side-card span { margin-top: 3px; color: var(--muted); }
.side-card p:last-child { margin-bottom: 0; }
.compact-details { display: grid; gap: 13px; margin: 0; }
.compact-details dt { margin-bottom: 3px; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.compact-details dd { margin: 0; overflow-wrap: anywhere; font-size: .82rem; }
.meeting-card { border-color: #bfd2e7; background: var(--blue-soft); }
.record-meta { padding: 0 5px; color: var(--muted); font-size: .7rem; }

.user-metrics { grid-template-columns: repeat(3, 1fr); }
.user-metrics .metric-card { min-height: 128px; }
.role-badge, .access-state { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.role-intern { color: #40534b; background: var(--soft); }
.role-inside_sales { color: #7a4d00; background: var(--amber-soft); }
.role-linkedin_outreach { color: #1c5a91; background: var(--blue-soft); }
.role-manager { color: var(--blue); background: var(--blue-soft); }
.role-system_admin { color: #6b3c87; background: #f3eafb; }
.access-state::before { content: ""; width: 7px; height: 7px; margin: 6px 6px 0 0; border-radius: 50%; }
.access-active { color: var(--green-dark); }
.access-active::before { background: var(--green); }
.access-disabled { color: var(--red); }
.access-disabled::before { background: var(--red); }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.row-actions form { margin: 0; }
.row-actions button { padding: 0; border: 0; color: var(--green-dark); background: transparent; cursor: pointer; font-weight: 700; }
.danger-link { color: var(--red); }
.role-explainer { margin-top: 22px; padding: 16px; border-radius: 10px; color: var(--muted); background: var(--soft); font-size: .8rem; }
.role-explainer p { margin-bottom: 7px; }
.role-explainer p:last-child { margin-bottom: 0; }
.delete-card { max-width: 650px; padding: 24px; border: 1px solid #ecc5c1; border-radius: var(--radius); background: white; }
.delete-card dl { margin: 0; }
.delete-card dl > div { display: grid; grid-template-columns: 100px 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
.delete-card dt { color: var(--muted); }
.delete-card dd { margin: 0; font-weight: 700; }
.button-danger { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; padding: 10px 17px; border: 0; border-radius: 9px; color: white; background: var(--red); cursor: pointer; font-weight: 750; }
.eyebrow-danger { color: var(--red); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 20% 0%, #e1f3ec, transparent 35%), linear-gradient(145deg, #f8faf9 45%, #e8f1ed); }
.login-card { width: min(100%, 440px); padding: 42px; border: 1px solid rgba(180,199,190,.75); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 25px 70px rgba(21,63,47,.12); }
.login-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 28px; }
.brand-mark-large { width: 50px; height: 50px; border-radius: 13px; font-size: 1.45rem; }
.login-brand .eyebrow { margin-bottom: 0; }
.login-brand h1 { margin: 0; font-size: 2rem; }
.login-intro { color: var(--muted); font-size: 1rem; }
.login-points { display: grid; gap: 8px; margin: 26px 0; padding: 18px; border-radius: 11px; color: #394841; background: var(--soft); font-size: .85rem; }
.login-points span::before { content: "✓"; margin-right: 8px; color: var(--green); font-weight: 900; }
.google-button { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 11px; padding: 10px 16px; border: 1px solid #c5cfca; border-radius: 9px; color: var(--ink); background: white; cursor: pointer; font-weight: 750; }
.google-button:hover { border-color: #95a69e; background: #fbfcfb; }
.google-g { color: #4285f4; font-size: 1.2rem; font-weight: 900; }
.login-note { margin: 14px 0 0; color: var(--muted); font-size: .73rem; text-align: center; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .user-metrics { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filter-search { grid-column: span 2; }
}

@media (max-width: 820px) {
    .header-inner { height: auto; min-height: 66px; padding: 10px 18px; gap: 14px; flex-wrap: wrap; }
    .brand { min-width: 0; }
    .brand small, .account-copy { display: none; }
    .primary-nav { order: 3; width: 100%; justify-content: space-between; border-top: 1px solid var(--line); }
    .primary-nav > a:not(.button) { padding: 12px 0 9px; }
    .account-menu { margin-left: auto; }
    .page-shell { padding: 28px 18px 56px; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; grid-row: 1; }
    .form-section { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    h1 { font-size: 1.8rem; }
    .heading-with-action, .detail-heading { align-items: flex-start; flex-direction: column; }
    .research-notice { align-items: flex-start; flex-direction: column; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .metric-card { min-height: 122px; padding: 16px; }
    .metric-card > strong { font-size: 1.7rem; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-search { grid-column: auto; }
    .filter-actions { padding-top: 4px; }
    .form-grid, .inline-form, .info-grid { grid-template-columns: 1fr; }
    .field-full, .info-full { grid-column: auto; }
    .form-section { padding: 21px 17px; }
    .login-card { padding: 30px 24px; }
    .table-wrap { margin-right: -1px; }
    th, td { padding: 13px 12px; }
}
