/* =====================================================================
   Lead Operations Console — refined dashboard theme
   ===================================================================== */
:root {
    --bg: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f7f8fb;
    --ink: #11161f;
    --ink-soft: #3a4456;
    --muted: #6b7689;
    --line: #e4e8ef;
    --line-strong: #d3d9e3;

    --accent: #4f46e5;
    --accent-2: #6366f1;
    --accent-press: #4338ca;
    --accent-soft: #eef0fe;
    --amber: #f59e0b;
    --amber-soft: #fef3e2;

    --ok: #16a34a;
    --ok-soft: #dcfce7;
    --warn: #d97706;
    --warn-soft: #fef3c7;
    --err: #e11d48;
    --err-soft: #ffe4ea;
    --info: #2563eb;
    --info-soft: #dbeafe;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(16, 22, 31, .06), 0 1px 3px rgba(16, 22, 31, .05);
    --shadow-md: 0 4px 14px rgba(16, 22, 31, .08), 0 2px 4px rgba(16, 22, 31, .04);
    --shadow-lg: 0 18px 50px rgba(16, 22, 31, .16);

    --font-display: 'Sora', ui-sans-serif, system-ui, sans-serif;
    --font-body: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;

    /* legacy aliases */
    --color-background: var(--bg);
    --color-surface: var(--surface);
    --color-text: var(--ink);
    --color-text-light: var(--muted);
    --color-border: var(--line);
    --color-primary: var(--accent);
    --color-primary-light: var(--accent-2);
    --color-success: var(--ok);
    --color-error: var(--err);
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app-container { flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Top app bar ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 500;
    padding: 16px 28px;
    color: #eaecf5;
    background:
        radial-gradient(120% 180% at 90% -40%, #3730a3 0%, rgba(55,48,163,0) 55%),
        linear-gradient(110deg, #0d1018 0%, #161b27 60%, #1b2030 100%);
    box-shadow: 0 1px 0 rgba(255,255,255,.05), var(--shadow-md);
}
header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%, #000 100%);
    mask-image: linear-gradient(90deg, transparent, #000 40%, #000 100%);
    pointer-events: none;
    opacity: .5;
}
header > * { position: relative; z-index: 1; }

h1 {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
}
.brand-logo {
    height: 32px;
    width: auto;
    display: block;
}
.h1-sub { font-weight: 600; font-size: 15px; color: #aeb6cc; letter-spacing: 0; }

nav { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
nav a {
    color: #d7dbe8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    transition: all .18s ease;
}
nav a:hover { background: rgba(255,255,255,.12); color: #fff; transform: translateY(-1px); }
.nav-leads { background: var(--accent) !important; border-color: transparent !important; color: #fff !important; }
.nav-leads:hover { background: var(--accent-press) !important; }

.tenant-box {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
}
.tenant-box label { margin: 0; color: #aeb6cc; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tenant-box select {
    padding: 5px 8px; border: 0; border-radius: 7px;
    background: rgba(255,255,255,.92); color: var(--ink);
    font-family: var(--font-body); font-weight: 600; font-size: 13px;
}
.mini-btn { padding: 6px 11px; font-size: 12px; font-weight: 700; background: var(--amber); color: #3a2a05; border: 0; border-radius: 999px; cursor: pointer; }
.mini-btn:hover { background: #fbbf24; }

/* ---------- Main layout (form deck on top, jobs below) ---------- */
main { flex: 1; display: flex; flex-direction: column; align-items: stretch; }

.sidebar { width: 100%; background: var(--bg); padding: 22px 30px; border-bottom: 1px solid var(--line); }
.content { flex: 1; padding: 26px 30px; overflow-y: auto; }

/* 3 equal-height columns */
.deck { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; align-items: stretch; }
.deck-form { display: contents; }   /* let the two form columns join the grid */
.col {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    min-width: 0;
}
.col-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin: 0; color: var(--ink); }
.col .form-group { margin-bottom: 0; }
.col-form button[type="submit"] { margin-top: auto; box-shadow: 0 8px 20px rgba(79,70,229,.28); }
.col-loc .map-box { flex: 1; min-height: 280px; margin: 0; }
.col-loc #map-clear { align-self: flex-start; }

/* active scan column */
.active-scan { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.active-district { font-family: var(--font-display); font-weight: 700; color: var(--accent-press); font-size: 15px; }
.active-map { width: 100%; display: flex; justify-content: center; }
.active-map .district-svg { width: 70%; max-width: 230px; height: auto; }
.col-active .scan-info { text-align: center; font-size: 13px; }
.active-empty { margin: auto; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.active-empty-icon { font-size: 40px; opacity: .6; }
.active-empty small { font-size: 12px; }

form { display: flex; flex-direction: column; gap: 18px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-family: var(--font-display); font-weight: 700; margin-bottom: 12px; color: var(--ink); font-size: 15px; }

.form-group { margin-bottom: 14px; }
label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }

input[type="text"], input[type="number"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
.text-muted, .muted { color: var(--muted); font-size: 12px; }
.text-muted p { margin: 4px 0; }

button, .button {
    font-family: var(--font-body);
    background: var(--accent); color: #fff; border: 0;
    padding: 11px 18px; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 14px; font-weight: 600; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: transform .12s ease, background .15s, box-shadow .15s, filter .15s;
}
button:hover, .button:hover { background: var(--accent-press); transform: translateY(-1px); }
button:active, .button:active { transform: translateY(0); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

form > button[type="submit"] { padding: 13px; font-size: 15px; font-weight: 700; box-shadow: 0 8px 20px rgba(79,70,229,.28); }

.download-button, .delete-button, .import-button, .call-button, .secondary-button, .danger-button {
    padding: 7px 13px; font-size: 12.5px; font-weight: 600; border-radius: 8px;
}
.download-button { background: var(--ok); }
.download-button:hover { background: #15803d; }
.import-button { background: var(--amber); color: #3a2a05; }
.import-button:hover { background: #fbbf24; }
.delete-button { background: var(--err-soft); color: var(--err); }
.delete-button:hover { background: #fecdd6; }
.secondary-button { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line-strong); }
.secondary-button:hover { background: #eceef3; }
.danger-button { background: var(--err); }
.danger-button:hover { background: #be123c; }
.call-button { background: var(--accent); }

.import-status { font-size: 12px; margin-left: 6px; }
.import-ok { color: var(--ok); font-weight: 700; }

.expandable-section { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.expandable-section > summary {
    cursor: pointer; padding: 13px 15px; background: var(--surface-2); color: var(--ink);
    font-family: var(--font-display); font-weight: 600; font-size: 14px; list-style: none;
    display: flex; align-items: center; justify-content: space-between;
}
.expandable-section > summary::after { content: "⌄"; color: var(--muted); font-size: 16px; transition: transform .2s; }
.expandable-section[open] > summary::after { transform: rotate(180deg); }
.expandable-section > summary::-webkit-details-marker { display: none; }
.expandable-section fieldset { padding: 15px; }

.map-box { height: 320px; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); margin: 10px 0; z-index: 0; }
.map-search-row { display: flex; gap: 8px; }
.map-search-row input { flex: 1; }
.map-search-row button { padding: 9px 15px; font-size: 13px; }
.district-info { margin-bottom: 10px; padding: 11px 13px; background: var(--accent-soft); border: 1px solid #dcdcfb; border-radius: var(--radius-sm); font-size: 13px; min-height: 20px; color: var(--ink-soft); }
.district-info b { color: var(--accent-press); }

/* ---------- Tables ---------- */
.content table, #leads-table, #preview-table, .leads-content table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
    font-family: var(--font-display); font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
    background: var(--surface-2); position: relative;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--accent-soft); }
.empty { text-align: center; color: var(--muted); padding: 40px; font-size: 14px; }
td.num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

.status-indicator { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.status-indicator::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-ok { background: var(--ok-soft); color: #166534; }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-working { background: var(--info-soft); color: var(--info); }
.status-working::before { animation: blink 1s steps(2,end) infinite; }
.status-failed, .status-error { background: var(--err-soft); color: var(--err); }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- Working job: district mini-map ---------- */
.job-id { font-size: 10px; color: #aab2c2; word-break: break-all; font-variant-numeric: tabular-nums; }
.job-district { font-family: var(--font-display); font-weight: 700; color: var(--accent-press); font-size: 13.5px; margin-top: 4px; }
.job-live { margin-top: 10px; }
.scan-live { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.district-svg { width: 88px; height: 88px; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(16,22,31,.12)); }
.scan-info { font-size: 12px; line-height: 1.4; }
.scan-info .task-current { color: var(--accent-press); font-weight: 700; }
.scan-info .tasks-summary { color: var(--muted); margin-top: 4px; }
.district-svg .band { opacity: .28; transition: opacity .3s; }
.district-svg .band-active { animation: bandPulse 1.1s ease-in-out infinite; }
@keyframes bandPulse { 0%,100% { opacity: .28; } 50% { opacity: .96; } }
.district-outline { fill: none; stroke: var(--accent-press); stroke-width: 1.3; }
.district-svg .band-label { font-size: 5px; font-weight: 700; fill: #0f172a; stroke: #fff; stroke-width: 1.1; paint-order: stroke; pointer-events: none; }

.spinner { display: none; }
.htmx-request .spinner, .spinner.htmx-request { display: block; width: 26px; height: 26px; margin: 8px auto; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-message { display: none; background: var(--err-soft); border: 1px solid #fbb6c4; color: var(--err); padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.error-message:not(:empty) { display: block; }

/* ---------- Leads (CRM) page ---------- */
.leads-main { padding: 26px 30px; display: flex; flex-direction: column; gap: 18px; }
.filters-bar { display: flex; flex-direction: row; flex-wrap: wrap; gap: 18px; align-items: flex-end; background: var(--surface); padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filter-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 0; }
.filter-group.grow { flex: 1; min-width: 200px; }
.filter-group.checkbox { flex-direction: row; align-items: center; gap: 7px; }
.filter-group label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 0; }
.filters-bar input[type="text"] { width: 100%; }
.filter-group.checkbox input, .filter-group.checkbox label { margin: 0; width: auto; }

.status-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.status-checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0; }
.status-checks input { width: auto; margin: 0; accent-color: var(--accent); }

.leads-content { overflow-x: auto; }
.lead-title { font-weight: 600; }
.title-toggle { cursor: pointer; font-weight: 700; user-select: none; color: var(--ink); }
.title-toggle:hover { color: var(--accent); }
.cat-pin { display: inline-block; margin-left: 8px; padding: 2px 9px; background: var(--accent-soft); color: var(--accent-press); border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.lead-extra { display: none; margin-top: 9px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-soft); }
.lead-extra.open { display: block; }
.lead-extra b { color: var(--ink); }
.lead-extra > div { margin: 3px 0; }
td.actions { white-space: nowrap; }
td.actions .delete-button { margin-left: 6px; }

.lead-status { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.lead-status-new { background: #eef0f4; color: #475066; }
.lead-status-no_answer, .lead-status-acmadi { background: var(--warn-soft); color: var(--warn); }
.lead-status-interested, .lead-status-ilgileniyor { background: var(--ok-soft); color: #166534; }
.lead-status-not_interested, .lead-status-ilgilenmiyor { background: var(--err-soft); color: var(--err); }
.lead-status-contacted, .lead-status-gorusuldu { background: var(--info-soft); color: var(--info); }

/* ---------- Call panel (drawer) ---------- */
.call-panel { position: fixed; top: 0; right: 0; height: 100vh; width: 400px; max-width: 92vw; background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto; z-index: 1000; border-left: 1px solid var(--line); animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.call-panel:empty { display: none; }
.call-panel-inner { padding: 22px; }
.call-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.call-panel-head h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.close-panel { background: var(--surface-2); color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 11px; border-radius: 8px; }
.close-panel:hover { background: #eceef3; color: var(--ink); transform: none; }
.call-panel-sub { color: var(--muted); font-size: 13px; margin: 8px 0 4px; }
.call-panel-inner h4 { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 8px; }
.call-history { list-style: none; padding: 0; margin: 0 0 12px; }
.call-history li { border-left: 3px solid var(--line-strong); padding: 9px 0 9px 12px; margin-bottom: 8px; font-size: 13px; }
.call-history .attempt { font-weight: 700; margin-right: 6px; }
.call-note { margin-top: 5px; color: var(--ink); background: var(--surface-2); padding: 7px 9px; border-radius: 7px; }
.call-form { display: flex; flex-direction: column; gap: 9px; }

/* ---------- Preview toolbar ---------- */
.preview-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 14px; position: sticky; top: 0; z-index: 5; }
.preview-toolbar label { margin: 0; display: flex; align-items: center; gap: 6px; }
.rowcb { width: auto; accent-color: var(--accent); }
#sel-count { font-family: var(--font-display); font-weight: 800; color: var(--accent-press); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    main { flex-direction: column; }
    .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
    .content { padding: 18px; }
    header { padding: 14px 18px; }
}

/* ===== Profil ayar (gear) ===== */
.gear-btn { text-decoration: none; color: #d7dbe8; font-size: 16px; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); line-height: 1; }
.gear-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ===== Tenant ayar formu ===== */
.settings-form { max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.settings-actions { display: flex; gap: 10px; }

/* ===== Canlı akış (feed) ===== */
.feed-wrap { margin-top: 4px; border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.feed-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.feed-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--line-strong); }
.feed { display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.feed-item {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12.5px;
    display: flex; flex-direction: column; gap: 1px;
    animation: feedIn .35s ease;
    transition: opacity .5s ease;
}
@keyframes feedIn { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); } }
.feed-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-phone { color: var(--muted); font-variant-numeric: tabular-nums; }

.stop-btn { margin-top: 10px; width: 100%; }

/* ===== Gruplu leads ===== */
.lead-group { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 14px; background: var(--surface); }
.lead-group > summary {
    cursor: pointer; list-style: none;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: var(--surface-2);
    font-family: var(--font-display); font-weight: 700;
}
.lead-group > summary::-webkit-details-marker { display: none; }
.lead-group > summary::after { content: "⌄"; margin-left: auto; color: var(--muted); font-size: 16px; transition: transform .2s; }
.lead-group[open] > summary::after { transform: rotate(180deg); }
.group-pin { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.group-pin.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.group-name { color: var(--ink); }
.group-progress { margin-left: 6px; font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--muted); }
.lead-group table { border: 0; border-radius: 0; box-shadow: none; }
.lead-group .empty { padding: 20px; }

/* ===== Lead kartları (4 sütun) ===== */
.leads-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.lead-card {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 16px; text-decoration: none; color: var(--ink);
    transition: transform .12s, box-shadow .15s, border-color .15s;
}
.lead-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.lead-card-head { display: flex; align-items: center; gap: 8px; }
.lead-card-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.lead-card-prog { font-size: 13px; color: var(--muted); }
.lead-card-prog b { color: var(--accent-press); font-size: 18px; font-family: var(--font-display); }
.lead-card-prog .of { color: var(--muted); }
.lead-card-bar { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.lead-card-bar .bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .4s; }
.lead-card-stats { display: flex; flex-wrap: wrap; gap: 5px; }
.cs { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.cs-gorusuldu { background: var(--info-soft); color: var(--info); }
.cs-ilgileniyor { background: var(--ok-soft); color: #166534; }
.cs-ilgilenmiyor { background: var(--err-soft); color: var(--err); }
.cs-acmadi { background: var(--warn-soft); color: var(--warn); }
.cs-new { background: #eef0f4; color: #475066; }

@media (max-width: 1100px) { .leads-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .leads-cards { grid-template-columns: 1fr; } }

/* ===== Grup dashboard ===== */
.stat-tiles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--line-strong); }
.stat-num { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-rev { border-top-color: var(--accent); }
.stat-new { border-top-color: #94a3b8; }
.stat-acmadi { border-top-color: var(--warn); }
.stat-ilgileniyor { border-top-color: var(--ok); }
.stat-ilgilenmiyor { border-top-color: var(--err); }
.stat-gorusuldu { border-top-color: var(--info); }
@media (max-width: 1100px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }

/* =====================================================================
   CYBERPUNK SKIN — sadece renk/efekt override; yapı/sınıflar değişmez
   ===================================================================== */
:root {
    --bg: #05060d;
    --surface: #0b1020;
    --surface-2: #0f1730;
    --ink: #d7f7ff;
    --ink-soft: #9fc7df;
    --muted: #6d86a6;
    --line: #1c2a4a;
    --line-strong: #2b4a73;

    --accent: #00e5ff;        /* neon cyan */
    --accent-2: #29f0ff;
    --accent-press: #00b3cc;
    --accent-soft: rgba(0,229,255,.14);
    --amber: #ffe14d;         /* neon yellow */
    --amber-soft: rgba(255,225,77,.14);

    --ok: #2bff9b;  --ok-soft: rgba(43,255,155,.14);
    --warn: #ffb347; --warn-soft: rgba(255,179,71,.14);
    --err: #ff3d7f;  --err-soft: rgba(255,61,127,.14);
    --info: #3ddcff; --info-soft: rgba(61,220,255,.14);

    --shadow-sm: 0 0 0 1px rgba(0,229,255,.04);
    --shadow-md: 0 0 18px rgba(0,229,255,.10);
    --shadow-lg: 0 0 50px rgba(0,229,255,.18);
}

body {
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(255,61,127,.10), transparent 60%),
        radial-gradient(1000px 500px at 0% 0%, rgba(0,229,255,.10), transparent 55%),
        var(--bg);
}
/* tarama çizgileri + ızgara dokusu */
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
    background:
        repeating-linear-gradient(0deg, rgba(0,229,255,.035) 0 1px, transparent 1px 3px);
    mix-blend-mode: overlay; opacity: .5;
}

/* başlık: neon */
header { border-bottom: 1px solid rgba(0,229,255,.25); box-shadow: 0 0 24px rgba(0,229,255,.12); }
h1 { text-shadow: 0 0 14px rgba(0,229,255,.55); }
.h1-sub { color: #ff6ad5; text-shadow: 0 0 10px rgba(255,61,127,.5); }
.col-title, legend, .feed-title, thead th { text-shadow: 0 0 10px rgba(0,229,255,.25); letter-spacing: .04em; }

/* kartlar / paneller: neon kenar + hafif glow */
.col, .lead-card, .stat, .filters-bar, .settings-form, .preview-toolbar, .lead-group,
.content table, #leads-table, .call-panel, .district-info, .error-message {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 1px rgba(0,229,255,.05), 0 6px 26px rgba(0,0,0,.5);
}
.lead-card:hover, .col:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(0,229,255,.28); }

/* butonlar: neon */
button, .button { box-shadow: 0 0 0 1px rgba(0,229,255,.25) inset, 0 0 12px rgba(0,229,255,.18); }
button:hover, .button:hover { box-shadow: 0 0 0 1px var(--accent) inset, 0 0 18px rgba(0,229,255,.5); }
.import-button { color: #1a1400; }
.import-button, .mini-btn { box-shadow: 0 0 12px rgba(255,225,77,.4); }
.danger-button { box-shadow: 0 0 12px rgba(255,61,127,.45); }
form > button[type="submit"], .col-form button[type="submit"] { box-shadow: 0 0 22px rgba(0,229,255,.5); }

/* inputlar */
input[type="text"], input[type="number"], textarea, select { background: #070c18; color: var(--ink); }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 2px var(--accent), 0 0 14px rgba(0,229,255,.4); }

/* durum rozetleri: neon-on-dark (açık metin renklerini ez) */
.status-ok { color: var(--ok); } .status-pending { color: var(--warn); }
.status-working { color: var(--info); } .status-failed, .status-error { color: var(--err); }
.lead-status-new { background: rgba(148,163,184,.16); color: #b9c7da; }
.lead-status-no_answer, .lead-status-acmadi { color: var(--warn); }
.lead-status-interested, .lead-status-ilgileniyor { color: var(--ok); }
.lead-status-not_interested, .lead-status-ilgilenmiyor { color: var(--err); }
.lead-status-contacted, .lead-status-gorusuldu { color: var(--info); }
.cs-new { background: rgba(148,163,184,.16); color: #b9c7da; }

/* tablo satır hover */
tbody tr:hover { background: rgba(0,229,255,.06); }
.clickable-row:hover { background: rgba(0,229,255,.10); }

/* aktif tarama / bulunan sayısı */
.active-district { text-shadow: 0 0 12px rgba(0,229,255,.5); }
.scan-found { margin-top: 8px; font-family: var(--font-display); font-weight: 700; color: var(--accent); text-shadow: 0 0 12px rgba(0,229,255,.5); }
.scan-found .found-num { font-size: 26px; }
.group-pin.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* harita kutusu neon çerçeve */
.map-box { border-color: var(--accent); box-shadow: 0 0 16px rgba(0,229,255,.25); }

/* =====================================================================
   Profil seçimi — cyberpunk skin --ink'i açık renge çevirdiği için
   .tenant-box select'in beyaz zemini metni görünmez yapıyordu.
   ===================================================================== */
.tenant-box select {
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line-strong);
}
.tenant-box select:hover { border-color: var(--accent); }

/* Açılan liste: option, çoğu tarayıcıda select'in renklerini miras almaz. */
select option,
.tenant-box select option {
    background: var(--surface-2);
    color: var(--ink);
}

/* =====================================================================
   Giriş ekranı
   ===================================================================== */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 34px 30px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgba(0,229,255,.06), 0 18px 50px rgba(0,0,0,.55);
}
.login-logo { width: 42px; height: auto; align-self: center; }
.login-title {
    margin: 0;
    text-align: center;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: var(--ink);
    text-shadow: 0 0 14px rgba(0,229,255,.55);
}
.login-sub { margin: 0 0 6px; text-align: center; color: var(--muted); font-size: 13px; }
.login-error {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--err-soft);
    border: 1px solid var(--err);
    color: var(--err);
    font-size: 13px;
    font-weight: 600;
}
.login-card .form-group { margin-bottom: 0; }
.login-submit { margin-top: 6px; width: 100%; justify-content: center; }

/* =====================================================================
   "Yalnızca web sitesi olmayanlar" filtresi
   ===================================================================== */
.filter-flag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--amber-soft);
    border: 1px solid var(--amber);
    color: var(--amber);
    font-size: 13px;
    font-weight: 600;
}
.filter-flag a { color: inherit; text-decoration: underline; }

.toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.toggle-row label { margin: 0; font-weight: 700; color: var(--ink); cursor: pointer; }
.toggle-row .toggle-hint { display: block; margin-top: 3px; font-weight: 500; font-size: 12px; color: var(--muted); }

/* Çıkış düğmesi — nav bağlantılarıyla aynı görünümde */
.logout-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    color: var(--ink-soft);
    cursor: pointer;
}
.logout-btn:hover { background: var(--err-soft); border-color: var(--err); color: var(--err); }
