html,body{height:100%;max-width:100%;overflow-x:clip}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--adl-font-sans);
  overflow-x:clip;
}
html.adl-ui-booting .sidebar,
html.adl-ui-booting .sidebar-overlay,
html.adl-ui-booting .sidebar-toggle-btn,
html.adl-ui-booting .topbar,
html.adl-ui-booting main.content-area{
  transition: none !important;
}
img,
svg,
canvas{
  max-width:100%;
}

/* ============ SIDEBAR ============ */
.sidebar{
  position:fixed; top:0; left:0;
  width:var(--sidebar-w);
  height:100vh;
  background:var(--sb-bg);
  box-shadow:3px 0 8px var(--sb-outline);
  z-index:1040;
  display:flex; flex-direction:column;
  padding:.5rem .5rem 0 .5rem;
  overflow:hidden;
  overscroll-behavior:contain;
}

/* Mobile sidebar overlay */
.sidebar-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  backdrop-filter: blur(1px);
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease;
  z-index:1035;
}
body.sidebar-open .sidebar-overlay{
  opacity:1;
  pointer-events:auto;
}
.sidebar-top{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

/* Logo blok (çizgisiz) */
.sidebar-logo-block{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.22rem;
  padding:.25rem 0 .8rem;
}
.sidebar-logo-block .logo-big{ display:block; border-radius:16px; }
.sidebar-logo-block .logo-mini{ display:none; border-radius:6px; }
.sidebar-logo-version{
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:.38rem;
  line-height:1.1;
  white-space:nowrap;
  margin-top:.08rem;
}
.sidebar-logo-version__label{
  color:rgba(255,255,255,.68);
  font-size:.74rem;
  font-weight:600;
  letter-spacing:.04em;
  text-transform:none;
}
.sidebar-logo-version__value{
  color:rgba(255,255,255,.92);
  font-size:.82rem;
  font-weight:600;
  letter-spacing:.04em;
}

/* Menü */
nav.nav.flex-column{
  display:flex !important;
  flex-direction:column !important;
  flex-wrap:nowrap !important;
  align-items:stretch;
  flex:1 1 auto;
  min-height:0;
  width:100%;
  max-width:100%;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  padding:.25rem .25rem .75rem;
  gap:.15rem;
}
nav.nav.flex-column > *{
  flex:0 0 auto;
  width:100%;
  max-width:100%;
  min-width:0;
}
.nav-link{
  display:flex; align-items:center; gap:.7rem;
  padding:.6rem .75rem; border-radius:.55rem;
  color:var(--sb-text); font-weight:600; text-decoration:none;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  border:1px solid transparent;
}
.nav-link i{ font-size:1.2rem; color:inherit; flex-shrink:0; width:1.4rem; text-align:center; }




.link-text{display:inline-block}
.sidebar .link-text{
  flex:1 1 auto;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
}
.nav-link:hover{ background:var(--sb-hover); color:var(--sb-strong); }
.nav-link.active{ background:var(--sb-active); color:var(--sb-strong); }

/* caret */
.caret{ margin-left:auto; color:var(--sb-text); transition:transform .2s ease,color .2s ease; }
.nav-link[aria-expanded="true"] .caret, .caret.rotated{ transform:rotate(-180deg); color:var(--sb-strong); }

/* Alt menü */
.submenu{
  flex:0 0 auto;
  width:100%;
  max-width:100%;
  min-width:0;
  list-style:none;
  margin:.15rem 0 .4rem 0;
  padding-left:.72rem !important;
}
.submenu > li{
  width:100%;
  max-width:100%;
  min-width:0;
}
.submenu .nav-link{ padding:.45rem .6rem; font-weight:500; border-radius:.45rem; }
.submenu .nav-link:hover, .submenu .nav-link.active{ background:var(--sb-hover); color:var(--sb-strong); }

/* Sidebar alt menü animasyonu: iki menüde de aynı hız/hissetim */
.sidebar .submenu.collapsing{
  transition:none !important;
  will-change:height;
}

/* Sidebar menu typography/colors: keep consistent across pages */
.sidebar .nav-link{
  font-family:var(--adl-font-sans);
  font-size:1.02rem;
  line-height:1.2;
  color:var(--sb-text);
  transition:background-color .12s ease, color .12s ease, border-color .12s ease;
}
.sidebar .nav-link:link,
.sidebar .nav-link:visited{ color:var(--sb-text); }
.sidebar .nav-link:hover,
.sidebar .nav-link:focus,
.sidebar .nav-link:focus-visible{
  color:var(--sb-strong);
  background:var(--sb-hover);
  outline:none;
}
.sidebar .nav-link:active{
  color:var(--sb-strong);
  background:var(--sb-press);
}
.sidebar .nav-link[aria-expanded="true"],
.sidebar .nav-link[aria-expanded="true"]:link,
.sidebar .nav-link[aria-expanded="true"]:visited{
  color:var(--sb-strong);
  background:var(--sb-active);
}
.sidebar .nav-link-toggle{ justify-content:flex-start; }
.sidebar .submenu .nav-link{
  font-size:1.00rem;
  font-weight:500;
}

/* Sidebar satırları modüller arası aynı görünsün */
.sidebar .nav.flex-column > .nav-link,
.sidebar .submenu .nav-link{
  flex:0 0 auto;
  width:100%;
  max-width:100%;
  min-width:0;
  min-height:46px;
}
.sidebar .nav-link{
  align-items:center;
  gap:.72rem;
  letter-spacing:.01em;
}

.sidebar .nav-link > i:first-child::before,
.sidebar .submenu .nav-link > i:first-child::before{
  line-height:1;
}


.sidebar .nav-link.active,
.sidebar .nav-link[aria-expanded="true"]{
  background:var(--sb-active);
  color:var(--sb-strong);
}

/* ============ HANDLE (sağ kenar) ============ */
.sidebar-toggle-btn{
  position:fixed; top:12px;
  /* Tutacağı sidebar ile içerik sınırına ortala (Hyper gibi) */
  left:var(--sidebar-w);
  transform:translateX(-50%);
  z-index:1060;

  display:flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:14px;
  background:linear-gradient(135deg, var(--brand) 0%, color-mix(in oklab, var(--brand) 68%, #0f172a) 100%);
  border:2px solid rgba(255,255,255,.6);
  color:#ffffff;
  box-shadow:
    0 10px 24px rgba(var(--brand-rgb),.35),
    0 0 0 3px rgba(var(--brand-rgb),.18);
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
html[data-theme="dark"] .sidebar-toggle-btn{
  background:linear-gradient(135deg, color-mix(in oklab, var(--brand) 78%, white) 0%, color-mix(in oklab, var(--brand) 64%, #08111f) 100%);
  border-color: rgba(255,255,255,.15);
}
.sidebar-toggle-btn:hover{
  color:#fff;
  background:linear-gradient(135deg, color-mix(in oklab, var(--brand) 72%, #08111f) 0%, color-mix(in oklab, var(--brand) 52%, #030712) 100%);
  border-color: rgba(255,255,255,.8);
  box-shadow:
    0 14px 30px rgba(var(--brand-rgb),.45),
    0 0 0 4px rgba(var(--brand-rgb),.25);
  transform: translateX(-50%) translateY(-1px);
}
.sidebar-toggle-btn:active{ transform: translateX(-50%) translateY(0); }
body.sidebar-collapsed .sidebar-toggle-btn{ left:var(--sidebar-w-collapsed); }






/* ============ RIGHT SIDEBAR MODE ============ */
body.sidebar-right .sidebar{
  left:auto;
  right:0;
  box-shadow:-3px 0 8px var(--sb-outline);
}
body.sidebar-right .topbar{
  left:0;
  right:var(--sidebar-w);
  padding:0 3rem 0 1rem;
}
body.sidebar-right.sidebar-collapsed .topbar{
  left:0;
  right:var(--sidebar-w-collapsed);
}
body.sidebar-right main.content-area{
  margin-left:0;
  margin-right:var(--sidebar-w);
}
body.sidebar-right.sidebar-collapsed main.content-area{
  margin-left:0;
  margin-right:var(--sidebar-w-collapsed);
}
body.sidebar-right .sidebar-toggle-btn{
  left:auto;
  right:var(--sidebar-w);
  transform:translateX(50%);
}
body.sidebar-right .sidebar-toggle-btn:hover{
  transform: translateX(50%) translateY(-1px);
}
body.sidebar-right .sidebar-toggle-btn:active{
  transform: translateX(50%) translateY(0);
}
body.sidebar-right.sidebar-collapsed .sidebar-toggle-btn{
  left:auto;
  right:var(--sidebar-w-collapsed);
}




/* ============ TOPBAR ============ */
.topbar{
  position:fixed; top:0; right:0; left:var(--sidebar-w);
  height:var(--topbar-h);
  background:var(--surface);
  border-bottom:1px solid var(--border);
  /* Sidebar tutacağıyla çakışmayı önlemek için soldan ekstra boşluk */
  padding:0 1rem 0 3rem;
  z-index:1030;
  overflow:visible;
}
body.sidebar-collapsed .topbar{ left:var(--sidebar-w-collapsed); }
.top-actions{
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
  min-width:0;
  padding-left:0;
}
.top-actions > li{
  margin:0 !important;
  flex:0 0 auto;
}
.topbar .btn[data-toggle="fullscreen"].is-active{
  --bs-btn-color: #ffffff;
  --bs-btn-bg: rgba(var(--brand-rgb), .96);
  --bs-btn-border-color: rgba(var(--brand-rgb), .96);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: rgba(var(--brand-rgb), 1);
  --bs-btn-hover-border-color: rgba(var(--brand-rgb), 1);
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: rgba(var(--brand-rgb), 1);
  --bs-btn-active-border-color: rgba(var(--brand-rgb), 1);
  box-shadow: 0 10px 22px rgba(var(--brand-rgb), .18);
}

/* Sol bölüm (arama) - Hyper benzeri görünüm */
.topbar-left{
  padding-left: 0;
}

.top-search-form{
  width: 100%;
  /* Arama alanı: daha kompakt (sağdan sola küçülür) */
  max-width: 420px;
}

.top-search-shell,
.mobile-search-shell{
  position: relative;
  width: 100%;
}

.top-search-group{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.top-search-input{
  flex: 1 1 auto;
  min-width: 220px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  padding: 0 1rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.top-search-input:focus{
  border-color: rgba(var(--brand-rgb), .55);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12);
  background: rgba(255,255,255,.92);
}

html[data-theme="dark"] .top-search-input:focus{
  background: rgba(0,0,0,.20);
}

.top-search-submit{
  height: 40px;
  padding: 0 .95rem;
  border: 0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
}

.top-search-submit.btn-soft-primary{
  border-radius: 999px;
  background: rgba(var(--brand-rgb), .14);
  border: 1px solid rgba(var(--brand-rgb), .22);
  color: var(--brand);
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}

.top-search-submit.btn-soft-primary:hover,
.top-search-submit.btn-soft-primary:focus{
  background: var(--action);
  border-color: var(--action);
  color: #fff;
  transform: translateY(-1px);
}

.top-search-submit.btn-soft-primary:focus{
  box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .25);
}

.top-search-submit.btn-soft-primary:active{
  transform: translateY(0);
}

html[data-theme="dark"] .top-search-submit.btn-soft-primary{
  background: rgba(var(--brand-rgb), .18);
  border-color: rgba(var(--brand-rgb), .30);
  color: var(--brand);
}

html[data-theme="dark"] .top-search-submit.btn-soft-primary:hover,
html[data-theme="dark"] .top-search-submit.btn-soft-primary:focus{
  color: #fff;
}

.global-search-dropdown{
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 1080;
  display: block;
}

.global-search-dropdown[hidden]{
  display: none !important;
}

.global-search-dropdown__inner{
  border: 1px solid color-mix(in oklab, var(--border) 88%, var(--brand) 12%);
  border-radius: 18px;
  background: color-mix(in oklab, var(--surface) 92%, white 8%);
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.global-search-dropdown__summary{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 92%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--surface-2) 88%, white 12%),
    color-mix(in oklab, var(--surface) 92%, transparent)
  );
}

.global-search-dropdown__summary-text{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
}

.global-search-dropdown__summary-link{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--brand);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}

.global-search-dropdown__summary-link:hover{
  color: color-mix(in oklab, var(--brand) 80%, var(--brand-2) 20%);
}

.global-search-dropdown__scroll{
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

.global-search-dropdown__section + .global-search-dropdown__section{
  border-top: 1px solid color-mix(in oklab, var(--border) 92%, transparent);
}

.global-search-dropdown__section-heading{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1rem .65rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.global-search-dropdown__section-heading strong{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  font-size: .9rem;
  letter-spacing: normal;
  text-transform: none;
}

.global-search-dropdown__list{
  display: flex;
  flex-direction: column;
  padding: 0 .65rem .7rem;
  gap: .35rem;
}

.global-search-option{
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .8rem;
  align-items: center;
  padding: .82rem .85rem;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: background-color .16s ease, transform .14s ease, box-shadow .16s ease;
}

.global-search-option:hover,
.global-search-option.is-active{
  background: color-mix(in oklab, rgba(var(--brand-rgb), .14) 60%, var(--surface-2) 40%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.global-search-option__icon{
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .95rem;
  background: color-mix(in oklab, rgba(var(--brand-rgb), .16) 60%, var(--surface-2) 40%);
  color: var(--brand);
  font-size: 1.05rem;
}

.global-search-option__body{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .18rem;
}

.global-search-option__title{
  color: var(--text);
  font-size: .98rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-option__subtitle{
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
}

.global-search-option__meta{
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  justify-self: end;
}

.global-search-option__badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .28rem .62rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--brand-rgb), .18);
  background: rgba(var(--brand-rgb), .1);
  color: var(--brand);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.global-search-dropdown__status{
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1rem;
  color: var(--muted);
  font-size: .92rem;
}

.global-search-dropdown__status i{
  font-size: 1.1rem;
  color: var(--brand);
}

.mobile-search-form{
  width: 100%;
}

.mobile-search-form .input-group{
  align-items: stretch;
}

.mobile-search-form .input-group > .form-control,
.mobile-search-form .input-group > .input-group-text,
.mobile-search-form .input-group > .btn{
  min-height: 48px;
}

.mobile-search-form .input-group-text{
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.mobile-search-form .form-control{
  border-color: var(--border);
}

.global-search-dropdown-mobile .global-search-dropdown__scroll{
  max-height: min(58vh, 420px);
}

html[data-theme="dark"] .global-search-dropdown__inner{
  background: color-mix(in oklab, var(--surface) 92%, black 8%);
  border-color: color-mix(in oklab, var(--border) 82%, rgba(var(--brand-rgb), .24) 18%);
}

html[data-theme="dark"] .global-search-dropdown__summary{
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--surface-2) 86%, black 14%),
    color-mix(in oklab, var(--surface) 92%, black 8%)
  );
}

html[data-theme="dark"] .global-search-option:hover,
html[data-theme="dark"] .global-search-option.is-active{
  background: color-mix(in oklab, rgba(var(--brand-rgb), .2) 58%, var(--surface-2) 42%);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .26);
}

html[data-theme="dark"] .global-search-option__icon{
  background: color-mix(in oklab, rgba(var(--brand-rgb), .2) 52%, var(--surface-2) 48%);
}

/* Sidebar toggle butonu: arama kutusuna binmesin */
@media (min-width: 992px){
  .sidebar-toggle-btn{
    top: 12px;
    left: var(--sidebar-w);
    transform: translateX(-50%);
  }
  body.sidebar-collapsed .sidebar-toggle-btn{
    left: var(--sidebar-w-collapsed);
  }
  body.sidebar-right .sidebar-toggle-btn{
    left: auto;
    right: var(--sidebar-w);
    transform: translateX(50%);
  }
  body.sidebar-right.sidebar-collapsed .sidebar-toggle-btn{
    left: auto;
    right: var(--sidebar-w-collapsed);
  }
  .topbar-left{
    padding-left: 0;
  }
}

.noti-menu{ min-width:280px; }

/* MOBİL arama offcanvas */
.offcanvas-search{ background:var(--surface); color:var(--text); }
.offcanvas-search .offcanvas-header{ border-bottom:1px solid var(--border); }
.offcanvas-search .offcanvas-body{
  padding-top: 1rem;
}

/* ============ BACK TO TOP ============ */
.back-to-top{
  --scroll-progress: 0;
  position: fixed;
  right: max(20px, calc(env(safe-area-inset-right) + 20px));
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 20px));
  z-index: 1025;
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: .32rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), .98), rgba(var(--brand-2-rgb), .92));
  color: #ffffff;
  box-shadow:
    0 14px 34px rgba(var(--brand-rgb), .22),
    0 8px 18px rgba(15,23,42,.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(.92);
  transition:
    opacity .22s ease,
    transform .22s ease,
    box-shadow .22s ease,
    visibility .22s ease;
  pointer-events: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
body.sidebar-right .back-to-top{
  right: auto;
  left: max(20px, calc(env(safe-area-inset-left) + 20px));
}
body.has-plate-contract-form .back-to-top,
body:has(#plateContractForm) .back-to-top{
  bottom: max(112px, calc(env(safe-area-inset-bottom) + 112px));
}
.back-to-top[hidden]{
  display: none !important;
}
.back-to-top.is-visible{
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.back-to-top:hover{
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 18px 38px rgba(var(--brand-rgb), .28),
    0 10px 20px rgba(15,23,42,.22);
}
.back-to-top:active{
  transform: translateY(0) scale(.98);
}
.back-to-top:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 4px rgba(var(--brand-2-rgb), .22),
    0 18px 38px rgba(var(--brand-rgb), .28),
    0 10px 20px rgba(15,23,42,.22);
}
.back-to-top-progress{
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 3px;
  flex-shrink: 0;
  background:
    conic-gradient(
      rgba(255,255,255,.98) calc(var(--scroll-progress) * 1turn),
      rgba(255,255,255,.22) 0
    );
}
.back-to-top-core{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.68);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.56),
    0 3px 10px rgba(15,23,42,.10);
}
.back-to-top i{
  font-size: 1.45rem;
  line-height: 1;
  color: rgba(15,23,42,.62);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
html[data-theme="dark"] .back-to-top{
  border-color: rgba(255,255,255,.12);
  box-shadow:
    0 16px 38px rgba(0,0,0,.34),
    0 10px 20px rgba(var(--brand-rgb), .18);
}
html[data-theme="dark"] .back-to-top-core{
  background: rgba(11,18,32,.26);
  border-color: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
html[data-theme="dark"] .back-to-top i{
  color: rgba(255,255,255,.96);
  text-shadow: none;
}
@media (max-width: 991.98px){
  .back-to-top{
    right: max(14px, calc(env(safe-area-inset-right) + 14px));
    bottom: max(102px, calc(env(safe-area-inset-bottom) + 102px));
    width: 52px;
    height: 52px;
  }
  body.sidebar-right .back-to-top{
    right: auto;
    left: max(14px, calc(env(safe-area-inset-left) + 14px));
  }
  body.has-plate-contract-form .back-to-top,
  body:has(#plateContractForm) .back-to-top{
    bottom: max(132px, calc(env(safe-area-inset-bottom) + 132px));
  }
  .back-to-top-progress{ width: 44px; height: 44px; }
}
@media (max-width: 767.98px){
  .sidebar{
    width:min(90vw, 312px);
  }
  .sidebar-logo-block{
    padding-top:.35rem;
    padding-bottom:.7rem;
  }
  .sidebar-logo-block .logo-big{
    width:82px;
    height:82px;
  }
  .topbar{
    padding:0 .55rem;
  }
  .top-actions{
    max-width:calc(100vw - 3.95rem);
    gap:.35rem;
  }
  .topbar .btn.btn-outline-light,
  .topbar .btn.btn-soft-primary{
    min-width:2.25rem;
    min-height:2.25rem;
    padding:.3rem .45rem;
  }
  .back-to-top{
    right: max(12px, calc(env(safe-area-inset-right) + 12px));
    bottom: max(92px, calc(env(safe-area-inset-bottom) + 92px));
    width: 50px;
    height: 50px;
  }
  body.sidebar-right .back-to-top{
    right: auto;
    left: max(12px, calc(env(safe-area-inset-left) + 12px));
  }
  body.has-plate-contract-form .back-to-top,
  body:has(#plateContractForm) .back-to-top{
    bottom: max(122px, calc(env(safe-area-inset-bottom) + 122px));
  }
  .back-to-top-progress{ width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce){
  .back-to-top{
    transition: none;
  }
}

/* ============ CONTENT ============ */
main.content-area{
  padding: calc(var(--topbar-h) + 16px) 16px 16px 16px;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left .2s ease;
  overflow-x:clip;
}
body.sidebar-collapsed main.content-area{ margin-left: var(--sidebar-w-collapsed); }
.content-area > *{
  max-width:100%;
}
.content-area .container,
.content-area .container-fluid,
.content-area .row > *,
.content-area [class*="col-"]{
  min-width:0;
}

/* ============ COLLAPSED (ikon-only) ============ */
body.sidebar-collapsed .sidebar{ width:var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar .nav-link{ justify-content:center; padding:.6rem 0; }
body.sidebar-collapsed .link-text{ display:none; }
/* Collapsed submenus keep icon-sized spacing. */
body.sidebar-collapsed .submenu{ display:none !important; }
body.sidebar-collapsed .submenu.show{ display:block !important; }

/* Collapsed menüden alt menü açıldığında geçici geniş görünüm tam menü gibi davranmalı. */










/* Logo davranışı */
body.sidebar-collapsed .sidebar-logo-block .logo-big{ display:none; }
body.sidebar-collapsed .sidebar-logo-block .logo-mini{ display:block; }
body.sidebar-collapsed .sidebar-logo-version{ display:none; }

/* İkon hizası/taşma önleme */
.sidebar .nav-link i,
.sidebar .submenu .nav-link i{ width:1.4rem; text-align:center; }
.sidebar .nav-link{ overflow:hidden; }

/* ============ MOBİL ============ */
@media (max-width: 991.98px){
  body.sidebar-open{
    overflow:visible;
  }
  body.sidebar-hidden .sidebar{
    transform: translateX(-100%);
    visibility:hidden;
    box-shadow:none;
    transition: transform .25s ease, visibility 0s linear .25s;
  }
  body.sidebar-open .sidebar{
    visibility:visible;
    transition: transform .25s ease;
  }
  body.sidebar-right.sidebar-hidden .sidebar{ transform: translateX(100%); }
  .sidebar{
    transform: translateX(0);
    transition: transform .25s ease;
    width: min(86vw, 320px);
    box-shadow: 12px 0 28px rgba(0,0,0,.25);
    padding-bottom:max(1rem, calc(env(safe-area-inset-bottom) + 1rem));
  }
  body.sidebar-right .sidebar{
    left:auto;
    right:0;
    box-shadow: -12px 0 28px rgba(0,0,0,.25);
  }
  .sidebar-top{
    min-height:100%;
  }
  
  

  .topbar{
    left:0;
    padding:0 .7rem;
    gap:.55rem;
  }  /* mobilde topbar tam genişlik */
  .topbar-left{
    min-width:0;
    flex:1 1 auto;
  }
  .top-actions{
    flex:0 0 auto;
    flex-wrap:nowrap;
    gap:.4rem;
    max-width:calc(100vw - 4.35rem);
    overflow-x:auto;
    scrollbar-width:none;
  }
  .top-actions::-webkit-scrollbar{
    display:none;
  }
  .topbar .btn.btn-outline-light,
  .topbar .btn.btn-soft-primary{
    min-width:2.4rem;
    min-height:2.4rem;
    padding:.35rem .55rem;
    border-radius:.8rem;
  }
  .topbar .dropdown-menu{
    max-width:min(90vw, 320px);
  }
  .global-search-dropdown{
    left: 0;
    right: 0;
  }
  main.content-area{
    margin-left:0;
    padding:calc(var(--topbar-h) + 16px) 12px 16px;
  }
  .content-area .container,
  .content-area .container-fluid{
    padding-left:.25rem !important;
    padding-right:.25rem !important;
  }
  .sidebar-toggle-btn{ display:none; }

  /* Mobil offcanvas arama başlık boyutu uyumu */
  .offcanvas-search .offcanvas-title{ font-size:1rem; }
  .global-search-dropdown__summary{
    padding: .8rem .9rem;
  }
  .global-search-option{
    grid-template-columns: auto 1fr;
  }
  .global-search-option__meta{
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
  }
}

/* yardımcı */
.dropdown-toggle::after{ display:none; }

/* =====================================================
   TOPBAR - Light/Dark görünürlük düzeltmeleri
   - Light modda sağdaki ikon butonları görünür olsun
   - Dark modda arama kutusu görünür olsun
   ===================================================== */

/* Light mod: template'te btn-outline-light kullanıyoruz; light modda görünmez olmasın */
html:not([data-theme="dark"]) .topbar .btn.btn-outline-light{
  --bs-btn-color: #334155;
  --bs-btn-border-color: rgba(15,23,42,.18);
  --bs-btn-hover-color: var(--brand);
  --bs-btn-hover-bg: rgba(var(--brand-rgb), .12);
  --bs-btn-hover-border-color: rgba(var(--brand-rgb), .35);
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: rgba(var(--brand-rgb), .92);
  --bs-btn-active-border-color: rgba(var(--brand-rgb), .92);
}

/* Light mod: ikonların çok sönük görünmesini engelle */
html:not([data-theme="dark"]) .topbar .btn.btn-outline-light i{
  opacity: 1;
}

/* Dark mod: arama input ve ikon zemin/çerçeve */
html[data-theme="dark"] .top-search-input{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.92);
}

html[data-theme="dark"] .top-search-input::placeholder{
  color: rgba(255,255,255,.55);
}

html[data-theme="dark"] .top-search-ico{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.65);
}

/* =====================================================
   GLOBAL THEME COMPATIBILITY
   - Bootstrap benzeri ortak bileşenleri data-theme ile eşitle
   - Sayfa bazlı CSS eksik kalsa bile dark/light kırılmasın
   ===================================================== */

.card,
.dropdown-menu,
.modal-content,
.offcanvas,
.list-group-item,
.accordion-item,
.toast,
.popover{
  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}

.form-control,
.form-select,
.input-group-text,
.form-check-input,
.btn,
.table,
.dropdown-item{
  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    box-shadow .18s ease;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .popover{
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-elevated);
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .offcanvas-header,
html[data-theme="dark"] .offcanvas-footer,
html[data-theme="dark"] .list-group-item + .list-group-item,
html[data-theme="dark"] .accordion-button{
  border-color: var(--border);
}

html[data-theme="dark"] .accordion-button{
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .accordion-button:not(.collapsed){
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text{
  background: var(--field-bg);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus{
  background: var(--field-bg);
  color: var(--text);
  border-color: rgba(var(--brand-rgb), .42);
  box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .18);
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .form-select::placeholder,
html[data-theme="dark"] textarea::placeholder{
  color: rgba(231,237,244,.44);
}

html[data-theme="dark"] .form-check-input{
  background-color: var(--field-bg-soft);
  border-color: var(--border);
}

html[data-theme="dark"] .form-check-input:checked{
  background-color: var(--brand);
  border-color: var(--brand);
}

html[data-theme="dark"] .table{
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .table > :not(caption) > * > *{
  background-color: transparent;
  color: var(--text);
  border-bottom-color: var(--border);
  box-shadow: none;
}

html[data-theme="dark"] .table-hover > tbody > tr:hover > *{
  background-color: rgba(var(--brand-rgb), .08);
  color: var(--text);
}

html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table > :not(caption) > .table-light > *,
html[data-theme="dark"] .table-light > th,
html[data-theme="dark"] .table-light > td{
  background-color: var(--surface-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .text-bg-light{
  background-color: rgba(148,163,184,.14) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .text-bg-dark{
  background-color: var(--surface-3) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .text-dark{
  color: var(--text) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .small.text-muted,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .text-secondary{
  color: var(--muted) !important;
}

html[data-theme="dark"] .dropdown-item{
  color: var(--text);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus{
  background: rgba(var(--brand-rgb), .12);
  color: var(--text);
}

html[data-theme="dark"] .btn-outline-secondary{
  color: var(--text);
  border-color: rgba(148,163,184,.26);
  background: rgba(148,163,184,.08);
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-secondary:focus{
  color: var(--text);
  border-color: rgba(148,163,184,.38);
  background: rgba(148,163,184,.16);
}

html[data-theme="dark"] .btn-outline-warning{
  color: #fbbf24;
  border-color: rgba(251,191,36,.35);
  background: rgba(251,191,36,.08);
}

html[data-theme="dark"] .btn-outline-warning:hover,
html[data-theme="dark"] .btn-outline-warning:focus{
  color: #0f172a;
  border-color: rgba(251,191,36,.5);
  background: #fbbf24;
}

html[data-theme="dark"] .btn-outline-dark{
  color: var(--text);
  border-color: rgba(148,163,184,.28);
  background: rgba(148,163,184,.08);
}

html[data-theme="dark"] .btn-outline-dark:hover,
html[data-theme="dark"] .btn-outline-dark:focus{
  color: var(--text);
  border-color: rgba(148,163,184,.4);
  background: rgba(148,163,184,.16);
}

html[data-theme="dark"] hr{
  border-color: var(--border);
  opacity: 1;
}

html[data-theme="dark"] pre{
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill{
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--field-bg) inset;
  transition: background-color 9999s ease-in-out 0s;
  caret-color: var(--text);
}

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] textarea:-webkit-autofill,
html[data-theme="dark"] select:-webkit-autofill{
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--field-bg) inset;
}

/* Shared notification dropdown: readable on desktop and narrow screens. */
#notificationBell .noti-menu { width: min(460px, calc(100vw - 24px)); min-width: 0; padding: 0; border-radius: 12px; overflow: hidden; }
#notificationBell .noti-items { max-height: min(62vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
#notificationBell .noti-item-button { display: grid !important; grid-template-columns: 24px minmax(0, 1fr); gap: 5px 9px !important; padding: 14px 16px !important; align-items: start !important; white-space: normal; text-align: left; }
#notificationBell .noti-item-button > i { grid-row: 1 / 4; margin-top: 3px; }
#notificationBell .noti-item-button > strong, #notificationBell .noti-item-button > span { font-size: .88rem; line-height: 1.4; }
#notificationBell .noti-item-button > small, #notificationBell .noti-item-button > time { grid-column: 2; color: var(--muted, #64748b); line-height: 1.45; font-size: .8rem; overflow-wrap: anywhere; }
#notificationBell .noti-item-button > time { font-size: .7rem; }
#notificationBell .has-notifications > .bi-bell { color: #dc2626; }
#notificationBell #notifCount { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 4px; font-size: 10px; background: #dc2626 !important; color: #fff !important; z-index: 3; }
#notificationBell #notifCount.d-none { display: none; }
@media (max-width: 575.98px) {
  #notificationBell .noti-menu { position: fixed !important; inset: 64px 12px auto 12px !important; transform: none !important; width: auto !important; max-height: calc(100dvh - 80px); }
  #notificationBell .noti-items { max-height: calc(100dvh - 220px); }
}

/* Compact topbar controls fit narrow phones without clipping the account menu. */
@media(max-width:400px){
  body.adl-app .topbar{padding-inline:10px;gap:6px}
  body.adl-app .topbar .top-actions>li.me-2{margin-right:4px!important}
  body.adl-app .topbar .top-actions .btn,body.adl-app .topbar #mobileMenuBtn{width:32px;min-width:32px;height:32px;min-height:32px;padding:5px;font-size:14px}
  body.adl-app .topbar .top-actions{gap:0}
  body.adl-app .topbar .lang-flag{width:16px;height:11px}
}

/* Desktop collapse/position preferences must not reduce the mobile shell. */
@media(max-width:991.98px){
  body.adl-app.sidebar-collapsed .topbar,body.adl-app.sidebar-right .topbar{left:0;right:0;width:100%}
  body.adl-app.sidebar-collapsed main.content-area,body.adl-app.sidebar-right main.content-area{margin-left:0;margin-right:0}
}
