/* Antalya panel — sol sidebar + içerik alanı */
:root {
  --sidebar-width: 270px;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e8ecef;
  --content-bg: #f4f7f6;
  --accent: #0d6efd;
  --accent-soft: rgba(13, 110, 253, 0.1);
  --text-muted-custom: #6c757d;
  /* Seçili menü — yüksek kontrast */
  --nav-active-bg: linear-gradient(105deg, #b6d4fe 0%, #d0e2ff 45%, #e7f1ff 100%);
  --nav-active-bg-solid: #cfe2ff;
  --nav-active-text: #032661;
  --nav-active-bar: #0b5ed7;
  --nav-active-ring: rgba(11, 94, 215, 0.35);
  --nav-active-sub-bg: #e7f1ff;
  --nav-active-sub-text: #084298;
}

body.app-body {
  min-height: 100vh;
  background: var(--content-bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/*
 * Ana iskelet: mobilde sütun; lg+ yatay flex (sidebar sabit genişlik, içerik kalan alan).
 * Böylece position:fixed + margin-left çakışması olmaz; görseldeki iki kolon düzeni.
 */
.app-layout {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

@media (min-width: 992px) {
  .app-layout {
    flex-direction: row;
    align-items: stretch;
  }
}

.card {
  border: none;
  box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.06);
}

.table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

.gorsel-thumb {
  max-height: 120px;
  object-fit: cover;
  border-radius: 0.35rem;
}

fieldset[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

/* ——— Mobil üst bar ——— */
.app-mobile-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #fff;
  border-bottom: 1px solid var(--sidebar-border);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-mobile-header .btn-menu {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sidebar-border);
  border-radius: 0.375rem;
  background: #fff;
  color: #334155;
}

.app-mobile-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ——— Sidebar (mobilde offcanvas; lg+ akışta flex sütunu) ——— */
.app-sidebar {
  width: var(--sidebar-width);
  max-width: min(100vw, var(--sidebar-width));
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

@media (min-width: 992px) {
  /* Bootstrap offcanvas-lg: büyük ekranda overlay yerine düzen içinde dursun */
  .app-sidebar.offcanvas-lg {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: auto !important;
    transform: none !important;
    visibility: visible !important;
    display: flex !important;
    flex-direction: column;
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    height: auto !important;
    min-height: 100vh;
    border-radius: 0 !important;
  }

  .app-sidebar.offcanvas-lg .offcanvas-body {
    height: 100% !important;
    max-height: none !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .app-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--content-bg);
  }
}

@media (max-width: 991.98px) {
  .app-main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
  }
}

.app-sidebar-brand {
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.app-sidebar-brand .brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  line-height: 1.25;
}

.app-sidebar-brand .brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted-custom);
  margin-top: 0.2rem;
}

.app-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.65rem 1rem;
}

/* Menü satırı */
.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.45rem;
  color: #334155;
  text-decoration: none;
  font-size: 0.92rem;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.app-nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.app-nav-link.active {
  background-color: var(--nav-active-bg-solid);
  background-image: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-weight: 700;
  box-shadow: inset 5px 0 0 var(--nav-active-bar);
  border: 1px solid var(--nav-active-ring);
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: -2px;
}

.app-nav-link.active .bi {
  color: var(--nav-active-bar);
  opacity: 1;
}

.app-nav-link.active .chev {
  color: var(--nav-active-text);
  opacity: 0.75;
}

.app-nav-link.active:hover {
  background-color: var(--nav-active-bg-solid);
  background-image: var(--nav-active-bg);
  filter: brightness(0.97);
  color: var(--nav-active-text);
}

.app-nav-link .bi {
  font-size: 1.15rem;
  opacity: 0.9;
  flex-shrink: 0;
}

.app-nav-link .chev {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.45;
  transition: transform 0.2s;
}

.app-nav-link[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}

.app-nav-sub {
  padding: 0.15rem 0 0.35rem 0.25rem;
}

.app-nav-sub .app-nav-link {
  padding: 0.4rem 0.65rem 0.4rem 2.1rem;
  font-size: 0.875rem;
}

.app-nav-sub .app-nav-link.active {
  background-color: var(--nav-active-sub-bg);
  background-image: linear-gradient(105deg, #d6e9ff 0%, var(--nav-active-sub-bg) 70%);
  color: var(--nav-active-sub-text);
  font-weight: 700;
  box-shadow: inset 4px 0 0 var(--nav-active-bar);
  border: 1px solid var(--nav-active-ring);
}

.app-nav-sub .app-nav-link.active .bi {
  color: var(--nav-active-bar);
}

.app-sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 0.85rem 1rem;
  background: #fafbfc;
}

.app-sidebar-footer .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

/* Masaüstü üst araç çubuğu */
.app-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 3.5rem;
  flex-shrink: 0;
}

.app-toolbar .toolbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.app-content {
  padding: 1.25rem 1.5rem 2rem;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 991.98px) {
  .app-content {
    padding: 1rem 1rem 2rem;
  }
}

/* Mobil: açık offcanvas içerikten üstte kalsın */
@media (max-width: 991.98px) {
  .app-sidebar.offcanvas {
    z-index: 1045;
  }
}
