:root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --surface-2:      #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,0.10);
  --series-1:       #2a78d6;   /* blue - fiyat çizgisi */
  --series-1-wash:  rgba(42,120,214,0.10);
  --good:           #0ca30c;
  --warning:        #fab219;
  --serious:        #ec835a;
  --critical:       #d03b3b;
  --success-text:   #006300;

  /* v18: tasarım yenilemesi - "sade/minimal" hissi için köşe ve gölge
     ölçeği tek yerden yönetiliyor. Eskiden her kural kendi sayısını
     (8px/10px/14px, çeşitli box-shadow'lar) tekrar tekrar yazıyordu;
     artık tek bir ölçek var, bu da hem tutarlılığı hem de ileride tek
     satırdan ayarlanabilmeyi sağlıyor. Değerler eskisinden biraz daha
     büyük/yumuşak seçildi (10→12, 14→18) - daha "app" hissi veren,
     daha az köşeli bir görünüm için. Gölgeler de eskisinden daha
     hafif/yayvan - "düz/minimal" tasarımlarda gölge azlığı önemli. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.035);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.13);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --surface-2:      #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --baseline:       #383835;
    --border:         rgba(255,255,255,0.10);
    --series-1:       #3987e5;
    --series-1-wash:  rgba(57,135,229,0.14);
    --good:           #0ca30c;
    --warning:        #fab219;
    --serious:        #ec835a;
    --critical:       #e66767;
    --success-text:   #0ca30c;
  }
}

* { box-sizing: border-box; }

/* Tarayıcının yerleşik [hidden] davranışını HER ZAMAN önceliklendir.
   Aksi halde aynı öğeye class ile display:flex/grid verildiğinde,
   eşit CSS özgüllüğünde yazar (author) kuralı tarayıcı varsayılanını
   ezip öğeyi "hidden" olsa bile görünür bırakabiliyor. */
[hidden] { display: none !important; }

/* Form elemanları için tutarlı, "tasarımsız" görünmeyen taban stiller -
   GENEL (sadece modallar değil, hisse kartı içindeki formlar dahil HER YERDE
   geçerli) - aksi halde örn. bir kart içindeki tarih/seçim kutuları
   tarayıcının çıplak varsayılan görünümüyle kalır ve göze çok kötü batar. */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
  font-family: inherit;
  font-weight: 400;
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--series-1);
  box-shadow: 0 0 0 3px var(--series-1-wash);
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--series-1);
  cursor: pointer;
}
.fieldset-hint { margin: -4px 0 2px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--surface-2);
  color: var(--text-primary);
  /* v18: tasarım yenilemesi - daha sade/modern bir metin görünümü için
     hafif negatif harf aralığı ve daha yumuşak font çizimi. */
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

h1, h2, h3 { letter-spacing: -0.012em; }

.muted { color: var(--text-muted); font-size: 13px; }
.error-text { color: var(--critical); font-size: 13px; }
.success-text { color: var(--success-text); font-size: 13px; }
.hint { color: var(--text-muted); font-weight: 400; font-size: 12px; }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 { font-size: 20px; margin: 0; }
/* v24 düzeltmesi: bazı sayfalarda (örn. reset_password.php) .login-card bir
   <div>, içindeki <form> AYRI bir kutu - bu durumda <input>lar flex-stretch
   kazanamıyor, tarayıcı varsayılanı olan ~200px genişlikte kalıp yer
   yetmeyince placeholder metni ortasından kesiliyor. "display:contents" ile
   form kendi kutusunu oluşturmadan içindekileri doğrudan .login-card'ın flex
   öğesi yapıyor - loginForm/registerForm'da (.login-card doğrudan <form>
   üzerinde) zaten bu sorun yoktu, bu kural sadece iç içe form durumunu
   aynı davranışa getiriyor. */
.login-card form { display: contents; }
.login-card input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 14px;
}

/* v17: "Kayıt ol" / "Giriş yap" ekranları arası geçiş linki */
.login-switch-link {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 12.5px;
  color: var(--series-1);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.login-switch-link:hover { text-decoration: underline; }

/* v17: bot tuzağı (honeypot) - ekrandan tamamen gizli ama ekran okuyucudan
   da (görsel engelli kullanıcılar botlar gibi doldurmasın diye) gizli
   tutmak için klasik "off-screen" tekniği (display:none kullanmıyoruz,
   bazı botlar onu algılayıp atlıyor). */
.hp-field {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  text-decoration: none; /* v24 düzeltmesi: .btn bir <a> üzerinde kullanılınca (örn.
    verify_email.php/reset_password.php "Portföylerim'e git") tarayıcı varsayılanı
    olan alt çizgi hiç istenmiyordu, sadece unutulmuştu. */
  transition: box-shadow 0.15s ease, transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); border-color: color-mix(in srgb, var(--series-1) 35%, var(--border)); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(11, 11, 11, 0.08); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--series-1-wash); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon { font-weight: 800; font-size: 14px; line-height: 1; }

.btn-primary {
  background: var(--series-1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(42, 120, 214, 0.35);
}
.btn-primary:hover { background: color-mix(in srgb, var(--series-1) 88%, black); box-shadow: 0 6px 18px rgba(42, 120, 214, 0.28); }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.btn-danger { background: transparent; color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }
.btn-danger:hover { background: color-mix(in srgb, var(--critical) 10%, transparent); border-color: var(--critical); }

.btn-block { width: 100%; padding: 12px 14px; font-size: 14px; }

/* v17/v18: Premium üyelik - altın/amber vurgu (mevcut --warning tokenını
   kullanıyoruz, yeni bir renk tanımlamak yerine). v18'de tasarım
   yenilemesiyle birlikte düz renk yerine hafif bir degrade + parlaklık
   eklendi - "ayrıcalıklı/değerli" hissi vermesi için (satın alma
   motivasyonunu güçlendirmek amacıyla, aşırıya kaçmadan). */
.btn-premium {
  background: linear-gradient(135deg, #ffcf4d, var(--warning));
  color: #1a1400;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(250, 178, 25, 0.35);
}
.btn-premium:hover {
  background: linear-gradient(135deg, #ffd767, color-mix(in srgb, var(--warning) 85%, black));
  box-shadow: 0 6px 18px rgba(250, 178, 25, 0.32);
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #7a5b00;
  background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 30%, transparent), color-mix(in srgb, var(--warning) 16%, transparent));
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.premium-badge:hover { border-color: var(--warning); }
@media (prefers-color-scheme: dark) {
  .premium-badge { color: var(--warning); }
}

.premium-req-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--critical);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.premium-lock-hint {
  color: #7a5b00;
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
@media (prefers-color-scheme: dark) {
  .premium-lock-hint { color: var(--warning); }
}

.premium-plan-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.premium-plan-card {
  flex: 1 1 140px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  background: var(--surface-2);
  text-align: left;
}
.premium-plan-card:hover { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
.premium-plan-card.active {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 25%, transparent);
}
.premium-plan-card .plan-label { display: block; font-weight: 700; font-size: 13.5px; }
.premium-plan-card .plan-price { display: block; font-size: 18px; font-weight: 800; margin-top: 2px; }

.premium-iban-box {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}

/* v17: reklam alanı - içi boşken (AdSense yapılandırılmamışken) [hidden]
   ile tamamen gizli, yapılandırılınca market.js açar. */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ad-slot-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* v19: kendi sitelerine (discoverpamukkale.com, apollongardenhotel.com vb.)
   link veren tanıtım kartları - anasayfa, Halka Arzlar ve Portföylerim'de
   aynı görünümle kullanılıyor. Premium üyeler bunları HİÇ görmez (bkz.
   api.php > public_promo_ads - gizleme sunucu tarafında yapılıyor). */
.promo-ad-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.promo-ad-card {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.promo-ad-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-color: color-mix(in srgb, var(--series-1) 35%, var(--border));
}
.promo-ad-card:active { transform: translateY(1px); }

/* v23 (Faz 5a): dashboard üstünde, e-posta henüz doğrulanmadıysa gösterilen
   bilgilendirme şeridi - kullanımı engellemez, sadece bildirimlerin neden
   gitmediğini açıklar. */
.verify-email-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  font-size: 13px;
  color: var(--text-primary);
}
.verify-email-banner span:first-child { flex: 1 1 260px; }
.verify-email-banner .hint { margin: 0; }
.promo-ad-image {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--surface-2);
}
.promo-ad-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.promo-ad-tag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.promo-ad-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.promo-ad-desc {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.promo-ad-cta {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--series-1);
  white-space: nowrap;
}

/* ---- Admin: Reklamları Yönet ---- */
.promo-ad-admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.promo-ad-admin-row.disabled { opacity: 0.55; }
.promo-ad-admin-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.promo-ad-admin-title { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-ad-admin-link { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-ad-admin-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.promo-ad-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gridline);
}

.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-icon-only {
  padding: 0;
  width: 38px;
  height: 38px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar-title { display: flex; flex-direction: column; gap: 2px; }
.topbar-title h1 { font-size: 18px; margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* v29: üst başlıktaki metin yerine site logosu (bistakipaneli.com). Görsel
   şeffaf arka planlı - hem açık hem koyu temada sorunsuz oturur. */
.topbar-logo-link { display: inline-flex; align-items: center; line-height: 0; }
.topbar-logo { height: 26px; width: auto; display: block; }

.ipo-header-btn { display: inline-flex; align-items: center; gap: 6px; }

.alert-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.alert-bell-btn:hover { color: var(--text-primary); background: var(--surface-1); border-color: var(--text-muted); }
.alert-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--critical);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 2px solid var(--surface-1);
}
.alert-bell-btn.has-new {
  color: var(--critical);
  border-color: var(--critical);
  animation: bell-ring-pulse 1s ease-in-out infinite;
}
@keyframes bell-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(208, 59, 59, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(208, 59, 59, 0); }
}
.alert-bell-btn.has-new svg { animation: bell-shake 1.6s ease-in-out infinite; }
@keyframes bell-shake {
  0%, 80%, 100% { transform: rotate(0deg); }
  82% { transform: rotate(-12deg); }
  85% { transform: rotate(10deg); }
  88% { transform: rotate(-8deg); }
  91% { transform: rotate(6deg); }
  94% { transform: rotate(-3deg); }
  97% { transform: rotate(0deg); }
}

.toast-container {
  position: fixed;
  top: 83px;
  right: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
@media (max-width: 560px) {
  .toast-container { top: 131px; right: 12px; left: 12px; max-width: none; }
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--critical);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 12px 14px;
  cursor: pointer;
  animation: toast-in 0.2s ease;
}
.toast:hover { background: var(--surface-2); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin: 0 0 2px; }
.toast-message { font-size: 12px; color: var(--text-secondary); margin: 0; }
.toast-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); }

.user-menu { position: relative; margin-left: 4px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.user-chip:hover { background: color-mix(in srgb, var(--series-1) 6%, var(--surface-2)); }
.user-chip[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--series-1) 45%, var(--border));
  box-shadow: 0 0 0 3px var(--series-1-wash);
}
.user-chip-avatar {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--series-1);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.user-chip-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-chevron { flex-shrink: 0; color: var(--text-muted); transition: transform 0.15s ease; }
.user-chip[aria-expanded="true"] .user-chip-chevron { transform: rotate(180deg); }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.user-menu-item:hover { background: var(--surface-2); }
.user-menu-item svg { flex-shrink: 0; color: var(--text-muted); }
.user-menu-item-danger { color: var(--critical); }
.user-menu-item-danger svg { color: var(--critical); }
.user-menu-item-danger:hover { background: color-mix(in srgb, var(--critical) 10%, transparent); }
.user-menu-divider { height: 1px; background: var(--gridline); margin: 4px 2px; }

.content { padding: 28px 28px 64px; max-width: 1200px; margin: 0 auto; }

/* ---------------- Portfolio summary ---------------- */
.summary-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.summary-note { width: 100%; margin: 0; }
.stat-tile-lg {
  flex: 1;
  min-width: 180px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  gap: 6px;
}
.stat-tile-lg .stat-label { font-size: 12px; }
.stat-tile-lg .stat-value { font-size: 22px; }

/* ---------------- Stock list / expandable rows ---------------- */
.stocks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 32px;
  align-items: start;
}
@media (min-width: 860px) {
  /* Geniş ekranlarda 2 hisseyi aynı anda, yan yana görebilesin diye */
  .stocks-grid { grid-template-columns: 1fr 1fr; }
}

.stock-row {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, opacity 0.15s ease;
}
.stock-row:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); }
.stock-row.inactive { opacity: 0.5; }

.stock-row-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.stock-row-header:hover { background: var(--surface-2); }
.stock-row.expanded .stock-row-header { background: var(--surface-2); }

.stock-avatar {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--series-1-wash);
  color: var(--series-1);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  overflow: hidden;
}
/* Logo denemesi başarılı olursa baş harflerin ÜSTÜNÜ kaplar; onerror'da
   JS tarafından kaldırılır ve alttaki baş harfler otomatik görünür - bu
   yüzden kırık görsel ikonu hiç görünmez. */
.stock-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-1);
}
.stock-avatar-sm { width: 28px; height: 28px; font-size: 10px; }

.stock-id-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stock-symbol { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-name { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stock-price-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.stock-price { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.stock-change-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.stock-change-pill.up   { color: var(--success-text); background: color-mix(in srgb, var(--good) 14%, transparent); }
.stock-change-pill.down { color: var(--critical);     background: color-mix(in srgb, var(--critical) 14%, transparent); }
.stock-change-pill.flat { color: var(--text-muted);   background: var(--surface-2); }

.chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 2px;
}
.stock-row.expanded .chevron { transform: rotate(-135deg); }

.stock-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 16px;
  border-top: 1px solid transparent;
  transition: max-height 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
}
.stock-row.expanded .stock-detail {
  max-height: 1400px;
  opacity: 1;
  padding: 4px 16px 16px;
  border-top-color: var(--gridline);
}

.detail-heading {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pnl-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.stat-label { font-size: 11px; color: var(--text-muted); }
.stat-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-value.up   { color: var(--success-text); }
.stat-value.down { color: var(--critical); }
.stat-value.flat { color: var(--text-muted); }

.stat-tile-row { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-tile-row .stat-tile { flex: 1; min-width: 140px; }

.dividend-total-badge { font-size: 10px; }

.dividend-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dividend-toolbar .hint { margin: 0; }
.dividend-refresh-btn svg { transition: transform 0.4s ease; }
.dividend-refresh-btn.is-syncing svg { animation: dividend-spin 0.8s linear infinite; }
@keyframes dividend-spin { to { transform: rotate(360deg); } }

.dividend-wrap { margin-top: 10px; }
.dividend-scroll-wrap { max-height: 220px; overflow-y: auto; margin: 4px 0; }
.dividend-list { display: flex; flex-direction: column; gap: 6px; }
.dividend-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--baseline);
}
.dividend-item-row.is-auto { border-left-color: var(--series-1); }
.dividend-item-row.is-manual { border-left-color: var(--text-muted); }
.dividend-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dividend-item-side { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dividend-source-badge { font-size: 10px; }
.dividend-source-badge.auto { color: var(--series-1); border-color: color-mix(in srgb, var(--series-1) 45%, var(--border)); }
.dividend-item-row .dividend-delete-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 2px; flex-shrink: 0; }
.dividend-item-row .dividend-delete-btn:hover { color: var(--critical); }

.dividend-manual-toggle-btn { align-self: flex-start; margin-top: 8px; }
.dividend-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.dividend-add-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------------- Halka Arzlar ---------------- */
.ipo-sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.ipo-group-title {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}
#addIpoBtn { margin-top: 2px; align-self: flex-start; }

.ipo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
@media (min-width: 620px) {
  .ipo-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

/* Midas benzeri kompakt kart: dar dikey boşluk, sol kenarda durum
   rengini gösteren ince bir şerit, fiyat öne çıkan bir başlık satırı,
   geri kalan bilgiler küçük "chip"ler halinde - eski büyük stat-tile
   kutuları yerine tek satıra sığan bir özet. */
.ipo-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--baseline);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ipo-card:has(.ipo-status-pill.up) { border-left-color: var(--good); }
.ipo-card:has(.ipo-status-pill.down) { border-left-color: var(--critical); }

.ipo-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.ipo-card-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ipo-company-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 165px;
}
.ipo-symbol-badge { background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary); font-size: 10px; padding: 1px 7px; }
.ipo-sector { margin: -2px 0 0; font-size: 11px; }

.ipo-status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ipo-status-pill.up { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.ipo-status-pill.down { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical); }
.ipo-status-pill.flat { background: var(--surface-1); border: 1px solid var(--border); color: var(--text-muted); }

.ipo-headline-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.ipo-price-value {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.ipo-price-value small { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.ipo-date-chip { font-size: 12px; color: var(--text-secondary); }

/* v28: eskiden kaynak sayfanın TÜM ham metnini ("Tüm detayları göster")
   kartın içinde döken bir alan vardı - kullanıcı bunun "bir ton gereksiz
   bilgi, farklı yerlerin reklamını yapıyor" olduğunu belirtti (kaynak
   site taraması menü/footer/başka ilanlar dahil HER ŞEYİ metne çeviriyor).
   Onun yerine artık sadece GERÇEKTEN bildiğimiz, yapılandırılmış alanlar
   (fiyat, arz büyüklüğü, pazar, tarihler vb.) tek, temiz bir kutuda -
   kullanıcının referans gösterdiği görseldeki gibi - satır satır
   listeleniyor. Ham metin dökümü tamamen kaldırıldı; tam kaynağı görmek
   isteyen "Kaynak ↗" linkine tıklar. */
.ipo-fact-box {
  border: 1px solid color-mix(in srgb, var(--series-1) 35%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--series-1) 5%, var(--surface-1));
  overflow: hidden;
}
.ipo-fact-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.4;
}
.ipo-fact-row + .ipo-fact-row { border-top: 1px solid color-mix(in srgb, var(--series-1) 16%, var(--border)); }
.ipo-fact-label { color: var(--text-muted); flex: 0 0 auto; white-space: nowrap; }
.ipo-fact-value { color: var(--text-primary); font-weight: 600; text-align: right; overflow-wrap: break-word; word-break: break-word; }

.ipo-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--surface-1);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
}
.ipo-note strong { color: var(--text-primary); }

.ipo-source-link { font-size: 11px; color: var(--series-1); text-decoration: none; }
.ipo-source-link:hover { text-decoration: underline; }

.ipo-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.ipo-card-actions { display: flex; justify-content: flex-end; gap: 6px; }
.ipo-card-actions .btn-sm { padding: 4px 8px; font-size: 11px; }

.tx-row-actions { display: flex; justify-content: flex-end; }
.tx-delete-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 2px; }
.tx-delete-btn:hover { color: var(--critical); }

.pw-fieldset { gap: 0; }
.fieldset-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
.fieldset-toggle-btn:hover { color: var(--series-1); }
.fieldset-toggle-btn .panel-toggle-chevron { color: var(--text-muted); flex-shrink: 0; transition: transform 0.15s ease; }
.fieldset-toggle-btn[aria-expanded="true"] .panel-toggle-chevron { transform: rotate(180deg); }
.pw-change-wrap { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.stock-meta { font-size: 12px; color: var(--text-muted); }
.stock-chart-wrap { height: 160px; position: relative; }
.stock-chart-wrap.loading { opacity: 0.4; }

.range-row { display: flex; gap: 4px; }
.range-btn {
  flex: 1;
  padding: 5px 0;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.range-btn:hover { background: var(--surface-2); }
.range-btn.active { background: var(--series-1); color: #fff; border-color: transparent; }

/* ---- Analiz modalı (portföy analitiği) ---- */
.analytics-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.analytics-section:first-of-type { margin-top: 10px; padding-top: 0; border-top: none; }
.analytics-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.range-btn-row { display: flex; gap: 4px; flex-wrap: wrap; max-width: 340px; }
.range-btn-row .range-btn { flex: 0 0 auto; padding: 5px 10px; }
.analytics-chart-wrap { height: 260px; position: relative; margin-top: 10px; }
.analytics-chart-wrap.loading { opacity: 0.4; }
.analytics-chart-wrap-sm { height: 220px; max-width: 420px; margin: 10px auto 0; }
.analytics-export-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.stock-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--gridline);
}
.stock-card-actions .btn-edit { padding: 7px 14px; font-size: 12px; }
.stock-card-actions .btn-edit svg { color: var(--text-muted); }
.stock-card-actions .btn-edit:hover svg { color: var(--series-1); }

.news-section { display: flex; flex-direction: column; }
.news-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
.news-toggle-header:hover .detail-heading { color: var(--series-1); }
.news-toggle-header .panel-toggle-chevron { color: var(--text-muted); flex-shrink: 0; transition: transform 0.15s ease; }
.news-toggle-header[aria-expanded="true"] .panel-toggle-chevron { transform: rotate(180deg); }

.news-list-wrap {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
}
.news-list { display: flex; flex-direction: column; gap: 2px; }
.news-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
}
.news-item:hover { background: var(--surface-2); }
.news-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-meta { font-size: 11px; color: var(--text-muted); }

.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ---------------- Panel / table ---------------- */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 16px;
}
.panel h2 { margin-top: 0; font-size: 16px; font-weight: 700; }

.panel-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
.panel-toggle-header h2 { display: flex; align-items: center; }
.panel-toggle-header:hover h2 { color: var(--series-1); }
.panel-toggle-chevron { color: var(--text-muted); flex-shrink: 0; transition: transform 0.15s ease; }
.panel-toggle-header[aria-expanded="true"] .panel-toggle-chevron { transform: rotate(180deg); }

.alerts-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
}

#alertsTableWrap {
  margin-top: 16px;
  max-height: 420px;
  overflow-y: auto;
}
#alertsTableWrap thead th {
  position: sticky;
  top: 0;
  background: var(--surface-1);
  z-index: 1;
}
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gridline);
  white-space: nowrap;
}
th { color: var(--text-muted); font-weight: 600; font-size: 12px; }
td.wrap { white-space: normal; }
.alert-msg-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}
@media (max-width: 560px) {
  .alert-msg-cell { max-width: 160px; }
}
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: var(--surface-2); }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 20;
}
.modal-card {
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-card-lg { max-width: 900px; }
.modal-card h2 { margin: 0; font-size: 17px; }
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.stock-symbol-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-top: -6px;
}
.stock-symbol-preview-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stock-symbol-preview-name { font-size: 13px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-symbol-preview-price { font-size: 12px; color: var(--text-secondary); }
.settings-test-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.settings-test-row .hint { font-size: 12px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
legend label { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 8px; }

/* v22 (Faz 4): Hisse karşılaştırma - seçilebilir hisse "çip" listesi.
   .range-btn ile aynı görsel dil (boş=transparan çerçeveli, seçili=dolu
   renk) - checkbox'ın kendisi görsel olarak gizlenir, durumu pilin arka
   planı anlatır (native checkbox kutusu + altında metin şeklindeki
   dikey/kutu görünüm burada BİLİNÇLİ olarak terk edildi). */
.compare-checkbox-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.compare-checkbox-row label {
  flex-direction: row !important;
  align-items: center;
  gap: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.compare-checkbox-row label:hover { background: var(--surface-2); }
.compare-checkbox-row label:has(input:checked) { background: var(--series-1); color: #fff; border-color: transparent; }
.compare-checkbox-row label:has(input:disabled) { opacity: 0.4; cursor: not-allowed; }
.compare-checkbox-row label:has(input:disabled):hover { background: transparent; }
.compare-checkbox-row input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ipoModal (ekle/düzenle) ipoListModal'ın (liste) ÜSTÜNDE açılabilir -
   ikisi aynı anda açıkken doğru sırada görünsün diye z-index yükseltildi. */
#ipoModal { z-index: 21; }

/* ---------------- Kullanıcılar modal ---------------- */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.user-row-name { flex: 1; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.create-user-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gridline);
}

@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .content { padding: 16px; }
}

/* ---------------- Halka Arzlar sayfası (ipos.html) ---------------- */
.ipo-toolbar-panel { display: flex; flex-direction: column; gap: 12px; }
.ipo-filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ipo-search-input { flex: 1 1 220px; min-width: 180px; }
.ipo-filter-row select { min-width: 150px; }
.ipo-fav-filter { white-space: nowrap; font-size: 13px; }

.ipo-page-group-title { margin: 26px 4px 6px; font-size: 16px; font-weight: 700; color: var(--text-primary); }

.ipo-grid-lg { grid-template-columns: 1fr; }
@media (min-width: 620px) { .ipo-grid-lg { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
@media (min-width: 1100px) { .ipo-grid-lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.ipo-grid-lg .ipo-card { padding: 14px 16px; gap: 8px; transition: box-shadow 0.3s ease; }
.ipo-grid-lg .ipo-company-name { max-width: 240px; font-size: 14px; }
.ipo-grid-lg .ipo-note { font-size: 12.5px; padding: 9px 11px; }
.ipo-grid-lg .ipo-fact-row { font-size: 12.5px; padding: 7px 11px; }

.ipo-card-highlight { box-shadow: 0 0 0 3px var(--series-1); }

.ipo-card-title-group { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }

.ipo-fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted);
  padding: 2px 2px;
  flex-shrink: 0;
}
.ipo-fav-btn:hover { color: #d6a72a; }
.ipo-fav-btn.active { color: #d6a72a; }

.ipo-perf-positive { color: var(--success-text); font-weight: 700; }
.ipo-perf-negative { color: var(--critical); font-weight: 700; }

/* ---- Halka arz takvim şeridi ---- */
.ipo-calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ipo-calendar-header h3 { margin: 0; font-size: 14px; font-weight: 700; text-transform: capitalize; }
.ipo-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.ipo-cal-daylabel { font-size: 10px; font-weight: 700; color: var(--text-muted); text-align: center; padding: 2px 0; }
.ipo-cal-cell {
  min-height: 46px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  padding: 4px 5px;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ipo-cal-cell.empty { border: none; background: transparent; }
.ipo-cal-cell.has-event { cursor: pointer; }
.ipo-cal-cell.has-event:hover { border-color: var(--series-1); }
.ipo-cal-cell.today { border-color: var(--series-1); border-width: 2px; }
.ipo-cal-daynum { font-weight: 700; color: var(--text-primary); }
.ipo-cal-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal-dot-sub { background: var(--series-1); }
.cal-dot-trade { background: var(--good); }
.ipo-calendar-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 11px; color: var(--text-secondary); }
.ipo-calendar-legend .cal-dot { margin-right: 5px; vertical-align: middle; }

@media (max-width: 560px) {
  .ipo-cal-cell { min-height: 38px; font-size: 10px; }
  .ipo-filter-row { flex-direction: column; align-items: stretch; }
  .ipo-filter-row select, .ipo-search-input { width: 100%; flex-basis: auto; }
}

/* ================================================================
   PİYASA (girişsiz ana sayfa) - index.html + assets/market.js
   ================================================================ */
.topbar-home-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 4px;
  display: inline-block;
}
.topbar-home-link:hover { color: var(--series-1); }

.login-back-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.login-back-link:hover { color: var(--series-1); }

.market-index-panel { margin-bottom: 16px; }
.market-index-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.market-index-value { font-size: 28px; font-weight: 700; }
.market-coverage-note { margin-top: 6px; }

.market-highlight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 760px) {
  .market-highlight-grid { grid-template-columns: repeat(3, 1fr); }
}
.market-highlight-panel h2 { font-size: 15px; }

.market-mini-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* Grid ile 3 sabit sütun (yıldız / isim / değer) - içerik uzunluğu satırdan
   satıra değişse de (ör. "+8,5821%" vs "+3,1%", "SASA Polyester" vs
   "AKBNK") sağdaki değerler ve yıldızlar hep aynı hizada durur. Eskiden
   flex + justify-content:space-between kullanılıyordu, bu da her satırın
   genişliğini kendi içeriğine göre ayarlayıp satırlar arası hizasızlığa
   (orantısız görünüme) yol açıyordu. */
.market-mini-item {
  display: grid;
  grid-template-columns: 20px 1fr minmax(64px, auto);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}
.market-mini-item:hover, .market-mini-item:focus-visible { background: var(--surface-1); border-color: var(--border); outline: none; }
.market-mini-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.market-mini-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.market-mini-volume { font-size: 12px; flex-shrink: 0; text-align: right; }
.market-mini-item > .stock-change-pill { justify-self: end; white-space: nowrap; }

/* "Hızlı Takip Listem" panelindeki satırlar diğer mini listelerden (Günün
   En Çok Yükselenleri/Düşenleri vb.) FARKLI olarak 4 öğe basıyor: yıldız +
   isim + FİYAT + değişim rozeti (diğerlerinde fiyat sütunu yok, sadece 3
   öğe). Genel .market-mini-item grid'i sadece 3 sütun tanımlıyordu, 4.
   öğe (rozet) sığmayınca grid onu YENİ bir satıra, en başa (1. sütuna)
   taşıyordu - rozet kartın sol-altına taşmış/kırık gibi görünüyordu. Bu
   panele özel 4 sütunlu bir grid tanımlıyoruz. */
#marketWatchlistList .market-mini-item {
  grid-template-columns: 20px 1fr minmax(56px, auto) minmax(64px, auto);
}

.market-filter-row { margin-bottom: 12px; }

.market-foreign-search-row { display: flex; gap: 8px; margin-top: 10px; max-width: 360px; }
.market-foreign-search-row input { flex: 1; }

.market-foreign-grid { margin-top: 12px; }
.market-foreign-card { cursor: pointer; }
.market-foreign-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }

.market-news-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.market-news-item { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.market-news-item:last-child { border-bottom: none; padding-bottom: 0; }
.market-news-item a { color: var(--text-primary); text-decoration: none; font-size: 13px; font-weight: 600; line-height: 1.4; }
.market-news-item a:hover { color: var(--series-1); text-decoration: underline; }
.market-news-meta { display: block; margin-top: 2px; font-size: 11px; }

.market-disclaimer { margin-top: 8px; line-height: 1.6; }
.market-disclaimer a { color: var(--series-1); }

.market-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.market-detail-price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

#marketStockTable tbody tr { cursor: pointer; }
#marketStockTable tbody tr:hover { background: var(--surface-2); }

@media (max-width: 560px) {
  .market-filter-row { flex-direction: column; align-items: stretch; }
  .market-filter-row select, .market-filter-row .ipo-search-input { width: 100%; flex-basis: auto; }
  .market-detail-header { flex-direction: column; }
  .market-detail-price { align-items: flex-start; text-align: left; }
}

/* ================================================================
   v15 EKLERİ - piyasa açık/kapalı rozeti, döviz/altın şeridi, sektör
   özeti, hızlı takip listesi, halka arz özeti, profesyonelleştirilmiş
   giriş/portföy butonu
   ================================================================ */
.topbar-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-title-row h1 { margin: 0; }

.market-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: help;
}
.market-status-badge.open { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); background: color-mix(in srgb, var(--good) 12%, transparent); }
.market-status-badge.closed { color: var(--text-muted); }

/* "Giriş yap / Portföylerim" - eskiden düz bir .btn-primary'ydi, artık
   kendi kimliğine sahip, biraz daha "hesap kartı" gibi görünen bir buton. */
.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, var(--series-1) 12%, var(--surface-2)), var(--surface-2));
  color: var(--text-primary);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn-portal:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10); border-color: color-mix(in srgb, var(--series-1) 45%, var(--border)); }
.btn-portal-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--series-1) 18%, var(--surface-1));
  color: var(--series-1);
  flex-shrink: 0;
}

.market-fx-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.market-fx-item { display: flex; flex-direction: column; gap: 2px; }
.market-fx-value { font-size: 15px; font-weight: 700; }

.market-sector-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.market-sector-tile {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
}
.market-sector-tile.up { background: color-mix(in srgb, var(--good) 12%, transparent); border-color: color-mix(in srgb, var(--good) 30%, var(--border)); }
.market-sector-tile.down { background: color-mix(in srgb, var(--critical) 10%, transparent); border-color: color-mix(in srgb, var(--critical) 28%, var(--border)); }
.market-sector-tile.flat { background: var(--surface-2); }
.market-sector-tile-name { font-size: 12px; font-weight: 700; }
.market-sector-tile-value { font-size: 15px; font-weight: 700; }
.market-sector-tile-count { font-size: 11px; color: var(--text-muted); }

.market-section-header-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.market-section-header-row h2 { margin: 0; }

.market-ipo-link { text-decoration: none; color: inherit; min-width: 0; }
/* Halka Arzlar özet listesindeki satırların yıldız sütunu yok (favorileme
   burada değil, ipos.html'de) - 3 sabit sütunlu genel .market-mini-item
   grid'i burada 2 sütuna (isim / durum rozeti) düşürülüyor, aksi halde
   uzun şirket adları 20px'lik yıldız sütununa sıkışıp tek kelime tek
   satır şeklinde bozuk görünüyordu. */
#marketIpoList .market-mini-item { grid-template-columns: 1fr auto; }

.market-watch-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--text-muted);
  padding: 0;
  width: 20px;
  flex-shrink: 0;
  vertical-align: middle;
  text-align: center;
}
/* Tablo satırlarında (Tüm BIST Hisseleri) yıldız hücrenin başında sabit
   genişlikte duruyor, kod hemen yanında başlıyor - hizasızlığı önler. */
#marketStockBody .market-watch-star { display: inline-block; margin-right: 4px; }
/* Düzeltme: hover rengi ile aktif (yıldızlanmış) rengi AYNIYDI - kullanıcı
   yıldıza tıklayıp kaldırdığında fare zaten üzerinde durduğu için hover
   rengi devreye giriyor, glif ★'dan ☆'a dönse bile renk hâlâ aynı altın
   sarısı olduğundan "yıldız hâlâ yanıyor" gibi görünüyordu. Artık pasif
   haldeki hover DAHA SOLUK bir ton, aktif hal ise (hover olsun olmasın)
   her zaman dolgun altın sarısı - iki durum artık HER KOŞULDA ayırt edilebiliyor. */
.market-watch-star:hover { color: color-mix(in srgb, #d6a72a 55%, var(--text-muted)); }
.market-watch-star.active { color: #d6a72a; }
.market-watch-star.active:hover { color: #c19527; }

/* "Hızlı Takip Listem" paneli bir yıldıza tıklayınca aniden belirip
   kayboluyordu (display:none <-> block) - altındaki tüm kartlar sert bir
   şekilde zıplıyordu ("tasarım kayıyor" şikayeti). max-height/opacity
   üzerinden yumuşak bir geçişe çeviriyoruz; [hidden] üzerindeki
   !important, native "hidden -> display:none" davranışını ezip yerine
   bu geçişi kullanmasını sağlıyor. */
#marketWatchlistPanel {
  overflow: hidden;
  max-height: 640px;
  transition: max-height 0.28s ease, opacity 0.22s ease, margin-bottom 0.28s ease,
    padding 0.28s ease, border-width 0.28s ease;
}
#marketWatchlistPanel[hidden] {
  display: block !important;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  pointer-events: none;
}

.ipo-fav-btn-locked { animation: ipoFavShake 0.4s ease; }
@keyframes ipoFavShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

@media (max-width: 700px) {
  .market-fx-strip { gap: 12px; }
  .market-index-card { flex-direction: column; align-items: flex-start; }
}

/* ================================================================
   v22 (Faz 4): Aylık Rapor (monthly_report.html) - yazdırma/PDF'e
   uygun, sade tek sütun bir "kağıt" görünümü. Ekranda .content ile
   aynı genişlik hissini vermek için benzer max-width kullanılıyor.
   ================================================================ */
.report-page { max-width: 900px; margin: 0 auto; padding: 20px 20px 60px; }

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.report-toolbar-right { display: flex; align-items: center; gap: 12px; }
.report-month-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.report-month-picker input[type="month"] {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
}

.report-loading { padding: 40px 0; text-align: center; }

.report-sheet {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.report-header { margin-bottom: 20px; }
.report-header h1 { margin: 0 0 4px; }
.report-period { margin: 0; color: var(--text-secondary); font-size: 14px; }

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.report-footnote { color: var(--text-muted); font-size: 12px; margin: 16px 0 0; }

.report-section { margin-top: 28px; }
.report-section h2 { font-size: 15px; margin: 0 0 10px; }

.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th, .report-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gridline);
}
.report-table th { color: var(--text-secondary); font-weight: 600; font-size: 12px; }
.report-table td { font-variant-numeric: tabular-nums; }

.report-locked { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .report-page { max-width: none; padding: 0; }
  .report-sheet { border: none; box-shadow: none; border-radius: 0; padding: 0; }
}
