/* =====================================================================
   style.css — Eminevim kurumsal teması (Bootstrap 5 üzerine)
   Renkler eminevim.com'un kurumsal paletinden alınmıştır.
   Kurumsal renk için sadece --brand değişkenlerini değiştirin.
   Kırılımlar (YH §8): ≥1280 sabit menü · 768–1279 daraltılabilir menü · ≤767 hamburger
   ===================================================================== */
:root {
  --brand: #00724c;          /* eminevim ana yeşil (--tkd_yesil) */
  --brand-dark: #095437;     /* koyu yeşil / hover (--tkd_yesilHover) */
  --brand-soft: #e9f0ed;     /* açık yeşil zemin (--tdk_homeAcikYesilBack) */
  --brand-accent: #a1cb3a;   /* çimen yeşili vurgu (--tdk_cimenYesil) */
  --brand-accent-dark: #788c3b;
  --navy: #1e3856;           /* lacivert (--tkd_lacivert) */
  --ink: #212529;
  --muted: #5f6368;          /* metin rengi (AA kontrast) */
  --line: #dddddd;           /* gri kenarlık (--tkd_griBorder) */
  --bg: #f4f6f8;
  --sidebar-w: 256px;
  --sidebar-rail: 76px;
  --radius: .75rem;
  --tap: 44px;               /* en küçük dokunma hedefi (YH §8) */

  /* Bootstrap bileşenlerini de markaya çek (link, odak halkası, switch vb.) */
  --bs-primary: #00724c;
  --bs-primary-rgb: 0, 114, 76;
  --bs-link-color: #095437;
  --bs-link-color-rgb: 9, 84, 55;
  --bs-link-hover-color: #00724c;
  --bs-link-hover-color-rgb: 0, 114, 76;
  --bs-secondary-color: #5f6368;
}

body { color: var(--ink); }
.text-muted { color: var(--muted) !important; }

/* ---- Erişilebilirlik: görünür odak + içeriğe geç ----
   Koyu yeşil halka (beyaz/gri zeminde ≥3:1, WCAG 1.4.11) ve dışında çimen yeşili iz (marka rengi) */
:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 2px; box-shadow: 0 0 0 5px var(--brand-accent); }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible, .form-check-input:focus-visible {
  outline: 3px solid var(--brand-dark); outline-offset: 2px; box-shadow: 0 0 0 5px var(--brand-accent);
}
.skip-link {
  position: absolute; left: .5rem; top: -100px; z-index: 2000; background: var(--brand-dark); color: #fff;
  padding: .6rem 1rem; border-radius: .5rem; text-decoration: none;
}
.skip-link:focus { top: .5rem; color: #fff; }

/* ---- Dokunma hedefleri en az 44×44 (YH §8) ---- */
.btn, .form-control, .form-select, .dropdown-item, .input-group-text, .page-link { min-height: var(--tap); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; }
.btn-sm { min-height: var(--tap); padding: .35rem .85rem; }
.btn-icon { min-width: var(--tap); }
.btn-close { min-width: var(--tap); min-height: var(--tap); background-size: .8em; }
.form-check { min-height: var(--tap); display: flex; align-items: center; gap: .5rem; padding-left: 0; }
.form-check .form-check-input { float: none; margin: 0; flex: none; width: 1.3em; height: 1.3em; }
.form-check.form-switch .form-check-input { width: 2.4em; }
.form-check-label { cursor: pointer; padding: .35rem 0; }

/* Metin bağlantılarında dokunma alanı ≥44px — görünümü/yerleşimi değiştirmeden (YH §8) */
.skip-link { min-height: var(--tap); display: inline-flex; align-items: center; }
.input-group > .btn { min-width: var(--tap); }
.app-content table a:not(.btn) { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); }
.app-content a:not(.btn):not([class*="btn-"]):not(.card):not(.dropdown-item):not(.dropdown-toggle):not(.page-link):not(.nav-link):not(.list-group-item):not(.stretched-link) {
  position: relative;
}
/* Görünmez dokunma katmanı: yerleşimi etkilemez, bağlantının dokunma alanını en az 44px yüksekliğe çıkarır */
.app-content a:not(.btn):not([class*="btn-"]):not(.card):not(.dropdown-item):not(.dropdown-toggle):not(.page-link):not(.nav-link):not(.list-group-item):not(.stretched-link)::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: max(100%, var(--tap)); transform: translateY(-50%);
}

/* Form odak ve işaretleme renkleri markaya göre */
.form-control:focus, .form-select:focus {
  border-color: #4a9d7f;
  box-shadow: 0 0 0 .25rem rgba(0, 114, 76, .2);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: #4a9d7f; box-shadow: 0 0 0 .25rem rgba(0, 114, 76, .2); }
.text-bg-warning { color: #3a2e00 !important; }   /* sarı rozet üzeri okunur metin */
.text-bg-info { color: #062c33 !important; }

/* Hata mesajı yalnızca renkle anlatılmaz: ikon + metin (YH §8) */
.invalid-feedback, .form-error { font-weight: 600; }
.invalid-feedback::before, .form-error::before {
  content: "\F33A"; font-family: "bootstrap-icons"; margin-right: .35rem; font-weight: 400;  /* bi-exclamation-circle */
}
.form-error { color: #b02a37; font-size: .875em; margin-top: .25rem; display: block; }

/* ---- Marka butonu (tek marka rengi) ---- */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; border-radius: 999px; font-weight: 600; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-brand:disabled, .btn-brand.disabled { background: #8fb9a8; border-color: #8fb9a8; color: #fff; opacity: 1; }
.btn-outline-brand { color: var(--brand-dark); border-color: var(--brand); border-radius: 999px; font-weight: 600; }
.btn-outline-brand:hover, .btn-outline-brand.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn { border-radius: 999px; }
.text-brand { color: var(--brand-dark) !important; }
.bg-brand { background: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }
.border-brand { border-color: var(--brand) !important; }
a { color: var(--brand-dark); }

/* =====================================================================
   Giriş ekranı
   ===================================================================== */
.login-body {
  min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 1rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
}
.login-card { width: 100%; max-width: 420px; border: 0; border-radius: var(--radius); }
.login-logo { margin: 0 auto .25rem; display: grid; place-items: center; }
.login-logo img { height: 46px; width: auto; }

/* =====================================================================
   Panel iskeleti
   ===================================================================== */
.app-body { background: var(--bg); margin: 0; }
.app-shell { display: flex; min-height: 100vh; --shell-side: 0px; }
/* Sol menü zemini uzun sayfalarda da kesintisiz (menü sabit, zemin gövdeyle birlikte uzar) */
@media (min-width: 768px) {
  .app-shell { background: linear-gradient(90deg, #fff 0, #fff calc(var(--shell-side) - 1px),
               var(--line) calc(var(--shell-side) - 1px), var(--line) var(--shell-side), transparent var(--shell-side)); }
}
@media (min-width: 768px) and (max-width: 1279.98px) { .app-shell { --shell-side: var(--sidebar-rail); } }
@media (min-width: 1280px) { .app-shell { --shell-side: var(--sidebar-w); } }

.app-sidebar {
  width: var(--sidebar-w); flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30;
}
.app-sidebar__brand {
  display: flex; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); min-height: 64px;
}
.app-sidebar__brand a { display: inline-flex; min-height: var(--tap); align-items: center; }
.app-sidebar__logo { height: 26px; width: auto; }
.app-nav { padding: .75rem; display: flex; flex-direction: column; gap: 2px; }
.app-nav__sep { padding: 1rem .75rem .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.app-nav__link {
  display: flex; align-items: center; gap: .75rem; padding: .55rem .8rem; border-radius: .6rem; min-height: var(--tap);
  color: #374151; text-decoration: none; font-weight: 500; font-size: .94rem;
}
.app-nav__link:hover { background: var(--bg); color: var(--ink); }
.app-nav__link.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
.app-nav__link i { font-size: 1.15rem; width: 1.25rem; text-align: center; flex: none; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* Sayfa içi bağlantılar (#bölüm, hata özetindeki #alan) hedefi yapışkan üst çubuğun (64px) altında bırakmasın; etiket de görünsün */
html { scroll-padding-top: 112px; }
.app-navbar {
  display: flex; align-items: center; gap: .75rem; padding: .5rem 1.25rem; min-height: 64px;
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.app-navbar__toggle { display: none; font-size: 1.6rem; color: var(--ink); min-width: var(--tap); padding: 0; }
.app-navbar__logo { display: none; }
.app-navbar__logo img { height: 22px; width: auto; }
.app-navbar__title { font-weight: 650; font-size: 1.05rem; }
.app-navbar__actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.app-navbar__bell { position: relative; min-width: var(--tap); border-radius: 999px; font-size: 1.15rem; }
.app-navbar__badge {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: #c0392b; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1;
}
.app-navbar__user { display: flex; align-items: center; gap: .5rem; border-radius: 999px; }
.app-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff;
  display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none;
}
.app-bell-menu { width: min(360px, calc(100vw - 2rem)); padding: 0; overflow: hidden; }
.app-bell-menu__head { padding: .75rem 1rem; font-weight: 650; border-bottom: 1px solid var(--line); }
.app-bell-menu__empty { padding: 1rem; color: var(--muted); font-size: .9rem; }
.app-bell-item { display: flex; gap: .65rem; align-items: flex-start; white-space: normal; padding: .65rem 1rem; border-bottom: 1px solid #f0f0f0; }
.app-bell-item i { color: var(--brand-dark); font-size: 1.1rem; margin-top: .1rem; }
.app-bell-item.is-unread { background: #f6faf8; }
.app-bell-item__title { display: block; font-weight: 600; font-size: .9rem; }
.app-bell-item__body { display: block; color: var(--muted); font-size: .8rem; }
.app-bell-menu__all { text-align: center; font-weight: 600; color: var(--brand-dark); }
.app-content { padding: 1.5rem; flex: 1; }
.app-content:focus { outline: none; }

/* Kampanya bandı: tek metin, tekrarsız ve kesiksiz; dar ekranda satır kaydırarak tam görünür (YH §1) */
.app-banner { background: var(--brand-dark); color: #fff; padding: .5rem 1rem; text-align: center; }
.app-banner__text { font-weight: 600; font-size: .9rem; }

/* Kart ve tablo ince ayar */
.card { border: 1px solid var(--line); border-radius: var(--radius); }
.card-header { border-top-left-radius: var(--radius) !important; border-top-right-radius: var(--radius) !important; }
.stat-icon {
  width: 46px; height: 46px; border-radius: .7rem; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 1.3rem;
}
.table .badge, .flow-steps .badge { white-space: normal; text-align: left; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.table > :not(caption) > * > * { padding: .75rem .9rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: .25rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; }
.empty-state .bi { font-size: 2.5rem; color: var(--brand); }

/* Süreç göstergesi (Model → Bilgiler → Sözleşmeler → Ödeme → Onay) */
.flow-steps { display: flex; list-style: none; padding: 0; margin: 0 0 1.25rem; gap: 0; counter-reset: step; }
.flow-steps__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; position: relative; text-align: center; font-size: .8rem; color: var(--muted); }
.flow-steps__item:not(:last-child)::after {
  content: ""; position: absolute; top: 14px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--line);
}
.flow-steps__item.is-done:not(:last-child)::after { background: var(--brand); }
.flow-steps__dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff;
  border: 2px solid var(--line); color: var(--muted); font-weight: 700; font-size: .8rem; z-index: 1;
}
.flow-steps__item.is-done .flow-steps__dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.flow-steps__item.is-current .flow-steps__dot { border-color: var(--brand); color: var(--brand-dark); box-shadow: 0 0 0 4px var(--brand-soft); }
.flow-steps__item.is-current { color: var(--ink); font-weight: 650; }

/* İlerleme çubuğu */
.progress { height: .6rem; background: #e7ecea; }
.progress-bar { background: var(--brand); }

/* Kopyalanabilir alan (IBAN, alıcı, banka) */
.copy-row { display: flex; align-items: center; gap: .5rem; }
.copy-row code { font-size: .95rem; background: var(--bg); color: var(--ink); padding: .55rem .7rem; border-radius: .5rem; flex: 1; word-break: normal; overflow-wrap: anywhere; }

/* Özet kutusu (başvuru/ödeme özeti) */
.summary-card { background: var(--brand-soft); border: 0; }
.summary-list { margin: 0; }
.summary-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed #cfdcd6; }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list dt { font-weight: 400; color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 650; text-align: right; }

/* Uzun tablolar mobilde kart listesine dönüşür (YH §8): <table class="table table-stack"> + <td data-label="..."> */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tfoot, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border: 1px solid var(--line); border-radius: var(--radius); margin: .75rem; width: auto; background: #fff; padding: .25rem 0; }
  .table-stack td { border: 0 !important; display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .9rem !important; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; }
  .table-stack td[data-label=""]::before, .table-stack td:not([data-label])::before { content: none; }
  .table-stack td.table-stack__actions { justify-content: flex-end; flex-wrap: wrap; }
  .table-responsive:has(.table-stack) { overflow: visible; }
}

/* =====================================================================
   Duyarlı menü (YH §8)
   ===================================================================== */
.app-backdrop { display: none; }

/* 768–1279: sol menü daraltılabilir (ikon şeridi; menü düğmesiyle tam açılır) */
@media (min-width: 768px) and (max-width: 1279.98px) {
  .app-navbar__toggle { display: inline-grid; place-items: center; }
  .app-sidebar { width: var(--sidebar-rail); }
  .app-sidebar__brand { padding: 1rem .5rem; justify-content: center; }
  .app-sidebar__logo { height: auto; width: 54px; }
  .app-nav { padding: .5rem; }
  .app-nav__link { justify-content: center; padding: .55rem; }
  .app-nav__link span, .app-nav__sep { display: none; }
  body.sidebar-open .app-sidebar {
    position: fixed; left: 0; top: 0; width: var(--sidebar-w); z-index: 1050; box-shadow: 0 10px 40px rgba(0,0,0,.2);
  }
  body.sidebar-open .app-sidebar__brand { justify-content: flex-start; padding: 1rem 1.25rem; }
  body.sidebar-open .app-sidebar__logo { width: auto; height: 26px; }
  body.sidebar-open .app-nav__link { justify-content: flex-start; padding: .55rem .8rem; }
  body.sidebar-open .app-nav__link span, body.sidebar-open .app-nav__sep { display: block; }
  body.sidebar-open .app-shell { padding-left: var(--sidebar-rail); }
}

/* ≤767: hamburger menü, tek sütun, tam genişlik form ve ana aksiyon */
@media (max-width: 767.98px) {
  .app-navbar { padding: .5rem .75rem; gap: .5rem; }
  .app-navbar__toggle { display: inline-grid; place-items: center; }
  .app-navbar__logo { display: inline-flex; align-items: center; min-height: var(--tap); }
  .app-navbar__title, .app-navbar__name { display: none; }
  .app-navbar__user.dropdown-toggle::after { display: none; }
  .app-sidebar {
    position: fixed; z-index: 1050; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: 0 10px 40px rgba(0,0,0,.2); visibility: hidden;
  }
  body.sidebar-open .app-sidebar { transform: none; visibility: visible; }
  .app-content { padding: 1rem; }
  .btn-cta-mobile, .app-content form .btn-brand[type="submit"] { width: 100%; }
}
body.sidebar-open .app-backdrop { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(0,0,0,.45); }
@media (min-width: 1280px) { body.sidebar-open .app-backdrop { display: none; } }

@media print {
  .app-sidebar, .app-navbar, .app-banner, .app-backdrop, .no-print, .toast-container, .skip-link { display: none !important; }
  .app-content { padding: 0; }
  .app-body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
