/* ============================================================
   ZEYNEP · Satış Paneli — AÇIK TEMA (net, yüksek kontrast)
   Not: Bulanıklığa yol açan translateY animasyonları ve degrade
   sis katmanları TAMAMEN kaldırıldı. Sadece opacity geçişi var.
   ============================================================ */

:root {
  /* Zemin & yüzeyler */
  --bg:         #f5f7fa;   /* uygulama arka planı */
  --surface:    #ffffff;   /* kartlar, panel */
  --surface-2:  #eef1f6;   /* hover / input */
  --sidebar:    #ffffff;   /* kenar menü */
  --line:       #e4e8ef;
  --line-2:     #d3dae4;

  /* Metin */
  --text:       #0f1420;   /* neredeyse siyah — maksimum netlik */
  --muted:      #566072;
  --faint:      #8b95a6;

  /* Vurgu */
  --accent:     #2f6bff;   /* ana vurgu (net mavi) */
  --accent-2:   #1e4fd6;
  --gold:       #b8791a;   /* ikincil vurgu (koyu amber, beyazda okunur) */
  --teal:       #0d9488;

  /* Durumlar */
  --ok:   #16a34a;
  --warn: #d97706;
  --bad:  #e11d48;
  --info: #2f6bff;

  --r:    12px;
  --r-sm: 9px;
  --gap:  18px;
  --shadow:    0 1px 3px rgba(16,20,32,.08), 0 6px 20px -12px rgba(16,20,32,.15);
  --shadow-sm: 0 1px 2px rgba(16,20,32,.06);

  --font-head: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* KRİTİK: "hidden" (gizli) olan her şey gerçekten gizlensin.
   Aksi halde modal/giriş katmanı sayfanın üstünde kalıp
   hem puslu gösterir hem tıklamayı/yazmayı engeller. */
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 800; letter-spacing: -.01em; line-height: 1.15; color: var(--text); }
a { color: var(--accent); text-decoration: none; }
code { font-family: var(--font-mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--accent-2); font-size: .85em; }

/* ---------- Butonlar ---------- */
.btn {
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 16px; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  color: var(--text); background: var(--surface); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); background: var(--surface); }
.btn-danger { background: #fff; border-color: #f3c2cd; color: var(--bad); }
.btn-danger:hover { background: #fdecef; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- Giriş ekranı (şu an gizli) ---------- */
.login-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { position: relative; z-index: 2; width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px; box-shadow: var(--shadow); }
.login-bg { display: none; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login-brand h1 { font-size: 28px; letter-spacing: .03em; }
.login-brand p { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.login-spark { font-size: 24px; width: 50px; height: 50px; display: grid; place-items: center; background: var(--accent); color: #fff; border-radius: 13px; }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.login-form label { display:block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 600; margin-top: 12px; }
.login-form input { width: 100%; padding: 13px 15px; font-size: 15px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--text); }
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,255,.15); }
.login-form button { margin-top: 18px; }
.login-error { color: var(--bad); font-size: 13px; margin-top: 12px; text-align: center; }
.login-hint { margin-top: 20px; font-size: 12px; color: var(--faint); text-align: center; }

/* ============================================================
   DÜZEN
   ============================================================ */
.app { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.sidebar-brand strong { font-family: var(--font-head); font-size: 19px; letter-spacing: .04em; display: block; }
.sidebar-brand small { color: var(--faint); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; background: transparent; border: none; color: var(--muted);
  font-family: var(--font-body); font-size: 14.5px; font-weight: 600; padding: 11px 14px; border-radius: var(--r-sm);
  cursor: pointer; text-align: left; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: #eaf0ff; color: var(--accent-2); box-shadow: inset 3px 0 0 var(--accent); }
.nav-ico { font-size: 15px; color: var(--accent); width: 18px; text-align: center; }
.nav-item.active .nav-ico { color: var(--accent-2); }
.sidebar-foot { padding-top: 14px; border-top: 1px solid var(--line); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 26px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.top-title { font-family: var(--font-head); font-size: 21px; font-weight: 800; flex: 1; }
.top-actions { display: flex; gap: 8px; }
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }

.view-root { padding: 26px; }

/* ---------- Yardımcılar ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 23px; }
.section-head p.lead, .lead { color: var(--muted); font-size: 14px; margin-top: 4px; }
.grid { display: grid; gap: var(--gap); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); }
.pill { display:inline-flex; align-items:center; gap:6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill-gold { background: #fbf0dc; color: var(--gold); }
.pill-teal { background: #d7f2ef; color: var(--teal); }
.pill-muted { background: var(--surface-2); color: var(--muted); }
.tag { font-size: 12px; color: var(--muted); background: var(--surface-2); border:1px solid var(--line); padding: 3px 9px; border-radius: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }

/* ---------- KPI ---------- */
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-val { font-family: var(--font-head); font-size: 38px; font-weight: 800; line-height: 1; }
.kpi .kpi-lbl { color: var(--muted); font-size: 13px; margin-top: 8px; font-weight: 600; }
.kpi .kpi-ico { position: absolute; right: 16px; top: 14px; font-size: 28px; opacity: .12; }
.kpi.accent .kpi-val { color: var(--accent); }

.two-col { grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 1000px){ .two-col { grid-template-columns: 1fr; } }

/* ---------- Tablo ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type="search"], .toolbar select {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
  padding: 9px 12px; border-radius: var(--r-sm); font-family: var(--font-body); font-size: 14px;
}
.toolbar input[type="search"] { min-width: 220px; flex: 1; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; min-width: 900px; }
table.data th, table.data td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.data th { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }

.firma-cell { display: flex; align-items: center; gap: 12px; }
.firma-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: #eaf0ff; border: 1px solid var(--line-2); display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; color: var(--accent); font-size: 15px; }
.firma-name { font-weight: 700; }
.firma-sub { font-size: 12px; color: var(--faint); }

.badge { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.b-buyuk { background: #dcfce7; color: #15803d; }
.b-orta  { background: #fef3c7; color: #b45309; }
.b-kucuk { background: var(--surface-2); color: var(--muted); }

/* Müşteri segmenti rozetleri */
.seg { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-block; white-space: nowrap; }
.seg-kurumsal  { background: #e0ebff; color: #1e4fd6; }
.seg-teknoloji { background: #d7f2ef; color: #0f766e; }
.seg-eticaret  { background: #efe3fd; color: #7c3aed; }
.seg-belediye  { background: #dcfce7; color: #15803d; }
.seg-diger     { background: var(--surface-2); color: var(--muted); }
.skor { font-family: var(--font-head); font-weight: 800; font-size: 15px; }
.skor-kutu { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-block; }

.st { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; display: inline-block; }
.st-yeni     { background: var(--surface-2); color: var(--muted); }
.st-yazildi  { background: #e0ebff; color: #1e4fd6; }
.st-cevap    { background: #d7f2ef; color: #0f766e; }
.st-teklif   { background: #fbf0dc; color: #b45309; }
.st-kazanildi{ background: #dcfce7; color: #15803d; }
.st-kaybedildi{ background: #fde3e8; color: #be123c; }

.row-actions { display: flex; gap: 6px; }
.icon-btn { background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 14px; display: grid; place-items: center; transition: border-color .12s, color .12s; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Ürün / analiz ---------- */
.prod-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.prod-card { display: flex; flex-direction: column; gap: 12px; }
.prod-emoji { font-size: 32px; }
.prod-card h3 { font-size: 18px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.analiz-card h3 { font-size: 19px; display:flex; align-items:center; gap:10px; margin-bottom: 6px; }
.analiz-card .block { margin-top: 16px; }
.analiz-card .block h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 8px; }
.analiz-card ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.analiz-card li { display: flex; gap: 10px; font-size: 14px; color: var(--text); }
.analiz-card li::before { content: "▸"; color: var(--accent); }
.list-inline { display:flex; flex-wrap:wrap; gap: 8px; }

/* ---------- Mailler ---------- */
.mail-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.mail-card { display: flex; flex-direction: column; }
.mail-card .mail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mail-card h3 { font-size: 16px; }
.mail-body { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; font-size: 13.5px; color: var(--text); white-space: pre-wrap; font-family: var(--font-body); max-height: 260px; overflow: auto; flex: 1; }
.mail-body strong { color: var(--accent-2); }

/* ---------- Fiyat ---------- */
.calc-wrap { grid-template-columns: 360px 1fr; align-items: start; }
@media (max-width: 900px){ .calc-wrap { grid-template-columns: 1fr; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
.field input { width: 100%; padding: 12px 14px; font-size: 16px; font-family: var(--font-mono); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--text); }
.field input:focus { outline: none; border-color: var(--accent); }
.result-box { background: var(--surface); }
.result-row { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.result-row:last-child { border-bottom: none; }
.result-row .r-lbl { color: var(--muted); font-size: 14px; }
.result-row .r-val { font-family: var(--font-head); font-size: 28px; font-weight: 800; color: var(--accent); }
.result-note { font-size: 12.5px; color: var(--faint); margin-top: 4px; }

/* ---------- Ayarlar ---------- */
.settings-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(16,20,32,.45); overflow-y: auto; }
.modal { width: min(680px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); margin: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 19px; }
.modal-body { padding: 22px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 10px 12px; font-size: 14px; font-family: var(--font-body); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--text); }
.form-grid textarea { resize: vertical; min-height: 70px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--accent); }
@media (max-width: 560px){ .form-grid { grid-template-columns: 1fr; } }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--text); border: 1px solid var(--text); color: #fff; padding: 12px 22px; border-radius: 999px; z-index: 80; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); }

/* ---------- Satış Hattı (Kanban) ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-kol { flex: 0 0 270px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.kanban-bas { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.kanban-govde { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.kanban-kart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px; box-shadow: var(--shadow-sm); }
@media (max-width: 860px){ .kanban-kol { flex: 0 0 82vw; } }

.empty { text-align: center; padding: 56px 20px; color: var(--faint); }
.empty .big { font-size: 44px; margin-bottom: 12px; }

/* ---------- Yumuşak görünüm (kaydırma YOK, sadece opacity) ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.view-root { animation: fade .2s ease; }
.stagger > * { animation: fade .25s ease both; }

/* ---------- Mobil ---------- */
@media (max-width: 860px){
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 258px; transform: translateX(-110%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .two-col { grid-template-columns: 1fr; }
  .view-root { padding: 16px; }
  .toolbar input[type="search"], .toolbar select { width: 100%; flex: none; min-width: 0; }
  .section-head { align-items: flex-start; }

  /* Firma tablosu → mobilde kart görünümü (çok net, kolay) */
  .firmalar-tablo, .firmalar-tablo tbody, .firmalar-tablo tr, .firmalar-tablo td { display: block; width: 100%; }
  .firmalar-tablo thead { display: none; }
  .firmalar-tablo { min-width: 0; }
  .table-wrap { overflow: visible; border: none; background: transparent; }
  .firmalar-tablo tr { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; padding: 10px 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
  .firmalar-tablo td { border: none; padding: 8px 0; display: flex; justify-content: space-between; gap: 14px; align-items: center; font-size: 14px; }
  .firmalar-tablo td::before { content: attr(data-label); color: var(--faint); font-size: 12px; font-weight: 700; flex: none; }
  .firmalar-tablo td[data-label=""]::before { content: ""; }
  .firmalar-tablo td[data-label="Firma"] { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .firmalar-tablo .row-actions { justify-content: flex-end; }
  .firmalar-tablo .secKutu { width: 20px; height: 20px; }
  .modal { width: 100%; }
  .modal-body { max-height: 72vh; }
}
