/* ==========================================================================
   BAYİİNET UI v3 — ortak tasarım sistemi (anasayfa + panel + auth)
   Layout ve home.blade.php en sonda yükler; mevcut stilleri ezer.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #5b6b7f;
  --line: #dce4ee;
  --bg: #f4f7fa;
  --surface: #fff;
  --brand: #0284c7;
  --brand-600: #0284c7;
  --brand-700: #0369a1;
  --brand-2: #0d9488;
  --accent: #0d9488;
  --ok: #0d9488;
  --warn: #ca8a04;
  --bad: #dc2626;
  --grad: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  --grad-dark: radial-gradient(1200px 500px at 85% -10%, rgba(2,132,199,.38), transparent 60%),
               radial-gradient(900px 500px at -5% 110%, rgba(13,148,136,.24), transparent 60%),
               linear-gradient(160deg, #0c1722 0%, #102436 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 2px 8px rgba(15,23,42,.04);
  --shadow: 0 10px 30px -10px rgba(15,23,42,.12);
  --shadow-lg: 0 24px 60px -20px rgba(15,23,42,.22);
  --ring: 0 0 0 4px rgba(2,132,199,.18);
}

/* ---------- Temel ---------- */
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
  background: var(--bg) !important;
  color: var(--ink) !important;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.005em;
}
h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6 { letter-spacing: -.025em; font-weight: 800; }
::selection { background: rgba(109,94,252,.25); }
a { color: var(--brand-600); }
.text-muted { color: var(--muted) !important; }

/* ---------- Butonlar ---------- */
.btn { border-radius: 12px; font-weight: 600; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary, .btn-brand, body .btn-brand {
  background: var(--grad) !important; border: 0 !important; color: #fff !important;
  box-shadow: 0 8px 20px -8px rgba(2,132,199,.55);
}
.btn-primary:hover, .btn-brand:hover, body .btn-brand:hover { filter: brightness(1.06); box-shadow: 0 12px 26px -8px rgba(2,132,199,.65); transform: translateY(-1px); }
.btn-outline-primary { color: var(--brand-600); border-color: #bae6fd; }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-outline-secondary { border-color: var(--line); color: var(--ink-2); background: #fff; }
.btn-outline-secondary:hover { background: #f0f5fa; color: var(--ink); border-color: #cbd5e1; }
.btn-success { background: linear-gradient(135deg,#10b981,#059669); border: 0; box-shadow: 0 8px 18px -8px rgba(16,185,129,.7); }
body .btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); border-radius: 12px; }
body .btn-ghost:hover { background: #f0f5fa; }

/* ---------- Form ---------- */
.form-control, .form-select {
  border-radius: 12px; border: 1px solid #cbd5e1; background-color: #fff; padding: .6rem .9rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: var(--ring); }
.form-label { font-weight: 600; font-size: .82rem; color: var(--ink-2); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Kart / tablo / rozet ---------- */
.card { border: 1px solid var(--line) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-sm) !important; background: var(--surface); }
.card-header { background: transparent !important; border-bottom: 1px solid var(--line) !important; font-weight: 700; padding: .9rem 1.1rem; }
.card-body { padding: 1.1rem; }
.table { --bs-table-bg: transparent; }
.table > thead > tr > th, .table thead th {
  background: #f7f8fd; color: var(--muted); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .8rem .9rem; border-bottom-color: #eef0f7; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: #f0f9ff; }
.badge { font-weight: 600; letter-spacing: .01em; border-radius: 8px; padding: .38em .62em; }
.alert { border: 0; border-radius: 14px; box-shadow: var(--shadow-sm); }
.alert-success { background: #e8faf3; color: #065f46; }
.alert-danger { background: #feeceb; color: #991b1b; }
.alert-warning { background: #fff6e0; color: #92400e; }
.alert-info { background: #e7f6fd; color: #075985; }
.page-link { border-radius: 10px !important; margin: 0 2px; border: 1px solid var(--line); color: var(--ink-2); }
.page-item.active .page-link { background: var(--grad); border-color: transparent; color: #fff; }
.modal-content { border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: .4rem; }
.dropdown-item { border-radius: 8px; }

/* ---------- Panel: topbar + sidebar ---------- */
.topbar {
  background: rgba(255,255,255,.82) !important; backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgba(15,23,42,.06) !important;
}
.topbar-brand { font-weight: 800; letter-spacing: .02em; display: inline-flex; align-items: center; text-decoration: none; }
.topbar-brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar-brand .bn-brand-name, .sf-logo .bn-brand-name { font-size: 1.15rem; font-weight: 800; display: inline-flex; align-items: center; gap: 0; line-height: 1; }
.topbar-brand .bn-brand-main, .sf-logo .bn-brand-main { color: inherit; }
.topbar-brand .bn-brand-accent, .sf-logo .bn-brand-accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; }
.topbar-brand:hover .bn-logo-symbol, .sf-logo:hover .bn-logo-symbol { transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6)); }
.bn-logo-symbol { display: inline-flex; align-items: center; justify-content: center; transition: transform .22s cubic-bezier(.16,1,.3,1), filter .22s ease; }
.bn-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.45);
  display: block;
}
.sidebar {
  background: var(--grad-dark) !important; border-right: 0 !important; color: #cfd6f5;
  box-shadow: 10px 0 40px -20px rgba(11,16,32,.5);
}
.sidebar a { color: #aeb7dc !important; border-radius: 12px; font-weight: 500; transition: background .15s, color .15s, transform .15s; }
.sidebar a:hover { background: rgba(255,255,255,.08) !important; color: #fff !important; transform: translateX(2px); }
.sidebar a.active {
  background: linear-gradient(135deg, rgba(2,132,199,.92), rgba(13,148,136,.85)) !important; color: #fff !important;
  box-shadow: 0 8px 20px -8px rgba(2,132,199,.75);
}
.sidebar .nav-section { color: #6e859c !important; font-weight: 700; letter-spacing: .12em; }
.sidebar a i { opacity: 1; }
.stat-card { border-top: 0 !important; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.stat-card.green::before { background: linear-gradient(90deg,#10b981,#14b8a6); }
.stat-card.orange::before { background: linear-gradient(90deg,#ca8a04,#eab308); }
.stat-card.red::before { background: linear-gradient(90deg,#dc2626,#e11d48); }
.hero-banner { background: var(--grad-dark) !important; border-radius: 20px !important; padding: 1.5rem 1.6rem !important; box-shadow: var(--shadow-lg); }
.page-head h4 { font-size: 1.5rem; }
.mp-card, .order-card { border-radius: var(--radius); transition: transform .2s, box-shadow .2s; }
.order-card:hover, .mp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dnav a { font-weight: 600; }
.dnav a.active { background: #e0f2fe; color: var(--brand-700); border-color: #bae6fd; }

/* ---------- Vitrin üst bar (misafir) ---------- */
body .sf-header { background: rgba(11,16,32,.72); border-bottom: 1px solid rgba(255,255,255,.08); }
body .sf-header-inner { height: 64px; }
body .sf-logo { color: #fff; font-weight: 800; letter-spacing: .03em; }
body .sf-logo span { background: linear-gradient(135deg,#a79bff,#22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
body .sf-wa { background: rgba(16,185,129,.16); color: #5eead4; }
body .sf-btn { border-radius: 12px; min-height: 40px; }
body .sf-btn-ghost { background: transparent; color: #e5e8ff; border-color: rgba(255,255,255,.2); }
body .sf-btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
body .sf-btn-solid { background: var(--grad); border: 0; box-shadow: 0 8px 20px -8px rgba(109,94,252,.9); }

/* ---------- Alt bilgi ---------- */
body footer { background: var(--ink) !important; color: #9aa4cf !important; border-top: 0 !important; margin-top: 2rem; }
body footer.border-top { background: #fff !important; color: var(--muted) !important; border-top: 1px solid var(--line) !important; }
body footer a { color: #cfd6f5; }
body footer a:hover { color: #fff; }
body footer h6 { color: #fff; letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; }
body footer .logo span { color: #a79bff; }

/* ---------- Giriş / kayıt ---------- */
.auth-card, .login-card { border-radius: 24px !important; box-shadow: var(--shadow-lg) !important; border: 0 !important; }

/* ---------- Mobil alt menü / WhatsApp ---------- */
body .dealer-bottom-nav { background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
body .dealer-bottom-nav a.active { color: var(--brand-600); }
.wa-fab { box-shadow: 0 12px 30px -8px rgba(37,211,102,.7) !important; }

/* ---------- Hareket ---------- */
@keyframes bn-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.main > * { animation: bn-rise .5s cubic-bezier(.2,.8,.2,1) both; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

@media (max-width: 767.98px) {
  /* iOS Form Zoom Engelleme: tum form elemanlari en az 16px font-size olmali */
  input, select, textarea, .form-control, .form-select {
    font-size: 16px !important;
  }
  
  /* Tablolarin tasmasini engelleme ve puruzsuz dokunmatik kaydirma */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-radius: 12px;
  }

  /* Mobil buton dokunma tepkisi */
  .btn:active, .bn-btn:active, button:active {
    transform: scale(0.97) !important;
  }

  /* Mobil kart ve govde bosluk dengesi */
  .card-body {
    padding: 1rem;
  }

  /* Sayfa basligi mobil duzeni */
  .page-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: .75rem;
  }
}

@media (max-width: 575.98px) {
  .container, .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }
  .auth-card {
    padding: 1.5rem !important;
    border-radius: 20px !important;
  }
}

/* ---------- Auth sayfaları (login / register) ---------- */
body .auth-page { background: var(--grad-dark) !important; min-height: calc(100dvh - 64px); display: flex; align-items: center; padding: 2.5rem 0 !important; position: relative; overflow: hidden; }
body .auth-page::before { content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 26px 26px; }
body .auth-page > * { position: relative; }
body .auth-card { background: rgba(255,255,255,.97) !important; border-radius: 26px !important; padding: 2rem !important; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6) !important; border: 1px solid rgba(255,255,255,.5) !important; }
body .auth-brand { font-weight: 800; letter-spacing: .03em; color: var(--ink) !important; }
body .auth-brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
body .auth-title { font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
body .auth-sub, body .auth-foot { color: var(--muted) !important; }
body .auth-btn { background: var(--grad) !important; color: #fff !important; border: 0 !important; border-radius: 14px !important; font-weight: 700; padding: .8rem 1rem; box-shadow: 0 14px 28px -12px rgba(109,94,252,.8); transition: transform .15s, filter .2s; }
body .auth-btn:hover { transform: translateY(-2px); filter: brightness(1.07); }

/* ---------- v4 Tasarım & Efekt Yükseltmesi (PC + Mobil) ---------- */
.card {
  transition: box-shadow .22s cubic-bezier(.16,1,.3,1), border-color .22s ease, transform .22s cubic-bezier(.16,1,.3,1);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow) !important; }
.sidebar { transition: width .22s cubic-bezier(.16,1,.3,1), transform .25s cubic-bezier(.16,1,.3,1); }
.main { transition: margin-left .22s cubic-bezier(.16,1,.3,1); }

/* Sidebar aktif sol şerit ve etiket */
.sidebar a { position: relative; }
.sidebar a.active::before {
  content: ''; position: absolute; left: 2px; top: 20%; bottom: 20%; width: 3px;
  border-radius: 99px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.7);
}
.sidebar a .nav-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s ease; }

/* PC Mini-Sidebar (Daraltılmış Mod) */
@media (min-width: 992px) {
  body.sidebar-collapsed { --sidebar-w: 72px; }
  body.sidebar-collapsed .sidebar .nav-section {
    font-size: 0; padding: .5rem 0; margin: .35rem .9rem; border-top: 1px solid rgba(255,255,255,.08);
  }
  body.sidebar-collapsed .sidebar a {
    justify-content: center; padding: .72rem 0; margin: .15rem .6rem; gap: 0;
  }
  body.sidebar-collapsed .sidebar a .nav-lbl,
  body.sidebar-collapsed .sidebar a .badge { display: none !important; }
  body.sidebar-collapsed .sidebar a i { font-size: 1.18rem; margin: 0; width: auto; }
}

.sidebar-collapse-btn {
  display: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--ink-2);
  width: 36px; height: 36px;
  border-radius: 10px;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.sidebar-collapse-btn:hover { background: #e0f2fe; border-color: #7dd3fc; color: var(--brand-700); }
@media (min-width: 992px) {
  body:not(.dealer-shell) .sidebar-collapse-btn { display: inline-flex; }
}

/* Topbar Hızlı Arama / Komut Paleti Tetikleyici */
.cmd-trigger {
  display: inline-flex; align-items: center; gap: .45rem;
  height: 36px; padding: 0 .7rem; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.85);
  color: var(--muted); font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.cmd-trigger:hover { border-color: var(--brand); color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.cmd-trigger kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; font-weight: 700;
  background: #f1f5f9; color: var(--ink-2); padding: 2px 6px; border-radius: 6px; border: 1px solid #cbd5e1;
}
@media (max-width: 767.98px) { .cmd-trigger .cmd-lbl, .cmd-trigger kbd { display: none; } .cmd-trigger { width: 36px; padding: 0; justify-content: center; } }

/* Komut Paleti Modalı */
.bn-cmd-backdrop {
  position: fixed; inset: 0; z-index: 2050;
  background: rgba(15, 23, 42, .52); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center;
  padding: min(12vh, 90px) 14px 20px;
}
.bn-cmd-backdrop.open { display: flex; animation: bn-fade-in .15s ease; }
@keyframes bn-fade-in { from { opacity: 0; } to { opacity: 1; } }
.bn-cmd-box {
  width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(15,23,42,.45); overflow: hidden;
  animation: bn-rise .18s cubic-bezier(.16,1,.3,1);
}
.bn-cmd-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.bn-cmd-head i { color: var(--brand); font-size: 1.1rem; }
.bn-cmd-head input {
  flex: 1; border: 0; outline: 0; background: transparent; font-size: .98rem; font-weight: 500; color: var(--ink); min-width: 0;
}
.bn-cmd-esc {
  font-size: .7rem; font-weight: 700; color: var(--muted); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; cursor: pointer;
}
.bn-cmd-list { max-height: 360px; overflow-y: auto; padding: 8px; }
.bn-cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .88rem;
  transition: background .12s, color .12s;
}
.bn-cmd-item i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--brand); font-size: .95rem; flex-shrink: 0; }
.bn-cmd-item:hover, .bn-cmd-item.is-sel { background: #e0f2fe; color: var(--brand-700); }
.bn-cmd-item:hover i, .bn-cmd-item.is-sel i { background: var(--brand); color: #fff; }
.bn-cmd-item small { margin-left: auto; font-size: .72rem; color: var(--muted); font-weight: 500; }
.bn-cmd-empty { text-align: center; padding: 28px 16px; color: var(--muted); font-size: .88rem; }

/* Mobil Alt Gezinme Çubuğu (Admin + Bayi) */
.app-bottom-nav { display: none; }
@media (max-width: 767.98px) {
  .app-bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: rgba(255,255,255,.92); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 28px -12px rgba(15,23,42,.14);
  }
  .app-bottom-nav a, .app-bottom-nav button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 5px 2px; border: 0; background: transparent; color: var(--muted);
    text-decoration: none; font-size: .68rem; font-weight: 700; border-radius: 10px;
    transition: color .15s, transform .15s;
  }
  .app-bottom-nav a i, .app-bottom-nav button i { font-size: 1.18rem; line-height: 1; transition: transform .15s; }
  .app-bottom-nav a.active { color: var(--brand-600); }
  .app-bottom-nav a.active i { transform: translateY(-1px) scale(1.06); }
  .app-bottom-nav a.active::before {
    content: ''; position: absolute; top: -6px; width: 26px; height: 3px; border-radius: 0 0 4px 4px;
    background: var(--grad);
  }
  body.has-bottom-nav .main { padding-bottom: calc(82px + env(safe-area-inset-bottom)) !important; }
  body.has-bottom-nav .wa-fab { bottom: calc(78px + env(safe-area-inset-bottom)) !important; width: 48px; height: 48px; font-size: 1.45rem; }
}

/* ---------- Tüm Site Sayfa & Panel Geçişleri (View Transitions + Progress Bar) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: bn-vt-out .16s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(root) { animation: bn-vt-in .22s cubic-bezier(.16,1,.3,1) both; }
@keyframes bn-vt-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes bn-vt-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.bn-top-progress {
  position: fixed; left: 0; top: 0; right: 0; height: 2.5px; z-index: 9999;
  background: linear-gradient(90deg, #0284c7, #2dd4bf, #38bdf8);
  box-shadow: 0 0 12px rgba(56, 189, 248, .75);
  transform-origin: left center; transform: scaleX(0); opacity: 0;
  pointer-events: none; transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .2s ease;
}
.bn-top-progress.is-active { opacity: 1; transform: scaleX(.72); }
.bn-top-progress.is-done { opacity: 0; transform: scaleX(1); transition: transform .18s ease, opacity .22s ease .12s; }

/* Modal, dropdown, sekme ve buton mikro-geçişleri */
.modal.fade .modal-dialog { transition: transform .22s cubic-bezier(.16,1,.3,1), opacity .2s ease; transform: translateY(10px) scale(.98); }
.modal.show .modal-dialog { transform: none; }
.dropdown-menu.show { animation: bn-drop-in .16s cubic-bezier(.16,1,.3,1); }
@keyframes bn-drop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.table-hover > tbody > tr > * { transition: background-color .15s ease; }
.dnav a, .ao-tabs a { transition: transform .16s cubic-bezier(.16,1,.3,1), background .16s ease, color .16s ease, border-color .16s ease; }
.dnav a:active, .ao-tabs a:active, .app-bottom-nav a:active { transform: scale(.96); }
