:root {
    --ink: #17211b;
    --muted: #69736c;
    --paper: #f4f5f0;
    --card: #ffffff;
    --line: #dde1da;
    --green: #0c6b43;
    --green-soft: #dcebe2;
    --red: #bd342d;
    --yellow: #e2ad1b;
    --shadow: 0 12px 36px rgba(30, 48, 37, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: var(--green); }
.site-header { height: 68px; display: flex; align-items: center; border-bottom: 1px solid rgba(23, 33, 27, .1); background: rgba(244,245,240,.9); }
.site-header, .container, .site-footer { padding-left: max(24px, calc((100vw - 1240px) / 2)); padding-right: max(24px, calc((100vw - 1240px) / 2)); }
.brand { color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: .11em; font-size: 18px; }
.brand span { color: var(--green); font-weight: 650; letter-spacing: .01em; margin-left: 7px; }
.container { min-height: calc(100vh - 130px); padding-top: 54px; padding-bottom: 60px; }
.site-footer { padding-top: 20px; padding-bottom: 26px; color: var(--muted); font-size: 13px; }
.hero, .detail-header { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 30px; }
.detail-header { width: 100%; max-width: 100%; }
.detail-header > div:first-child { flex: 1 1 auto; min-width: 0; }
.detail-header h1 { max-width: 100%; font-size: clamp(30px, 2.7vw, 40px); line-height: 1.12; overflow-wrap: anywhere; word-break: normal; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(37px, 5vw, 61px); line-height: 1.04; font-weight: 500; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 19px; }
.subtitle { margin: 12px 0 0; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 10px 17px; border: 1px solid var(--green); border-radius: 7px; background: var(--green); color: #fff; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { filter: brightness(.94); }
.button-secondary { background: transparent; color: var(--green); }
.button-danger { border-color: #a82f29; background: #a82f29; }
.flash { margin: 0 0 22px; padding: 13px 16px; border-radius: 7px; border: 1px solid; }
.flash-error { color: #7b221e; background: #f9e9e7; border-color: #e8b8b4; }
.flash-warning { color: #674a00; background: #fff6d8; border-color: #ead58e; }
.flash-success { color: #155939; background: #e0f2e7; border-color: #add4bd; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 26px 0 14px; }
.overview-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.month-filter { display: flex; align-items: center; gap: 9px; }.month-filter label { font-size: 14px; font-weight: 700; }.month-filter select { min-width: 180px; height: 38px; padding: 6px 34px 6px 10px; border: 1px solid #cbd0cb; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }.month-filter select:focus { outline: 3px solid rgba(12,107,67,.16); border-color: var(--green); }
.toggle { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 650; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 39px; height: 22px; padding: 3px; border-radius: 99px; background: #cbd0ca; transition: .2s; }
.toggle span::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(17px); }
.toggle input:focus-visible + span { outline: 3px solid rgba(12,107,67,.25); }
.sync-meta { margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.card { border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.table-heading, .chart-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.count { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 800; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 11px 15px; color: var(--muted); background: #fafbf8; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td { padding: 15px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #fafbf8; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 800; }
.campaign-link { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 210px; }
.campaign-link:hover strong { color: var(--green); }
.campaign-link small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.campaign-cell { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 265px; }
.copy-button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 8px; border: 1px solid #cbd0cb; border-radius: 5px; background: #fff; color: var(--muted); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; transition: .15s; }
.copy-button:hover { border-color: var(--green); color: var(--green); }.copy-button:focus-visible { outline: 3px solid rgba(12,107,67,.2); }.copy-button.is-copied { border-color: #86bea0; background: var(--green-soft); color: var(--green); }
.copy-icon-button { width: 29px; min-height: 29px; padding: 2px; justify-content: center; font-size: 15px; }
.edit-id-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.detail-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 11px; }.salesforce-link { display: inline-grid; place-items: center; width: 55px; height: 43px; color: #00a1e0; border: 1px solid #abdcec; border-radius: 7px; background: #fff; transition: .15s; }.salesforce-link:hover { color: #078bc0; border-color: #68c4e5; transform: translateY(-1px); }.salesforce-link svg { width: 40px; height: 29px; }
.salesforce-link-small { flex: 0 0 auto; width: 37px; height: 31px; border-radius: 6px; }.salesforce-link-small svg { width: 29px; height: 21px; }
.warning { display: inline-grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; color: #624600; background: #f4c64c; font-size: 13px; font-weight: 900; }
.status-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); vertical-align: middle; }
.status-red { background: var(--red); }.status-yellow { background: var(--yellow); }.status-green { background: #299560; }.status-white { background: #fff; }.status-unknown { background: #aab0ab; }
.pace { display: inline-block; min-width: 72px; padding: 4px 7px; border-radius: 5px; font-weight: 800; }
.pace-red { color: #9c2722; background: #f9e4e2; }.pace-yellow { color: #6b4d00; background: #fff2c9; }.pace-green { color: #09613b; background: #dbefe3; }.pace-white { border: 1px solid #cdd2cd; }.pace-unknown { color: var(--muted); background: #eef0ed; }
.date-range { white-space: nowrap; color: var(--muted); }
.empty-state { padding: 38px 24px; text-align: center; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 17px; padding-top: 15px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.breadcrumb { margin-bottom: 32px; }.breadcrumb a { color: var(--muted); text-decoration: none; font-weight: 650; }.breadcrumb a:hover { color: var(--green); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 25px 0; }
.metric { min-height: 135px; padding: 19px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.metric > span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.metric strong { display: block; margin: 11px 0 4px; font-size: clamp(22px, 2.3vw, 31px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); }.metric-status strong { display: flex; align-items: center; gap: 9px; }.metric-wide { grid-column: span 2; }
.chart-card { margin-top: 18px; }.chart-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.chart-legend { display: flex; gap: 15px; color: var(--muted); font-size: 12px; }.chart-legend span { display: flex; align-items: center; gap: 6px; }
.line-key { width: 20px; height: 3px; border-radius: 2px; }.actual-key { background: var(--green); }.target-key { background: #b88716; }
.chart-wrap { height: 390px; padding: 22px 16px 11px; }.chart-wrap canvas { width: 100%; height: 100%; }
.form-shell { max-width: 720px; margin: 0 auto; }.form-intro { margin-bottom: 26px; }.form-intro h1 { font-size: clamp(35px, 5vw, 52px); }
.campaign-form { display: grid; gap: 19px; padding: 26px; }.campaign-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
.campaign-form input { width: 100%; height: 45px; padding: 9px 11px; border: 1px solid #cbd0cb; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
.campaign-form input:focus { outline: 3px solid rgba(12,107,67,.16); border-color: var(--green); }.field-error { color: var(--red); font-weight: 600; }
.field-hint { color: var(--muted); font-weight: 500; }.optional { color: var(--muted); font-size: 11px; font-weight: 500; }
.form-divider { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 5px; }.setup-shell code { padding: 2px 5px; border-radius: 4px; background: #eef0ed; }
.diagnostic-row { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }.diagnostic-row:last-child { border-bottom: 0; }.diagnostic-row .pace { text-align: center; font-size: 12px; }.diagnostic-row small { color: var(--muted); }

@media (max-width: 860px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .hero, .detail-header { align-items: flex-start; flex-direction: column; }
    .detail-actions { width: 100%; }
    .detail-actions .button { flex: 1 1 auto; }
    .sync-form, .sync-form .button { width: 100%; }
}
@media (max-width: 560px) {
    .container { padding-top: 35px; }.toolbar { align-items: flex-start; flex-direction: column; }.overview-filters { align-items: flex-start; flex-direction: column; }.sync-meta { text-align: left; }
    .metrics-grid { grid-template-columns: 1fr; }.metric-wide { grid-column: auto; }.form-row { grid-template-columns: 1fr; }.form-actions { flex-direction: column-reverse; }.form-actions .button { width: 100%; }
    .chart-heading { align-items: flex-start; gap: 13px; flex-direction: column; }.chart-wrap { height: 310px; }
}
