﻿:root {
  --bg: #f2f5f8; --surface: #fff; --surface-2: #f7f9fb; --ink: #13293a; --ink-2: #3d5468; --muted: #6b7f91; --border: #dde5ec; --border-2: #eaf0f4;
  --navy: #0d1d2c; --navy-2: #16303f; --accent: #087d6d; --accent-2: #0a9682; --accent-soft: #e5f6f2;
  --a: #c2410c; --a-soft: #fff1e8; --b: #b45309; --b-soft: #fff7e0; --c: #2563eb; --c-soft: #eaf1ff; --d: #64748b; --d-soft: #eef2f6;
  --danger: #c0262d; --danger-soft: #fdecec; --ok: #15803d; --ok-soft: #e8f6ed; --warn: #a16207; --warn-soft: #fdf6dd;
  --radius: 10px; --shadow: 0 1px 2px rgb(16 40 60 / 4%), 0 4px 14px rgb(16 40 60 / 4%);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--bg); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.45; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #2bb9a3; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.2px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
.subtle { color: var(--muted); font-size: 12px; }
.link { font-size: 12px; text-decoration: none; font-weight: 600; }

/* Sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; background: var(--navy); color: #a9b9c9; display: flex; flex-direction: column; padding: 22px 14px; z-index: 5; gap: 18px; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: #fff; font-size: 22px; font-weight: 750; padding: 0 8px; letter-spacing: -1px; }
.brand-light { font-weight: 400; color: #6ce0cc; }
.brand small { display: block; font-size: 10px; letter-spacing: 1.6px; color: #8aa0b4; margin-top: 3px; font-weight: 600; }
nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; border-radius: 8px; padding: 10px 11px; color: #b4c3d0; text-decoration: none; font-size: 14px; position: relative; }
.nav-icon { font-size: 17px; width: 20px; text-align: center; opacity: .9; }
.nav-item:hover { background: #142a38; color: #fff; }
.nav-item.active { background: #17393f; color: #8ff0db; }
.count { margin-left: auto; font-size: 11px; background: #29404e; color: #d8e3eb; border-radius: 10px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.live-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #36d39f; box-shadow: 0 0 0 0 rgb(54 211 159 / 60%); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgb(54 211 159 / 0%); } 100% { box-shadow: 0 0 0 0 rgb(54 211 159 / 0%); } }
.sidebar-job { margin-top: auto; background: #132838; border: 1px solid #22394a; border-radius: 9px; padding: 11px; display: grid; gap: 5px; font-size: 12px; color: #c9d6e0; }
.sidebar-job strong { color: #fff; font-size: 12px; }
.sidebar-job span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sidebar-user { margin-top: auto; display: grid; gap: 5px; font-size: 11px; letter-spacing: .5px; color: #8aa0b4; text-transform: uppercase; }
.sidebar-job:not([hidden]) + .sidebar-user { margin-top: 0; }
.sidebar-user-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.sidebar-user-row strong { color: #e8eff4; font-size: 14px; }
.logout { background: #102434; border: 1px solid #284153; color: #c9d6e0; border-radius: 7px; padding: 5px 10px; font-size: 12px; }
.logout:hover { color: #fff; border-color: #3c5a6e; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 16px; }
.login-wrap { width: min(380px, 100%); }
.login-card { background: var(--surface); border-radius: 14px; padding: 28px 26px; display: grid; gap: 14px; box-shadow: 0 20px 50px rgb(0 0 0 / 35%); }
.login-card h1 { font-size: 20px; }
.login-card input { height: 42px; font-size: 14px; }
.login-card .primary { min-height: 42px; font-size: 14px; }
.login-brand { display: flex; gap: 10px; align-items: center; font-size: 22px; font-weight: 750; letter-spacing: -1px; color: var(--ink); }
.login-brand small { display: block; font-size: 10px; letter-spacing: 1.6px; color: var(--muted); font-weight: 600; }
.login-brand .brand-light { color: var(--accent); }
.login-error { margin: 0; background: var(--danger-soft); color: var(--danger); border-radius: 7px; padding: 8px 10px; font-size: 13px; }
.shell { margin-left: 220px; min-width: 0; }
.topbar { min-height: 68px; padding: 12px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); position: sticky; top: 0; z-index: 4; }
.topbar h1 { font-size: 19px; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.connection { font-size: 12px; border: 1px solid var(--border); border-radius: 20px; padding: 6px 11px; color: var(--muted); white-space: nowrap; }
.connection.online::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); margin-right: 7px; vertical-align: middle; }
main { padding: 22px 28px 40px; max-width: 1680px; margin: 0 auto; }

/* Controls */
input, select, textarea { min-width: 0; border: 1px solid #d3dde6; background: #fff; border-radius: 7px; padding: 8px 10px; width: 100%; font-size: 13px; }
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; padding: 0; accent-color: var(--accent); flex: none; }
input[type="range"] { padding: 0; accent-color: var(--accent); }
label { display: grid; gap: 5px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.primary, .secondary, .danger-button { border-radius: 7px; padding: 8px 14px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; min-height: 36px; }
.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.primary:hover:not(:disabled) { background: #06685b; }
.secondary { background: #fff; color: var(--ink-2); border: 1px solid #ccd8e2; }
.secondary:hover:not(:disabled) { background: var(--surface-2); border-color: #b9c8d4; }
.danger-button { background: #fff; color: var(--danger); border: 1px solid #f0c4c6; }
.text-button { background: none; border: 0; color: var(--accent); font-size: 12px; font-weight: 600; padding: 4px; }
.icon-button { background: none; border: 1px solid transparent; border-radius: 7px; width: 34px; height: 34px; font-size: 20px; line-height: 1; color: var(--muted); display: inline-grid; place-items: center; }
.icon-button:hover { background: var(--surface-2); border-color: var(--border); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 6px; padding: 5px 9px; font-size: 12px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--accent); font-weight: 650; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
.seg.small button { padding: 3px 7px; font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 20px; padding: 4px 10px; font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.chip.on { background: var(--accent-soft); border-color: #9fdccf; color: #05594e; font-weight: 600; }
.chip .n { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 650; white-space: nowrap; background: var(--d-soft); color: var(--ink-2); }
.tier { display: inline-grid; place-items: center; min-width: 46px; border-radius: 9px; padding: 5px 6px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.05; }
.tier strong { font-size: 18px; }
.tier small { font-size: 9.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.tier-A { background: var(--a-soft); color: var(--a); }
.tier-B { background: var(--b-soft); color: var(--b); }
.tier-C { background: var(--c-soft); color: var(--c); }
.tier-D, .tier-none { background: var(--d-soft); color: var(--d); }
.gap { display: inline-flex; align-items: center; gap: 4px; border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 600; background: #eef3f7; color: #2f4a5e; white-space: nowrap; }
.gap.kesin { background: #fde9e4; color: #a13d1f; }
.gap.guclu { background: #fff0db; color: #8a4a06; }
.gap.olasi { background: #e8f0fb; color: #284f8f; }
.gap.sor { background: #f1f1f4; color: #5b6170; }
.conf { font-size: 10px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; border-radius: 4px; padding: 2px 6px; }
.conf.kesin { background: #fde9e4; color: #a13d1f; }
.conf.guclu { background: #fff0db; color: #8a4a06; }
.conf.olasi { background: #e8f0fb; color: #284f8f; }
.conf.sor { background: #f1f1f4; color: #5b6170; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 2px 9px; font-size: 11px; font-weight: 650; white-space: nowrap; background: #eef2f6; color: #3e5163; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.status.no_answer { background: #fdf3e2; color: #9a5b00; }
.status.callback { background: #fef6d8; color: #866100; }
.status.contacted { background: #e7f0ff; color: #2550a8; }
.status.interested { background: #e3f7ef; color: #087a52; }
.status.proposal { background: #efe8ff; color: #6236c4; }
.status.won { background: #d9f5e3; color: #0f6e3a; }
.status.lost { background: #fdecec; color: #b42329; }
.status.disqualified { background: #f0f0f2; color: #6b6f78; }
.due { color: var(--danger); font-weight: 650; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head p { margin: 4px 0 0; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.empty p { margin: 0 auto; max-width: 460px; }

/* Dashboard */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; text-decoration: none; color: inherit; box-shadow: var(--shadow); display: grid; gap: 3px; }
.kpi:hover { border-color: #b8ccd9; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi strong { font-size: 25px; font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 11px; color: var(--muted); }
.kpi.hot strong { color: var(--a); }
.kpi.money strong { color: var(--ok); }
.stale-banner { background: var(--warn-soft); border: 1px solid #f0dc9b; color: #6b4a00; border-radius: var(--radius); padding: 11px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mini-list { display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.mini { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 8px; background: none; border: 0; text-align: left; width: 100%; }
.mini:hover { background: var(--surface-2); }
.mini .tier { min-width: 38px; padding: 3px; }
.mini .tier strong { font-size: 14px; }
.mini > span:nth-child(2) { min-width: 0; display: grid; gap: 1px; }
.mini-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-right { text-align: right; font-size: 12px; display: grid; gap: 3px; justify-items: end; }
.funnel { display: grid; gap: 7px; }
.funnel-row, .bar-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 46px; gap: 9px; align-items: center; font-size: 12px; color: var(--ink-2); text-decoration: none; }
.funnel-row:hover span:first-child, .bar-row:hover span:first-child { color: var(--accent); }
.track { height: 9px; background: var(--border-2); border-radius: 6px; overflow: hidden; }
.fill { display: block; height: 100%; width: 0; background: var(--accent-2); border-radius: 6px; transition: width .3s; }
.fill.warm { background: #e8833a; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.bars { display: grid; gap: 7px; }
.timeline { display: grid; gap: 0; }
.timeline.compact { max-height: 360px; overflow: auto; }
.event { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--border-2); font-size: 12.5px; }
.event:last-child { border-bottom: 0; }
.event-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; }
.event p { margin: 2px 0 0; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.event small { display: block; margin-top: 2px; color: var(--muted); }
.event button { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 650; text-align: left; }
.event button:hover { color: var(--accent); }

/* Leads */
.leads-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.filter-rail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.rail-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.rail-section { padding: 12px 15px; border-bottom: 1px solid var(--border-2); display: grid; gap: 9px; }
.rail-section:last-child { border-bottom: 0; }
.rail-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.check-list { display: grid; gap: 2px; }
.check-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; font-weight: 400; }
.check-row:hover { background: var(--surface-2); }
.check-row .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.check-row.zero { opacity: .45; }
.range-label { grid-template-columns: 1fr auto; align-items: center; }
.range-label input { grid-column: 1 / -1; }
.presets { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 11px; }
.preset { border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 6px 12px; font-size: 12.5px; color: var(--ink-2); box-shadow: var(--shadow); }
.preset:hover { border-color: #9fdccf; color: var(--accent); }
.preset.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.toolbar { display: flex; gap: 9px; align-items: center; margin-bottom: 9px; flex-wrap: wrap; }
.search-field { flex: 1 1 260px; }
.search-field input { height: 36px; }
.sort-field { flex: 0 0 200px; }
.sort-field select { height: 36px; }
.filter-toggle { display: none; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 38px; padding: 0 4px 6px; flex-wrap: wrap; }
.list-head #result-count { font-weight: 650; color: var(--ink); }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.bulk select { width: auto; height: 32px; }
.lead-list { display: grid; gap: 7px; }
.lead { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: 22px 54px minmax(150px, 1.2fr) minmax(180px, 1.5fr) 150px auto; gap: 12px; align-items: center; padding: 11px 13px; }
.lead:hover { border-color: #b8ccd9; }
.lead.selected { border-color: var(--accent-2); background: #fbfefd; }
.lead-name { font-weight: 650; font-size: 14px; background: none; border: 0; padding: 0; text-align: left; color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lead-name:hover { color: var(--accent); }
.lead-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars { color: #c98a00; font-weight: 650; }
.lead-gaps { display: flex; flex-wrap: wrap; gap: 4px; }
.lead-reason { font-size: 12px; color: var(--muted); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.lead-meta { display: grid; gap: 4px; min-width: 0; }
.lead-price strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.lead-price small { font-size: 11px; color: var(--muted); }
.lead-status { display: grid; gap: 4px; justify-items: start; font-size: 11.5px; color: var(--muted); }
.lead-actions { display: flex; gap: 4px; justify-content: flex-end; }
.act { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border); background: #fff; display: inline-grid; place-items: center; text-decoration: none; color: var(--ink-2); font-size: 14px; }
.act:hover { border-color: var(--accent-2); color: var(--accent); background: var(--accent-soft); }
.act.open { font-size: 20px; font-weight: 650; color: var(--accent); }
.stale-mark { font-size: 10px; color: var(--warn); font-weight: 700; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px 0 4px; }

/* Pipeline */
.pipeline-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pipeline-toolbar .search-field { flex: 0 1 320px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.column { background: #e9eef3; border-radius: var(--radius); padding: 9px; min-height: 200px; display: grid; gap: 7px; align-content: start; }
.column.drag-over { background: #d8efe9; outline: 2px dashed var(--accent-2); }
.column-head { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 4px 6px; gap: 6px; }
.column-head h2 { font-size: 13px; }
.column-head small { color: var(--muted); font-size: 11px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; display: grid; gap: 5px; cursor: grab; box-shadow: 0 1px 2px rgb(0 0 0 / 4%); text-align: left; width: 100%; }
.card:hover { border-color: #a9c3d4; }
.card.dragging { opacity: .45; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.card-name { font-weight: 650; font-size: 13px; }
.card-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }

/* Scan */
.scan-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.scan-side { display: grid; gap: 14px; }
.scan-form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.inline-actions { display: flex; gap: 6px; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid #d3dde6; border-radius: 7px; padding: 6px; background: #fff; }
.tag-input input { border: 0; flex: 1 1 160px; padding: 4px; }
.tag-input input:focus-visible { outline: none; }
.tag-input:focus-within { outline: 3px solid #2bb9a3; outline-offset: 2px; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: #05594e; border-radius: 6px; padding: 3px 4px 3px 9px; font-size: 12.5px; font-weight: 600; }
.tag button { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; padding: 0 3px; }
.sector-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sector-group { border: 1px solid var(--border-2); border-radius: 8px; padding: 9px 10px; background: var(--surface-2); }
.sector-group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sector-group-head strong { font-size: 12px; }
.sector-group .chips { gap: 5px; }
.sector-group .chip { font-size: 11.5px; padding: 3px 8px; }
.custom-sector input { height: 36px; }
.channel-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; }
.channel-nosite { margin-top: 6px; }
.channel-picks select { width: auto; height: 32px; padding: 3px 8px; font-size: 13px; }
.scan-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.scan-row label { flex: 1 1 160px; }
.scan-row input { height: 38px; }
.scan-row .primary, .scan-row .secondary { min-height: 38px; }
.campaign-options { border-top: 1px solid var(--border-2); padding-top: 10px; }
.campaign-options summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.campaign-options[open] { display: grid; gap: 10px; }
.plan-preview { margin: 0; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 7px; padding: 9px 11px; }
.plan-preview.error { background: var(--danger-soft); color: var(--danger); }
.job-message { margin: 0 0 6px; color: var(--ink-2); overflow-wrap: anywhere; }
progress { width: 100%; height: 7px; appearance: none; border: 0; background: var(--border-2); border-radius: 6px; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--border-2); border-radius: 6px; }
progress::-webkit-progress-value { background: var(--accent-2); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--accent-2); }
.sidebar-job progress { height: 4px; background: #22394a; }
.sidebar-job progress::-webkit-progress-bar { background: #22394a; }
.job-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.job-stats div { background: var(--surface-2); border-radius: 7px; padding: 7px 9px; }
.job-stats strong { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.job-stats span { font-size: 11px; color: var(--muted); }
.job-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.job-log { display: grid; gap: 4px; margin-top: 8px; max-height: 220px; overflow: auto; font-size: 12px; color: var(--ink-2); }
.job-log small { color: var(--muted); margin-right: 6px; }
.history { display: grid; gap: 8px; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 8px; align-items: center; }
.history-item h3 { font-size: 13px; }
.history-item p { margin: 3px 0; color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
.history-side { display: grid; gap: 6px; justify-items: end; }
.badge.running, .badge.stopping { background: var(--accent-soft); color: var(--accent); }
.badge.completed { background: var(--ok-soft); color: var(--ok); }
.badge.paused, .badge.interrupted, .badge.partial { background: var(--warn-soft); color: var(--warn); }
.badge.blocked, .badge.failed { background: var(--danger-soft); color: var(--danger); }

/* Pricing & settings */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 650; padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.price-table input { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.price-table td:nth-child(2) { color: var(--muted); font-size: 12px; max-width: 320px; }
.price-table td:first-child { font-weight: 600; white-space: nowrap; }
.saving { color: var(--ok); font-weight: 650; font-size: 12px; white-space: nowrap; }
.pricing-extra { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin-top: 14px; }
.pricing-extra label { width: 200px; }
.source-note { margin: 14px 0 0; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .check-label { grid-column: 1 / -1; }
.rules p, .rules li { color: var(--ink-2); line-height: 1.6; }
.rules ul { padding-left: 18px; margin: 6px 0; }

/* Detail drawer */
dialog#detail { border: 0; padding: 0; margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(900px, 100vw); max-width: 100vw; background: var(--bg); box-shadow: -10px 0 40px rgb(10 30 45 / 22%); }
dialog#detail::backdrop { background: rgb(8 22 33 / 45%); }
.drawer { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100%; }
.drawer-head { background: var(--surface); padding: 14px 20px 12px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.drawer-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.drawer-top .tier { min-width: 60px; padding: 7px; }
.drawer-top .tier strong { font-size: 24px; }
.drawer-title h2 { font-size: 18px; line-height: 1.25; }
.drawer-title p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.drawer-tools { display: flex; gap: 4px; align-items: center; }
.contact-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-strip a, .contact-strip button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 7px; padding: 5px 10px; font-size: 12.5px; text-decoration: none; color: var(--ink-2); background: #fff; font-weight: 550; }
.contact-strip a:hover, .contact-strip button:hover { border-color: var(--accent-2); color: var(--accent); }
.contact-strip .main { background: var(--accent); color: #fff; border-color: var(--accent); }
.contact-strip .main:hover { color: #fff; background: #06685b; }
.status-quick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.status-quick select { width: auto; height: 30px; padding: 3px 8px; font-size: 12.5px; }
.tabs { display: flex; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 11px 12px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.drawer-body { overflow: auto; padding: 16px 20px 40px; display: grid; gap: 14px; align-content: start; }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.section > h3 { font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.breakdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.breakdown div { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.breakdown strong { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.gap-card { border: 1px solid var(--border-2); border-left: 4px solid #cfd9e2; border-radius: 8px; padding: 11px 13px; display: grid; gap: 7px; background: #fff; }
.gap-card.kesin { border-left-color: #e2683c; }
.gap-card.guclu { border-left-color: #e3a13b; }
.gap-card.olasi { border-left-color: #6b93d6; }
.gap-card.sor { border-left-color: #b8bcc6; }
.gap-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.gap-card-head h4 { font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gap-card p { margin: 0; color: var(--ink-2); }
.gap-meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sev { display: inline-flex; align-items: center; gap: 6px; }
.sev .track { width: 70px; height: 6px; }
.evidence { font-size: 12px; color: var(--muted); }
.evidence summary { cursor: pointer; }
.evidence p { margin: 5px 0 0; overflow-wrap: anywhere; }
.offer { display: grid; gap: 6px; }
.offer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.offer-row span:first-child { font-weight: 600; }
.offer-row .market { color: var(--muted); font-size: 12px; text-decoration: line-through; }
.offer-row .price { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; min-width: 80px; }
.offer-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 6px; gap: 10px; flex-wrap: wrap; }
.offer-total strong { font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.offer-note { font-size: 12px; color: var(--muted); }
.questions { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; }
.questions em { color: var(--muted); font-style: normal; }
.msg-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-fields { display: grid; gap: 9px; }
.msg-fields textarea { min-height: 300px; font-size: 13px; }
.msg-fields pre { margin: 0; white-space: pre-wrap; font: 12.5px/1.6 ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 12px; overflow-wrap: anywhere; }
.msg-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 7px; }
.quick-actions button { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; text-align: left; font-weight: 550; color: var(--ink-2); }
.quick-actions button:hover { border-color: var(--accent-2); background: var(--accent-soft); color: #05594e; }
.quick-actions button.neg:hover { border-color: #e6a2a5; background: var(--danger-soft); color: var(--danger); }
.crm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.crm-form .wide { grid-column: 1 / -1; }
.crm-form textarea { min-height: 90px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; grid-column: 1 / -1; flex-wrap: wrap; }
.quality { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: center; }
.score-ring { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 8px solid var(--border-2); text-align: center; }
.score-ring strong { font-size: 26px; display: block; line-height: 1; }
.score-ring small { font-size: 11px; color: var(--muted); }
.score-ring.good { border-color: #9edbb6; }
.score-ring.mid { border-color: #f1cf7c; }
.score-ring.bad { border-color: #f0a29a; }
.cat-bars { display: grid; gap: 6px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-size: 12.5px; }
.facts div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--border-2); padding: 4px 0; }
.facts span:first-child { color: var(--muted); }
.facts span:last-child { text-align: right; overflow-wrap: anywhere; }
.yes { color: var(--ok); font-weight: 650; }
.no { color: var(--danger); font-weight: 650; }
.notice { background: var(--warn-soft); color: #6b4a00; border: 1px solid #f0dc9b; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.notice.bad { background: var(--danger-soft); color: var(--danger); border-color: #f0c4c6; }
#f-show { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#f-show button { padding: 5px 2px; }
.worker-notice { margin-bottom: 14px; }
#toast { position: fixed; right: 22px; bottom: 22px; background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 9px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); box-shadow: 0 8px 26px rgb(0 0 0 / 22%); font-size: 13px; }

@media (max-width: 1360px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead { grid-template-columns: 22px 54px minmax(0, 1fr) minmax(0, 1.3fr) auto; row-gap: 8px; }
  .lead-meta { grid-column: 3 / 5; grid-row: 2; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .lead-status { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .lead-actions { grid-row: 1 / 3; grid-column: 5; display: grid; grid-template-columns: repeat(2, 32px); align-content: center; }
}
@media (max-width: 1050px) {
  .leads-layout, .scan-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-rail { display: none; position: static; max-height: none; }
  .filter-rail.open { display: block; }
  .filter-toggle { display: inline-flex; }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; top: 0; inset: auto; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; gap: 10px; overflow-x: auto; }
  .brand small, .brand > span { display: none; }
  nav { display: flex; gap: 2px; }
  .nav-item { padding: 8px 9px; font-size: 12.5px; white-space: nowrap; }
  .nav-item .nav-icon { display: none; }
  .sidebar-job { display: none; }
  .sidebar-user { margin: 0 0 0 auto; }
  .sidebar-user > span, .sidebar-user strong { display: none; }
  .shell { margin-left: 0; }
  .topbar { position: static; padding: 12px 16px; }
  .topbar p { display: none; }
  main { padding: 14px 16px 30px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .presets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .preset { white-space: nowrap; box-shadow: none; }
  .lead { grid-template-columns: 22px 50px minmax(0, 1fr); gap: 9px; }
  .lead-gaps-cell { grid-column: 1 / -1; }
  .lead-meta { grid-column: 1 / -1; grid-row: auto; }
  .lead-actions { grid-column: 1 / -1; grid-row: auto; display: flex; justify-content: flex-start; }
  .sort-field { flex: 1 1 100%; }
  .breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-form, .form-grid, .facts { grid-template-columns: minmax(0, 1fr); }
  .quality { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .cat-bars { width: 100%; }
  .drawer-top { grid-template-columns: auto minmax(0, 1fr); }
  .drawer-tools { grid-column: 1 / -1; justify-content: flex-end; order: -1; }
  .drawer-body { padding: 12px 12px 30px; }
  .funnel-row, .bar-row { grid-template-columns: 100px minmax(0, 1fr) 40px; }
  .job-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.inbox-list { display: grid; gap: 2px; max-height: calc(100vh - 210px); overflow: auto; }
.inbox-item { display: grid; gap: 2px; text-align: left; width: 100%; background: none; border: 0; border-radius: 8px; padding: 9px 8px; border-left: 3px solid transparent; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.on { background: var(--accent-soft); }
.inbox-item.unread { border-left-color: var(--accent); }
.inbox-item.unread .inbox-from { font-weight: 700; }
.inbox-row { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.inbox-from, .inbox-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.inbox-subject { color: var(--ink-2); font-size: 13px; }
.inbox-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.inbox-lead { font-size: 11px; color: var(--accent); font-weight: 600; }
.inbox-reader h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
.inbox-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 12px 14px; margin: 12px 0; max-height: 46vh; overflow: auto; font-size: 13px; line-height: 1.55; }
.inbox-reply { display: grid; gap: 8px; }
.inbox-reply textarea { width: 100%; min-height: 140px; }
.inbox-reply .msg-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 1050px) { .inbox { grid-template-columns: 1fr; } .inbox-list { max-height: 40vh; } }

/* LINE contact box in the chat draft */
.line-box { display: grid; gap: 6px; background: #f1fbf3; border: 1px solid #c9ead0; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.line-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; min-width: 0; }
.line-row > span { color: var(--muted); min-width: 72px; font-size: 12px; }
.line-row code, .line-row a { overflow-wrap: anywhere; min-width: 0; }
.line-row small { color: var(--muted); }
.line-box .subtle { margin: 2px 0 0; }

/* ---------- follow-ups ---------- */
.fu-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.fu-list { display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.fu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 6px; border-radius: 8px; }
.fu-row:hover { background: var(--surface-2); }
.fu-row > div { min-width: 0; display: grid; gap: 1px; }
.fu-row button[data-open] { background: none; border: 0; padding: 0; text-align: left; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-row small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.55; margin-top: 10px; }
.fu-off { color: #a4512b; font-weight: 600; }
@media (max-width: 1050px) { .fu-grid { grid-template-columns: 1fr; } }
