/* ==============================================================================
   MÜŞTERİ BUL — B2B İhracat İstihbaratı ve Alıcı Keşif Motoru
   Arayüz Tasarım Sistemi: Kart Mimarisi, Belirgin Kenarlıklar & Yüksek Okunabilirlik
   ============================================================================== */

:root {
    color-scheme: light;

    /* Renk Paleti (Yüksek Kontrast & Profesyonel Tipografi) */
    --bg:           #f8fafc;        /* Slate 50 — yumuşak arka plan */
    --card-bg:      #ffffff;        /* Beyaz kart zemini */
    --surface:      #f1f5f9;        /* Slate 100 — hafif dolgular */
    --surface-2:    #e2e8f0;        /* Slate 200 — ara renkler */
    --fg:           #0f172a;        /* Slate 900 — kristal netliğinde başlık ve ana metin */
    --fg-body:      #334155;        /* Slate 700 — yüksek kontrastlı gövde metni */
    --muted:        #64748b;        /* Slate 500 — okunabilir ikincil/açıklama metinleri */
    
    /* Belirgin Kenarlıklar (Border'lı Öğeler) */
    --line:         #cbd5e1;        /* Slate 300 — kart ve kontrol kenarlıkları */
    --line-strong:  #94a3b8;        /* Slate 400 — vurgulu kenarlık */
    --line-focus:   #2563eb;        /* Blue 600 — odaklanma ve aktif kenarlık */
    
    /* Vurgu & Durum Renkleri */
    --accent:       #2563eb;        /* Blue 600 */
    --accent-dark:  #1d4ed8;        /* Blue 700 */
    --accent-bg:    #eff6ff;        /* Blue 50 */
    --ok:           #16a34a;        /* Green 600 */
    --ok-dark:      #15803d;        /* Green 700 */
    --ok-bg:        #f0fdf4;        /* Green 50 */
    --warn:         #d97706;        /* Amber 600 */
    --warn-bg:      #fffbeb;        /* Amber 50 */
    --fail:         #dc2626;        /* Red 600 */
    --fail-bg:      #fef2f2;        /* Red 50 */
    
    /* Geometri & Gölgeler */
    --radius:       10px;
    --radius-lg:    14px;
    --radius-full:  9999px;
    --shadow-sm:    0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow:       0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md:    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg-body);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ==============================================================================
   ÜST NAVİGASYON (HEADER)
   ============================================================================== */

header {
    background: #ffffff;
    border-bottom: 2px solid var(--line);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
header nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    max-width: 84rem;
    margin: 0 auto;
}
.brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--fg);
    text-decoration: none;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.brand-badge {
    background: var(--accent-bg);
    border: 1.5px solid var(--accent);
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    text-transform: uppercase;
}
.tagline {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}
header nav .spacer { flex: 1; }

header nav a:not(.brand):not(.btn-nav-primary) {
    color: var(--fg-body);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border: 1.5px solid transparent;
    border-radius: 8px;
    transition: all 0.15s ease;
}
header nav a:not(.brand):not(.btn-nav-primary):hover {
    background: var(--surface);
    border-color: var(--line);
    color: var(--fg);
}

.btn-nav-primary {
    background: var(--accent) !important;
    border: 2px solid var(--accent-dark) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    padding: 0.45rem 1rem !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(37,99,235,0.2) !important;
    transition: all 0.15s ease !important;
}
.btn-nav-primary:hover {
    background: var(--accent-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37,99,235,0.3) !important;
}

/* Global Veritabanı Araması */
.nav-search-container {
    position: relative;
    max-width: 340px;
    flex: 1;
}
.nav-search-input {
    width: 100%;
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
    border: 2px solid var(--line);
    border-radius: var(--radius-full);
    background: #ffffff;
    color: var(--fg);
    outline: none;
    transition: all 0.15s ease;
}
.nav-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
#nav-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
}
.search-results-dropdown {
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.search-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--surface);
    padding: 0.4rem 0.85rem;
    border-bottom: 1.5px solid var(--line);
}
.search-item {
    display: block;
    padding: 0.6rem 0.85rem;
    text-decoration: none;
    color: var(--fg);
    border-bottom: 1px solid var(--line);
    transition: background 0.15s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--accent-bg); }
.search-item .title { font-size: 0.9rem; font-weight: 700; display: block; }
.search-item .sub { font-size: 0.8rem; color: var(--muted); display: block; margin-top: 2px; }
.search-item.empty { font-size: 0.88rem; color: var(--muted); padding: 0.85rem; text-align: center; }

/* ==============================================================================
   ANA DÜZEN (LAYOUT & TYPOGRAPHY)
   ============================================================================== */

main {
    max-width: 84rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
}

h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--fg);
    margin: 0 0 0.4rem;
    letter-spacing: -0.03em;
}
h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fg);
    margin: 0 0 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.02em;
}
h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--fg);
    margin: 0 0 0.5rem;
}

a { color: var(--accent); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

.hint {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}

/* ==============================================================================
   KART MİMARİSİ (.card)
   ============================================================================== */

.card {
    background: var(--card-bg);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.card-header {
    background: #f8fafc;
    border-bottom: 1.5px solid var(--line);
    padding: 1rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.card-header h2, .card-header h3 {
    margin: 0;
    color: var(--fg);
}
.card-body {
    padding: 1.35rem;
}
.card-footer {
    background: #f8fafc;
    border-top: 1.5px solid var(--line);
    padding: 0.85rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ==============================================================================
   AYIRICI GEÇİŞLER (SECTION DIVIDERS & TRANSITIONS)
   ============================================================================== */

.step-divider {
    display: flex;
    align-items: center;
    margin: 2.25rem 0 1.25rem;
    gap: 1rem;
}
.step-divider::before, .step-divider::after {
    content: "";
    flex: 1;
    border-bottom: 2px dashed var(--line);
}
.step-badge {
    background: #ffffff;
    border: 2px solid var(--line);
    color: var(--fg);
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}
.step-badge .num {
    background: var(--accent);
    color: #ffffff;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ==============================================================================
   ÖZET VE İSTATİSTİK KARTLARI
   ============================================================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}
.stat {
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.stat:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.stat .value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--fg);
}
.stat .label {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.stat.good .value { color: var(--ok-dark); }
.stat.accent .value { color: var(--accent); }

/* ==============================================================================
   BUTONLAR VE TIKLANABİLİR KONTROLLER (BELİRGİN VE BORDER'LI)
   ============================================================================== */

button, .btn {
    font: inherit;
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

button:focus-visible, .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
}

/* Birincil Buton */
/* Biçimsiz gönder düğmeleri birincil (mavi) görünür; ama kendi sınıfı olanları EZMEMELİ:
   önceden bu kural .btn-danger ve .btn-secondary'den daha özgül olduğu için "Sil" ve
   "Durdur" düğmeleri de mavi görünüyordu. */
.btn-primary, button[type="submit"]:not(.secondary):not(.link):not(.btn-secondary):not(.btn-danger):not(.danger):not(.btn-tag):not(.user-menu-logout):not(.btn-clear) {
    background: var(--accent);
    border: 2px solid var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}
.btn-primary:hover, button[type="submit"]:not(.secondary):not(.link):not(.btn-secondary):not(.btn-danger):not(.danger):not(.btn-tag):not(.user-menu-logout):not(.btn-clear):hover {
    background: var(--accent-dark);
    border-color: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37,99,235,0.3);
}

/* İkincil Buton */
.btn-secondary, button.secondary {
    background: #ffffff;
    color: var(--fg);
    border: 2px solid var(--line);
}
.btn-secondary:hover, button.secondary:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent-dark);
}

/* Tehlikeli / Silme Butonu */
.btn-danger, button.danger {
    background: #ffffff;
    color: var(--fail);
    border: 2px solid #fca5a5;
}
.btn-danger:hover, button.danger:hover {
    background: var(--fail-bg);
    border-color: var(--fail);
}

/* Bağlantı Tarzı Buton */
button.link {
    background: none;
    border: none;
    color: var(--accent);
    padding: 0;
    text-decoration: underline;
    font-size: 0.88rem;
    cursor: pointer;
}

/* ==============================================================================
   ÜLKE HAPLARI (COUNTRY PILLS) — BELİRGİN & ÇOKLU SEÇİLEBİLİR
   ============================================================================== */

.country-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}
.pills-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--fg);
    margin-right: 0.25rem;
}
.country-pill {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--fg-body);
    user-select: none;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}
.country-pill input { display: none; }

.country-pill:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent-dark);
    transform: translateY(-1px);
}
.country-pill.active {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--accent);
}

/* ==============================================================================
   FİLTRELEME ÇUBUĞU (FILTER TOOLBAR)
   ============================================================================== */

.filter-toolbar {
    background: #f8fafc;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.filter-section-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.6rem;
}
.filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--fg);
    margin-right: 0.25rem;
}

.btn-filter {
    background: #ffffff;
    border: 2px solid var(--line);
    color: var(--fg-body);
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}
.btn-filter:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent-dark);
}
.btn-filter.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent-dark);
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(37,99,235,0.25);
}

/* Firma İnceleme Tag Butonları (Baktım, İlgilenmiyorum, Favori) */
.btn-tag {
    background: #ffffff;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn-tag:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent-dark);
}
.btn-tag.tag-reviewed {
    background: var(--ok-bg);
    border-color: var(--ok);
    color: var(--ok-dark);
    font-weight: 700;
}
.btn-tag.tag-dismissed {
    background: var(--surface);
    border-color: var(--line);
    color: var(--muted);
    text-decoration: line-through;
}
.btn-tag.tag-favorite {
    background: var(--warn-bg);
    border-color: var(--warn);
    color: #92400e;
    font-weight: 700;
}

/* ==============================================================================
   FORM ÖĞELERİ & GİRDİLER
   ============================================================================== */

.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
}
.field > label, label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--fg);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

input[type="text"], input[type="search"], input[type="password"], textarea, select {
    font: inherit;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--fg);
    width: 100%;
    font-size: 0.95rem;
    font-weight: 500;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus, input[type="search"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
select {
    cursor: pointer;
    font-weight: 600;
}

/* ==============================================================================
   TABLOLAR (.table-wrap & table)
   ============================================================================== */

.table-wrap {
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    margin: 1rem 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
thead th {
    background: #f8fafc;
    color: var(--fg);
    font-weight: 700;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--line);
    text-align: left;
    white-space: nowrap;
}
tbody td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: var(--fg-body);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }
tbody tr:nth-child(even) td { background: #fafbfc; }
tbody tr:nth-child(even):hover td { background: #f1f5f9; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.score {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

/* ==============================================================================
   ROZETLER VE ÇİPLER (BADGES & CHIPS)
   ============================================================================== */

.chip {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--line);
    color: var(--fg);
    border-radius: 6px;
    padding: 0.2rem 0.55rem;
    margin: 0.15rem 0.25rem 0.15rem 0;
    font-size: 0.85rem;
    font-weight: 600;
}
.chip.active {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.badge.ok, .badge.allowed {
    color: var(--ok-dark);
    background: var(--ok-bg);
    border-color: var(--ok);
}
.badge.fail, .badge.consent_required {
    color: var(--fail);
    background: var(--fail-bg);
    border-color: var(--fail);
}
.badge.warn {
    color: var(--warn);
    background: var(--warn-bg);
    border-color: var(--warn);
}
.badge.neutral, .badge.unknown {
    color: var(--fg-body);
    background: var(--surface);
    border-color: var(--line);
}

/* Uyarı Notları */
.note {
    background: #ffffff;
    border: 2px solid var(--line);
    border-left: 5px solid var(--accent);
    color: var(--fg-body);
    padding: 0.9rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.25rem 0;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
}
.warn-box {
    background: var(--warn-bg);
    border: 2px solid var(--warn);
    border-left-width: 5px;
    color: #92400e;
    padding: 0.9rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1rem 0;
    font-size: 0.92rem;
    font-weight: 500;
}

/* ==============================================================================
   YAPAY ZEKA VE ASİSTAN BİLEŞENLERİ
   ============================================================================== */

.ai-box {
    background: #ffffff;
    border: 2px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow);
}
.ai-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}
.ai-badge {
    background: #dbeafe;
    border: 1.5px solid #93c5fd;
    color: #1e40af;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}
.ai-body textarea {
    border: 2px solid #bfdbfe;
}
.ai-body textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.ai-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.ai-status {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent);
}

/* ==============================================================================
   HERO ARAMA MERKEZİ (HOME)
   ============================================================================== */

.hero-search-card {
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}
.hero-search-card h1 {
    font-size: 2.1rem;
    margin-bottom: 0.5rem;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--fg-body);
    margin: 0 0 1.5rem 0;
}
.hero-form .search-main-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.hero-input {
    flex: 1;
    font-size: 1.15rem !important;
    padding: 0.85rem 1.25rem !important;
    border: 2.5px solid var(--accent) !important;
    border-radius: 10px !important;
}
.hero-btn {
    font-size: 1.1rem !important;
    padding: 0.85rem 1.75rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

/* Toplu İşlem Çubuğu (Bulk Action Toolbar) */
.bulk-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(140%);
    background: #0f172a;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
    border: 2px solid #334155;
}
.bulk-action-bar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.bulk-count {
    font-weight: 700;
    font-size: 0.95rem;
    color: #93c5fd;
    white-space: nowrap;
}
.btn-bulk {
    background: #1e293b;
    color: #f8fafc;
    border: 1.5px solid #475569;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.btn-bulk:hover {
    background: #334155;
    border-color: #94a3b8;
    color: #ffffff;
}
.btn-bulk.btn-bulk-primary {
    background: var(--accent);
    border-color: var(--accent-dark);
}
.btn-bulk.btn-bulk-primary:hover {
    background: var(--accent-dark);
}

/* Alt Bilgi */
footer {
    border-top: 2px solid var(--line);
    padding: 1.5rem;
    text-align: center;
    color: var(--muted);
    background: #ffffff;
    margin-top: 4rem;
}

@media (max-width: 52rem) {
    main { padding: 1.25rem 0.85rem 3rem; }
    header nav { flex-wrap: wrap; gap: 0.75rem; }
    .hero-form .search-main-row { flex-direction: column; }
    .hero-btn { width: 100%; }
    .stats { grid-template-columns: 1fr 1fr; }
    table { font-size: 0.88rem; }
    .bulk-action-bar { left: 10px; right: 10px; transform: translateY(140%); width: auto; border-radius: 10px; }
    .bulk-action-bar.visible { transform: translateY(0); }
}

/* ==============================================================================
   "?" AÇIKLAMA KUTUSU (details.info)
   Müşteri "bu rakam neye göre" diye sordu: her sayının yanında kaynağı ve hesabı
   yazar. <details> olduğu için JS olmadan da açılır; konumlandırma js/info.js'te —
   tablo kapsayıcıları kaydırmalı (overflow) olduğu için kutu `fixed` konumlanır,
   yoksa tablonun kenarında kesilirdi.
   ============================================================================== */

details.info {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.3rem;
}

details.info > summary {
    list-style: none;
    cursor: pointer;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    color: var(--muted);
    background: var(--card-bg);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

details.info > summary::-webkit-details-marker { display: none; }

details.info > summary:hover,
details.info[open] > summary {
    border-color: var(--accent);
    color: var(--accent);
}

details.info > .info-body {
    position: fixed;
    z-index: 1000;
    width: min(360px, calc(100vw - 32px));
    background: var(--card-bg);
    border: 1.5px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    padding: 0.8rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--fg-body);
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
}

details.info > .info-body p { margin: 0 0 0.5rem 0; }
details.info > .info-body p:last-child { margin-bottom: 0; }
details.info > .info-body b { color: var(--fg); }
details.info > .info-body ul { margin: 0.25rem 0 0.5rem 1.1rem; padding: 0; }

.found-by {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.run-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--accent-dark);
}

/* ==============================================================================
   KULLANICI MENÜSÜ (üst çubuk) — profil ve yönetim paneli sunum ekranlarından
   ayrı dursun diye burada.
   ============================================================================== */

details.user-menu {
    position: relative;
}

details.user-menu > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

details.user-menu > summary::-webkit-details-marker { display: none; }

details.user-menu[open] > summary { border-color: var(--accent); }

.user-menu-body {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1000;
    min-width: 220px;
    background: var(--card-bg);
    border: 1.5px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    padding: 0.4rem 0;
    display: flex;
    flex-direction: column;
}

.user-menu-who {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem 0.6rem;
    border-bottom: 1.5px solid var(--line);
    margin-bottom: 0.3rem;
}

.user-menu-who small { color: var(--muted); }

.user-menu-body a {
    padding: 0.5rem 1rem;
    color: var(--fg);
    text-decoration: none;
}

.user-menu-body a:hover { background: var(--surface); }
/* Çıkış bir form düğmesi (POST + CSRF) ama menüdeki bağlantılar gibi görünür. */
.user-menu-logout {
    display: block; width: 100%; text-align: left; background: none; border: 0;
    font: inherit; color: var(--fg); cursor: pointer; padding: 0.5rem 1rem;
}
.user-menu-logout:hover { background: var(--surface); }

/* Gemini deneme düğmesi ve son denemenin durumu */
.gemini-try {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.gemini-try .badge { white-space: normal; text-align: left; }

/* Giriş ekranı: yalnızca ad soran sade kart. */
main.signin { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.signin-card { width: min(420px, 100%); }
.signin-card h1 { margin: 0 0 0.25rem; }
.signin-sub { margin: 0 0 1.25rem; color: var(--muted); }
.signin-label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.signin-btn { width: 100%; margin-top: 1rem; justify-content: center; padding: 0.7rem; font-size: 1rem; }

/* ==============================================================================
   SONUÇ SAYFASI — sonuçlar solda geniş, pazar ve tekrarlama sağda dar.
   Kullanıcı isteği: asıl önemli olan sonuç listesi; yana kaydırma anlaşılmıyor,
   liste büyük ve aşağı doğru kaydırılabilir olmalı.
   ============================================================================== */

main.wide { max-width: 118rem; }

.run-head { margin-bottom: 1rem; }
.run-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; margin-top: 0.35rem; }
.run-meta code { border: 1.5px solid var(--line); font-weight: 700; }
.run-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.run-actions form { display: inline; }
.run-actions .btn, .run-actions .select-inline { font-size: 0.88rem; padding: 0.45rem 0.85rem; }
.select-inline { width: auto; display: inline-block; }

.run-status { background: #ffffff; padding: 0.85rem 1.5rem; }
.run-status-line { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.run-note summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.run-note p { margin: 0.5rem 0 0; font-size: 0.88rem; max-width: 70rem; }

/* Tarama sürüyor kutusu */
.run-live { display: flex; gap: 0.9rem; align-items: center; padding: 0.75rem 1rem;
    background: var(--accent-bg); border: 2px solid var(--accent); border-radius: var(--radius); }
.run-live-title { font-weight: 800; color: var(--accent-dark); font-size: 1.05rem; }
.run-live-step { font-weight: 600; color: var(--fg); }
.run-live-hint { font-size: 0.82rem; color: var(--muted); }
.spinner { width: 26px; height: 26px; flex: none; border-radius: 50%;
    border: 3px solid rgba(37, 99, 235, 0.25); border-top-color: var(--accent);
    animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stats { margin-bottom: 1rem; }

.run-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
@media (max-width: 75rem) { .run-layout { grid-template-columns: 1fr; } }
.run-results { min-width: 0; }

/* Filtreler */
.filter-top { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.filter-top input[type="search"] { flex: 1; min-width: 260px; max-width: 520px; padding: 0.6rem 0.95rem; }
.filter-top-right { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.filter-top-right .btn { font-size: 0.88rem; padding: 0.45rem 0.85rem; }
.lead-counter { font-weight: 700; color: var(--fg); }
.btn-clear { background: #fff7ed; border: 2px solid #fdba74; color: #9a3412; font-weight: 700;
    border-radius: var(--radius-full); padding: 0.3rem 0.8rem; cursor: pointer; font-size: 0.84rem; }
.filter-groups { margin-top: 0.75rem; padding-top: 0.6rem; border-top: 1.5px dashed var(--line); }
.filter-label { min-width: 4.5rem; color: var(--muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.04em; }
.btn-filter .cnt { display: inline-block; min-width: 1.4em; padding: 0 0.4em; margin-left: 0.15rem;
    border-radius: var(--radius-full); background: var(--surface); color: var(--fg); font-size: 0.75rem; text-align: center; }
.btn-filter.active .cnt { background: rgba(255, 255, 255, 0.25); color: #ffffff; }

/* Aday listesi: dikey kaydırma, sabit başlık, yana kaydırma yok */
.leads-card { padding: 0; overflow: hidden; }
.leads-scroll { max-height: calc(100vh - 120px); min-height: 480px; overflow-y: scroll; overflow-x: hidden; }
/* Sabit düzen: genişlikler burada verilir, tablo konteynerden taşamaz (otomatik düzende
   son sütun kesiliyor, ülke sütunu "Alma-nya" diye bölünüyordu). */
#leadsTable { table-layout: fixed; width: 100%; }
#leadsTable thead th { position: sticky; top: 0; z-index: 2; white-space: normal; }
#leadsTable td { vertical-align: top; overflow-wrap: break-word; padding: 0.8rem 0.7rem; }
#leadsTable thead th { padding: 0.75rem 0.7rem; }
#leadsTable .col-check { width: 34px; text-align: center; }
#leadsTable .col-check input { width: 16px; height: 16px; cursor: pointer; }
#leadsTable .col-country { width: 140px; }
#leadsTable .col-score { width: 72px; text-align: center; }
#leadsTable .col-contact { width: 28%; }
#leadsTable .col-actions { width: 185px; }
.lead-name { font-weight: 700; font-size: 1.05rem; }
.lead-name a { color: var(--accent); }
.lead-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin-top: 0.3rem; }
.lead-badges .badge { font-size: 0.72rem; }
.lead-summary { margin: 0.35rem 0 0; font-size: 0.86rem; color: var(--fg-body); line-height: 1.4; }
.muted-line { display: block; color: var(--muted); font-size: 0.75rem; }
.badge.legal { display: inline-block; margin-top: 0.35rem; font-size: 0.72rem; white-space: normal; }
.score-value { font-size: 1.15rem; font-weight: 800; color: var(--accent); }
.contact-line { margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.contact-value { font-size: 0.86rem; font-weight: 600; }
.tag-wa { background: #dcfce7; color: #15803d; border-color: #86efac; }
.tag-mail { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.review-buttons { display: flex; gap: 0.25rem; flex-wrap: wrap; margin: 0.4rem 0; }
.btn-draft { font-size: 0.82rem; padding: 0.3rem 0.65rem; }
.no-match { text-align: center; padding: 2rem 1rem; color: var(--muted); font-weight: 600; }

/* Etiketlenen satır bir bakışta ayırt edilsin */
tr.status-FAVORITE td { background: #fffbeb; }
tr.status-REVIEWED td { background: #f0fdf4; }
tr.status-DISMISSED td { background: #f8fafc; opacity: 0.55; }
tr.status-FAVORITE .btn-tag[data-set="FAVORITE"],
tr.status-REVIEWED .btn-tag[data-set="REVIEWED"],
tr.status-DISMISSED .btn-tag[data-set="DISMISSED"] { background: var(--accent); color: #ffffff; border-color: var(--accent-dark); }

/* Sağ sütun */
.run-side { display: flex; flex-direction: column; gap: 1rem; }
.side-card { padding: 1rem 1.1rem; margin: 0; }
.side-title { font-weight: 800; color: var(--fg); margin-bottom: 0.6rem; }
.side-hint { font-size: 0.84rem; color: var(--muted); margin: 0 0 0.75rem; line-height: 1.45; }
.market-list { list-style: decimal; margin: 0; padding-left: 1.4rem; }
.market-list li { margin-bottom: 0.55rem; font-size: 0.88rem; }
.market-row { display: flex; justify-content: space-between; gap: 0.5rem; }
.market-name { font-weight: 700; color: var(--fg); }
.market-value { font-weight: 700; color: var(--ok-dark); white-space: nowrap; }
.market-bar { height: 5px; background: var(--surface); border-radius: 3px; margin-top: 0.2rem; }
.market-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.market-year { color: var(--muted); font-size: 0.7rem; }
.market-more summary { cursor: pointer; font-weight: 600; color: var(--accent); margin: 0.4rem 0; }
.schedule-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end; }
.schedule-form label { display: flex; flex-direction: column; font-size: 0.78rem; font-weight: 700; color: var(--muted); gap: 0.2rem; }
.schedule-form .select-inline { padding: 0.4rem 0.6rem; font-size: 0.88rem; }
.schedule-form .btn { width: 100%; font-size: 0.88rem; padding: 0.45rem 0.85rem; justify-content: center; }

/* Düğme stilleri display verdiği için hidden niteliği eziliyordu. */
[hidden] { display: none !important; }

/* Arama formunda yazarak ülke ekleme */
.country-picker { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.75rem; }
.country-picker-input { max-width: 340px; font-size: 0.92rem; }
.country-picker .btn { font-size: 0.85rem; padding: 0.45rem 0.85rem; }
.country-picker-msg { color: var(--ok-dark); font-weight: 600; }
.geo-input { max-width: 300px; padding: 0.4rem 0.75rem; font-size: 0.88rem; }
.filter-help { color: var(--muted); font-size: 0.78rem; flex-basis: 100%; padding-left: 4.9rem; }
.side-subtitle { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-dark); margin: 0.2rem 0 0.4rem; }
.market-chosen { list-style: none; padding-left: 0; }
.market-chosen li { background: var(--accent-bg); border: 1.5px solid var(--accent); border-radius: 8px; padding: 0.5rem 0.6rem; }
.error-reason { font-size: 1.05rem; font-weight: 600; color: var(--fg); background: #fff7ed; border: 2px solid #fdba74; border-radius: 8px; padding: 0.75rem 1rem; }
.error-facts { width: auto; margin: 0.75rem 0; font-size: 0.9rem; }
.error-facts th { text-align: left; padding: 0.25rem 1rem 0.25rem 0; color: var(--muted); font-weight: 700; background: none; border: none; text-transform: none; letter-spacing: 0; }
.error-facts td { padding: 0.25rem 0; border: none; }

/* Ana sayfa: yeni arama (internet) ile kayıtlı veride arama ayrı görünsün */
.mode-badge { display: inline-block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; border-radius: var(--radius-full); padding: 0.25rem 0.75rem; margin-bottom: 0.6rem; }
.mode-new { background: var(--accent-bg); color: var(--accent-dark); border: 1.5px solid var(--accent); }
.mode-local { background: #f0fdf4; color: var(--ok-dark); border: 1.5px solid #86efac; }
.local-search-card { margin-top: 1.25rem; padding: 1.5rem 2rem; border-left: 5px solid #22c55e; }
.local-search-card h2 { margin: 0 0 0.25rem; }
.local-search-input { font-size: 1.05rem; padding: 0.8rem 1rem; }
.local-search-results .search-results-dropdown { position: static; box-shadow: none; margin-top: 0.6rem; max-height: none; }
.run-live { justify-content: flex-start; }
.run-stop { margin-left: auto; white-space: nowrap; font-size: 0.88rem; padding: 0.45rem 0.85rem; }

/* ==============================================================================
   MOBİL (telefon, ≤ 52rem ≈ 830px)
   Kullanıcı (2026-10-06): "sonuç ekranı felaket, site linkleri taşıyor". Sabit
   genişlikli sütunlar (onay kutusu + ülke + skor + işlemler ≈ 430px) telefonda firma
   sütununa yer bırakmıyor, firma adı harf harf alt alta diziliyordu. Telefonda tablolar
   satır başına bir KART olur; masaüstü düzenine dokunulmaz.
   ============================================================================== */

/* Uzun site adresi, e-posta ve arama ifadesi her genişlikte kutusunu taşırmasın. */
.lead-name a, .contact-value, .found-by, .lead-summary, .run-note p { overflow-wrap: anywhere; }

@media (max-width: 52rem) {
    /* Üst çubuk: tek satıra sığmayan slogan gizlenir; bağlantılar küçülür. */
    header { padding: 0.6rem 0.85rem; }
    .tagline { display: none; }
    header nav { gap: 0.5rem 0.9rem; }
    header nav a, .user-menu summary { font-size: 0.92rem; }

    /* Uzun düğme ve rozet metinleri satıra sığmazsa alt satıra geçsin, ekranı taşırmasın. */
    .btn, .step-badge { white-space: normal; text-align: center; max-width: 100%; }
    h1 { font-size: 1.5rem; }

    /* --- Aday listesi (sonuç ekranı) --- */
    .leads-scroll { max-height: none; min-height: 0; overflow: visible; }
    #leadsTable, #leadsTable tbody { display: block; width: 100%; }
    #leadsTable thead { display: none; }
    #leadsTable tr.lead-row {
        display: grid;
        grid-template-columns: 26px minmax(0, 1fr) auto;
        gap: 0.35rem 0.6rem;
        padding: 0.9rem 0.85rem;
        border-bottom: 1px solid var(--line);
    }
    /* `display: grid` tarayıcının [hidden] kuralını ezer; filtrelenen kart yine gizlensin. */
    #leadsTable tr[hidden] { display: none !important; }
    #leadsTable td { display: block; width: auto !important; padding: 0; border: 0; background: transparent; }
    #leadsTable td.col-check { grid-column: 1; grid-row: 1; padding-top: 0.2rem; }
    #leadsTable td.col-company { grid-column: 2; grid-row: 1; }
    #leadsTable td.col-score { grid-column: 3; grid-row: 1; text-align: right; }
    #leadsTable td.col-country,
    #leadsTable td.col-contact,
    #leadsTable td.col-actions { grid-column: 2 / span 2; }
    #leadsTable td.col-country { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.5rem; }
    #leadsTable td.col-country .muted-line { display: inline; }
    #leadsTable td.col-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
    #leadsTable td.col-actions .review-buttons { margin: 0; }
    #leadsTable tr#noMatchRow { display: block; }
    /* Etiket rengi kartın tamamında (hücreler artık şeffaf). */
    tr.lead-row.status-FAVORITE { background: #fffbeb; }
    tr.lead-row.status-REVIEWED { background: #f0fdf4; }
    tr.lead-row.status-DISMISSED { background: #f8fafc; opacity: 0.55; }
    tr.lead-row.status-DISMISSED td { opacity: 1; }

    /* --- Diğer listeler (taramalar, son taramalar, ürünler): satır = kart --- */
    .table-wrap:has(table.table-cards) { overflow-x: visible; }
    table.table-cards thead { display: none; }
    table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
    table.table-cards tr { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
    table.table-cards td { border: 0; padding: 0.2rem 0; text-align: left !important; white-space: normal !important; }
    /* Hücrenin sütun başlığı üstünde küçük harflerle (js/table-cards.js yazar). İlk hücre
       kartın başlığıdır, etiketsiz; işlem düğmelerinin de etikete ihtiyacı yok. */
    table.table-cards td[data-label]:not(:first-child)::before {
        content: attr(data-label);
        display: block;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--muted);
        margin-bottom: 0.1rem;
    }
    table.table-cards td:last-child::before { display: none !important; }
    table.table-cards td:last-child > div, table.table-cards td:last-child form { margin-top: 0.3rem; }
    /* Taramanın künyesi (kaynak notları) telefonda uzun bir paragrafa dönüşüyor; ilk satırlar
       yeter, tamamı taramanın kendi sayfasında "Tarama özeti"nde. */
    table.table-cards td small {
        display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    }

    /* Taslak sayfası: hukuki durum rozeti metnin yanına sığmıyor, üstüne alınır. */
    .legal-head { flex-direction: column; align-items: flex-start !important; }
}

/* Telefondaki açılır zamanlama bölümü (run/detail.html); masaüstünde sağ sütundaki kutu yeter. */
.schedule-mobile { display: none; padding: 0; margin: 0 0 1rem; }
.schedule-mobile > summary {
    list-style: none; cursor: pointer; padding: 0.85rem 1rem; font-weight: 700; color: var(--fg);
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
}
.schedule-mobile > summary::-webkit-details-marker { display: none; }
.schedule-mobile > summary::after { content: "▾"; color: var(--muted); transition: transform 0.15s ease; }
.schedule-mobile[open] > summary::after { transform: rotate(180deg); }
.schedule-mobile-body { padding: 0 1rem 1rem; }
.schedule-mobile-body .side-card { border: 0; box-shadow: none; padding: 0; margin: 0; }
.schedule-mobile-body .side-title { display: none; }
@media (max-width: 52rem) {
    /* Telefonda zamanlama başlığın altında açılır bölüm; sağ sütundaki kopyası gizli.
       Bu blok yukarıdaki temel kuralın ARDINDA olmalı: aynı özgüllükte sonraki kural kazanır. */
    .schedule-mobile { display: block; }
    .schedule-side { display: none; }
}
