/* 0) Eksik tema değişkenleri: ui.css input border'ını bunlara bağlıyor.
   Tanımsızken border "geçersiz değer" olup sıfırlanıyordu (çerçevesiz alanlar). */
html[data-theme="light"] {
  --ux-line-2: #CBD5E1;
  --ux-primary: var(--ds-primary, #0E9F8E);
}
:root, html[data-theme="dark"] {
  --ux-line-2: rgba(148, 163, 184, 0.45);
  --ux-primary: var(--ds-primary, #2DD4BF);
}

/* BEP Hazırla — form alanları ve derinlik düzeltmesi (açık tema)
   Düzeltilenler: inputsuz çerçeve, select chevron yokluğu, kart/arka plan
   ayrımı zayıflığı, seçili olmayan UDA kutularının belirsizliği. */

html[data-theme="light"] {
  --ff-line: #CBD5E1;
  --ff-line-2: #94A3B8;
  --ff-text: #0F172A;
  --ff-muted: #94A3B8;
  --ff-focus: #2563EB;
}

/* 1) Görünür çerçeve — tüm form alanları */
html[data-theme="light"] input:not(#bh-ff):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="color"]):not([type="file"]),
html[data-theme="light"] select:not(#bh-ff),
html[data-theme="light"] textarea:not(#bh-ff) {
  border: 1.5px solid var(--ff-line) !important;
  border-style: solid !important;
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  color: var(--ff-text) !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05) !important;
}

/* 2) Select: ok ikonu + imleç */
html[data-theme="light"] select:not(#bh-ff) {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  padding-right: 38px !important;
  cursor: pointer !important;
}
html[data-theme="light"] select:not(#bh-ff):disabled {
  background-color: #F1F5F9 !important;
  color: #64748B !important;
  cursor: not-allowed !important;
}

/* 3) Odak halkası */
html[data-theme="light"] input:not(#bh-ff):focus,
html[data-theme="light"] select:not(#bh-ff):focus,
html[data-theme="light"] textarea:not(#bh-ff):focus {
  border-color: var(--ff-focus) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16) !important;
  outline: none !important;
}

/* 4) Placeholder okunur olsun */
html[data-theme="light"] input:not(#bh-ff)::placeholder,
html[data-theme="light"] textarea:not(#bh-ff)::placeholder {
  color: var(--ff-muted) !important;
  opacity: 1 !important;
}

/* 5) Arka plan / kart ayrımı + derinlik */
html[data-theme="light"] body,
html[data-theme="light"] .layout-body,
html[data-theme="light"] .main-content {
  background: #EEF2F7 !important;
}
html[data-theme="light"] .card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 28px -18px rgba(16, 24, 40, 0.28) !important;
}

/* 6) UDA / hedef kutuları: seçili olmayan da kutu gibi görünsün */
html[data-theme="light"] .uda-row:not(.uda-selected):not(.uda-closed) {
  border: 1.5px solid #CBD5E1 !important;
  background: #FFFFFF !important;
}
html[data-theme="light"] .uda-row:not(.uda-selected):not(.uda-closed):hover {
  border-color: var(--ff-line-2) !important;
  background: #F8FAFC !important;
}
html[data-theme="light"] .uda-row.uda-selected {
  border: 1.5px solid rgba(16, 185, 129, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12) !important;
}
html[data-theme="light"] .uda-row.uda-closed {
  border: 1.5px solid #CBD5E1 !important;
  background: #F8FAFC !important;
}

/* 7) Karanlık tema: aynı çerçeve sorunu orada da vardı */
html:not([data-theme="light"]) input:not(#bh-ff):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="color"]):not([type="file"]),
html:not([data-theme="light"]) select:not(#bh-ff),
html:not([data-theme="light"]) textarea:not(#bh-ff) {
  border: 1.5px solid rgba(148, 163, 184, 0.45) !important;
  border-style: solid !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}
html:not([data-theme="light"]) select:not(#bh-ff) {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  padding-right: 38px !important;
  cursor: pointer !important;
}
html:not([data-theme="light"]) input:not(#bh-ff):focus,
html:not([data-theme="light"]) select:not(#bh-ff):focus,
html:not([data-theme="light"]) textarea:not(#bh-ff):focus {
  border-color: #2DD4BF !important;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18) !important;
  outline: none !important;
}
html:not([data-theme="light"]) .uda-row:not(.uda-selected):not(.uda-closed) {
  border: 1.5px solid rgba(148, 163, 184, 0.35) !important;
}
html:not([data-theme="light"]) .uda-row.uda-selected {
  border: 1.5px solid rgba(16, 185, 129, 0.55) !important;
}
