:root{
  --bg:#0f1222; --bg-2:#12162a; --text:#e8ecf1; --muted:#9aa4b2;
  --accent:#42d392; --danger:#ef4444; --card:#ffffff; --ink:#111827; --surface:#f3f5f9;
}
html[data-theme="dark"]{ --surface:#0b1020; --card:#0f152a; --ink:#e8ecf1; }

/* ===== LAYOUT SABİTLEME ===== */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font:14px/1.45 Inter,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink); background:var(--surface);
  display:flex; height:100vh; /* viewport yüksekliği */
}
select.locked {
  pointer-events: none;
  background-color: #f3f4f6;
  color: #374151;
}

/* Sidebar: SABİT (sticky) + kendi scroll'u */
.brand{display:flex; align-items:center; gap:10px; padding:18px 16px; border-bottom:1px solid #0006}
.brand-logo{display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#1b2142; color:var(--accent)}
.brand-text{font-weight:700; letter-spacing:.5px}

.menu{padding:12px 8px}
.menu-item{display:flex; align-items:center; gap:10px; color:var(--muted); text-decoration:none;
  padding:10px 12px; border-radius:10px; cursor:pointer; background:transparent; border:0}
.menu-item i{width:18px; text-align:center}
.menu-item:hover{background:#ffffff10; color:#fff}
.menu-item.active{background:#20c99722; color:#eafff5; border:1px solid #20c99755}
.sidebar-foot{margin-top:12px; padding:12px 16px; color:#c9d3df80; border-top:1px solid #0006}

.menu-group{margin:2px 0}
.menu-group .submenu{display:none; padding-left:36px}
.menu-group.open .submenu{display:block}
.menu-group .caret{margin-left:auto; transition:transform .18s ease}
.menu-group.open .caret{transform:rotate(90deg)}
.other-line{display:flex; align-items:center; justify-content:space-between}
.other-right{display:flex; align-items:center; gap:8px}
.check-btn{width:24px; height:24px; border-radius:6px; border:1px solid #3b4766; background:#1b2142; color:#d6e2ff; display:grid; place-items:center; cursor:pointer}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-1 {
  background: #16a34a20;
  color: #16a34a;
}

.status-0 {
  background: #f59e0b20;
  color: #f59e0b;
}

.status--1 {
  background: #dc262620;
  color: #dc2626;
}

.status--2 {
  background: #2563eb20;
  color: #2563eb;
}

html.dark .status-1 { background:#16a34a30; }
html.dark .status-0 { background:#f59e0b30; }
html.dark .status--1{ background:#dc262630; }
html.dark .status--2{ background:#2563eb30; }

.content{
  flex:1; min-width:0;
  height:100vh; overflow:auto;  /* <-- kendi scroll'u */
  padding:22px;
}

.select2-container--default .select2-selection--single {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px;
  height: 34px;
  display: flex;
  align-items: center;
}

.select2-selection__rendered {
  color: #111827 !important;
  padding: 0 10px;
  line-height: 34px;
}

.select2-selection__arrow {
  height: 34px;
  right: 6px;
}

.select2-dropdown {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15,23,42,.15);
}

.select2-results__option {
  color: #111827 !important;
  padding: 8px 10px;
}

.select2-results__option--highlighted {
  background: #2563eb !important;
  color: #fff !important;
}

.select2-results__option[aria-selected="true"].select2-results__option--highlighted {
  background: #2563eb !important;
  color: #fff !important;
}

.select2-search--dropdown .select2-search__field {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px;
  color: #111827 !important;
  height: 32px;
  padding: 0 8px;
}

/* clear (x) istersen kapat */
.select2-selection__clear {
  display: none;
}

/* Üst bar */
.topbar{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.page-title{margin:0; font-size:20px; font-weight:700; color:#1b2559}
html[data-theme="dark"] .page-title{color:#dbe6ff}
.top-actions{display:flex; align-items:center; gap:10px}
.icon-btn{width:38px; height:38px; border-radius:10px; border:1px solid #e5e7eb; background:#fff; cursor:pointer; display:grid; place-items:center; color:#334155}
html[data-theme="dark"] .icon-btn{background:#121a36; border-color:#263154; color:#d1dbff}
.avatar{padding:0; border:0; background:transparent; width:38px; height:38px; border-radius:12px; overflow:hidden; cursor:pointer}
.avatar img{width:100%; height:100%}
.btn{height:38px; padding:0 14px; border-radius:10px; border:0; display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-weight:600}
.btn-primary{background:var(--accent); color:#072a1f}
.btn.ghost{background:#eef2f7; color:#334155}
.btn.danger{background:var(--danger); color:#fff}

/* Bildirim açılırı */
.notif{position:relative}
.notif .dot{position:absolute; right:6px; top:6px; width:8px; height:8px; background:#ef4444; border-radius:999px}
.notif-menu{position:absolute; right:0; top:46px; width:280px; background:var(--card); border:1px solid #e5e7eb; border-radius:12px; box-shadow:0 12px 28px rgba(15,23,42,.15); display:none; overflow:hidden; z-index:5}
html[data-theme="dark"] .notif-menu{border-color:#263154}
.notif-menu.open{display:block}
.notif-head{padding:10px 12px; font-weight:700; background:#f7f9fc; border-bottom:1px solid #e5e7eb}
html[data-theme="dark"] .notif-head{background:#0f1836; border-color:#263154}
.notif-item{padding:10px 12px; display:flex; gap:8px; align-items:center; border-bottom:1px solid #f0f2f6}
html[data-theme="dark"] .notif-item{border-color:#1b254a}

/* Filtreler */
.filterbar{display:flex; gap:12px; align-items:flex-end; margin:10px 0 14px; flex-wrap:wrap}
.filter-item{display:flex; flex-direction:column; gap:6px}
.filter-item label{font-weight:600; color:#475569; font-size:13px}
html[data-theme="dark"] .filter-item label{color:#c7d2fe}
.filter-item input{height:36px; padding:0 12px; border-radius:10px; border:1px solid #e5e7eb; background:#fff; color:#111827; min-width:220px}
html[data-theme="dark"] .filter-item input{background:#121a36; border-color:#263154; color:#e6ebff}

/* Kart & tablo */
.card{background:var(--card); border-radius:14px; box-shadow:0 8px 24px rgba(15,23,42,.08); border:1px solid #e8ecf1; overflow:hidden}
html[data-theme="dark"] .card{border-color:#263154; box-shadow:none}
.table-wrap{overflow:auto}
.table{width:100%; border-collapse:collapse; min-width:900px}
.table thead th{background:#f7f9fc; color:#334155; font-weight:700; text-align:left; border-bottom:1px solid #e5e7eb; padding:12px 14px; white-space:nowrap}
html[data-theme="dark"] .table thead th{background:#0f1836; color:#d1dbff; border-color:#263154}
.table thead th .sort-ico{margin-left:6px; opacity:.7}
.table tbody td{padding:14px; border-bottom:1px solid #f0f2f6; color:#111827cc}
html[data-theme="dark"] .table tbody td{border-color:#1b254a; color:#e6ebffcc}
.table tbody tr:hover{background:#fafcff}
html[data-theme="dark"] .table tbody tr:hover{background:#0f1836}
.actions{gap:8px; justify-content:flex-end; align-items:center;}
.action{width:34px; height:34px; border-radius:999px; border:0; cursor:pointer; display:grid; place-items:center; color:#fff}
.action.edit{background:#3b82f6}
.action.view{background:#3b82f6}
.action.delete{background:var(--danger)}
a {text-decoration: none;}

/* Sayfalama */
.pagination-bar{display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-top:1px solid #e5e7eb; background:#fafcff}
html[data-theme="dark"] .pagination-bar{background:#0f1836; border-color:#263154}
.page-size{display:flex; align-items:center; gap:8px}
.page-size select{height:32px; border:1px solid #e5e7eb; border-radius:8px; padding:0 8px; background:#fff}
html[data-theme="dark"] .page-size select{background:#121a36; border-color:#263154; color:#dbe6ff}
.page-nav{display:flex; align-items:center; gap:12px}
#rangeLabel{color:#6b7280}
.pager-buttons{display:flex; gap:6px}
.pager{width:34px; height:34px; border-radius:8px; border:1px solid #e5e7eb; background:#fff; display:grid; place-items:center; cursor:pointer}
.pager:disabled{opacity:.5; cursor:not-allowed}
html[data-theme="dark"] .pager{background:#121a36; border-color:#263154; color:#dbe6ff}

/* Modallar ve Form */
.modal{position:fixed; inset:0; display:none}
.modal[aria-hidden="false"]{display:block}
.modal-backdrop{position:absolute; inset:0; background:#0b1020b3; backdrop-filter:blur(1px)}
.modal-dialog{position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:min(900px,92vw); background:var(--card); border-radius:14px; border:1px solid #e5e7eb; box-shadow:0 24px 50px rgba(15,23,42,.35); overflow:hidden}
.modal-dialog.small{width:min(520px,92vw)}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid #e5e7eb}
.modal-body{padding:16px}
.modal-foot{padding:12px 16px; display:flex; justify-content:flex-end; gap:8px; border-top:1px solid #e5e7eb}

.form-row{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.form-item{display:flex; flex-direction:column; gap:6px}
.form-item label{font-weight:600; color:#475569}
.form-item input, .form-item textarea{height:38px; padding:0 12px; border-radius:10px; border:1px solid #e5e7eb; background:#fff; color:#111827}
.form-item textarea{height:auto; padding:10px 12px}
.invalid{border-color:#ef4444 !important}
.error{display:none; color:#ef4444; font-size:12px}
.req{color:#ef4444}

/* === SIDEBAR FIX === */
/* Sidebar’daki tüm linkleri kontrol altına al */
.sidebar a,
.sidebar a:visited {
  color: inherit;            /* mor visited’a son */
  text-decoration: none;     /* alt çizgiyi sil */
}

/* Alt menü container ve linkleri satır satır göster */
.menu-group .submenu {
  display: none;
  padding: 6px 0;            /* biraz nefes alanı */
}

.menu-group.open .submenu {
  display: block;
}

/* Alt menü linkleri: sınıf olmasa da çalışsın */
.menu-group .submenu a,
.menu-group .submenu .submenu-item {
  display: block;            /* satır satır */
  padding: 8px 12px 8px 36px;
  color: #cdd6e6;            /* sidebar tonu */
  border-radius: 8px;
  line-height: 1.2;
  white-space: nowrap;       /* taşırma kontrolü */
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-group .submenu a:hover,
.menu-group .submenu .submenu-item:hover {
  background: #ffffff10;
  color: #fff;
}

/* “>” okunun hizası */
.menu-group .caret {
  margin-left: auto;
  transition: transform .18s ease;
}
.menu-group.open .caret {
  transform: rotate(90deg);
}

/* Soldaki grup başlıklarının rengi sabit kalsın (visited etkilenmesin) */
.menu .menu-item,
.menu .menu-item:visited {
  color: var(--muted);
}
.menu .menu-item:hover {
  background: #ffffff10;
  color: #fff;
}
.sidebar a, .sidebar a:visited { color: inherit; text-decoration: none; }
.menu-group .submenu a { display:block; padding:8px 12px 8px 36px; color:#cdd6e6; border-radius:8px; }
.menu-group .submenu a:hover { background:#ffffff10; color:#fff; }

.filterbar, .filter-actions { display:flex; align-items:center; gap:10px; }
.filterbar { flex-wrap:wrap; }
.filter-actions { margin-left:auto; }

.pagination-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:10px 14px}
.page-nav{display:flex;align-items:center;gap:12px;margin-left:auto}
.pager-buttons{display:flex;gap:6px}
.pager.disabled{opacity:.45;pointer-events:none}

.filterbar{
  display:flex; gap:12px; align-items:center;
  margin-bottom:12px;
}
.filterbar .spacer{ flex:1; }
.filterbar .btn{ margin-left:auto; }

th a.th-link{ color:inherit; text-decoration:none; }
th a.th-link:visited{ color:inherit; }
th a.th-link:focus,
th a.th-link:active{ outline:none; color:inherit; }



.switch {position: relative;display: inline-block;width: 42px;height: 22px;}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {position: absolute;cursor: pointer;inset: 0;background: #ccc;border-radius: 22px;transition: .2s;}
.switch .slider:before {content: "";position: absolute;height: 18px;width: 18px;left: 2px;bottom: 2px;background: #fff;border-radius: 50%;transition: .2s;}
.switch input:checked + .slider {background: #22c55e;}
.switch input:checked + .slider:before {transform: translateX(20px);}



.user-wrap {position: relative;margin-left: 12px;}

.user-pill {
  border: none;
  background: var(--primary, #2563eb);
  color: #fff;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

#notifMenu,
#userMenu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--surface, #fff);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
  padding: 6px 0;
  display: none;
  z-index: 100;
}

#notifMenu.open,#userMenu.open {display: block;}

#notifMenu .dropdown-item,
#userMenu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: inherit;
  text-decoration: none;
}

a.action.view {
  background-color: #22c55e; 

}

a.action.view i {
  color: inherit; 
}

a.action.view:hover {
  background-color: #16a34a;
}



#notifMenu .dropdown-item:hover,#userMenu .dropdown-item:hover {background: rgba(148, 163, 184, 0.12);}

.submenu-item.active {background:#20c99722; color:#eafff5; border:1px solid #20c99755;}

.modal-dialog{ max-width:760px; }
.modal-body{ max-height:68vh; overflow:auto; padding:10px 12px; }

.form-grid{ display:grid; gap:8px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.form-item.full{ grid-column:1 / span 2; }

/* kompakt alanlar */
.form-item label{ font-size:.92rem; color:#556; margin-bottom:4px; display:block; }
.form-item input,
.form-item select,
.form-item textarea{
  font-size:14px; line-height:1.2;
  padding:6px 10px; border-radius:8px; min-height:34px;
}
.form-item textarea{ min-height:84px; }

/* tablo alt-yazıları */
.table .sub{ display:block; font-size:.82em; color:#667; margin-top:2px; }

.select-locked { opacity:.7; pointer-events:none; }

:root{
  --blue: #3b82f6;        /* primary */
  --blue-hover:#2563eb;
  --red:#ef4444;          /* danger  */
  --red-hover:#dc2626;
}

/* Aksiyon butonları renk override */
.table .actions .btn.btn-primary{
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}
.table .actions .btn.btn-primary:hover{
  background: var(--blue-hover) !important;
  border-color: var(--blue-hover) !important;
}

.table .actions .btn.danger{
  background: var(--red) !important;
  border-color: var(--red) !important;
  color:#fff !important;
}
.table .actions .btn.danger:hover{
  background: var(--red-hover) !important;
  border-color: var(--red-hover) !important;
}

/* ikon hizası – küçük siyah nokta vs. olmasın */
.table .actions .btn i{
  line-height: 1;
  font-size: 18px;
}
.click-row {
    cursor: pointer;
}

.click-row:hover {
    background: rgba(0,0,0,0.04);
}
html.dark .click-row:hover {
    background: rgba(255,255,255,0.06);
}

.actions .download { background:#16a34a; }
/* mobil */
@media (max-width: 900px){
  .modal-dialog{ max-width:96vw; }
  .form-grid{ grid-template-columns:1fr; }
  .form-item.full{ grid-column:auto; }
}

@media (max-width:760px){
  .content{padding:14px}
  .table{min-width:720px}
  .filterbar{flex-direction:column; align-items:stretch}
  .form-row{grid-template-columns:1fr}
}


/* ===== SIDEBAR BASE ===== */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  transition: transform .25s ease;
}

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
}

@media (max-width: 1024px) {
  .hamburger {
    display: inline-flex;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
}

.sidebar {
  z-index: 1200;
}

/* ===== SIDEBAR BASE ===== */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg,var(--bg),var(--bg-2));
  color: var(--text);
  border-right: 1px solid #0003;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

/* ===== MOBILE DRAWER ===== */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1100;
  }

  .content {
    margin-left: 0 !important;
  }
}

.topbar {
  position: static;
  top: 0;
  z-index: 1300;
}


.hamburger {
  position: relative;
  z-index: 1301;
}


.hamburger {
  width: 40px;
  height: 40px;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
}

.hamburger i {
  font-size: 18px;
  line-height: 1;
}

.hamburger {
  display: none;
}

@media (max-width: 1024px) {
  .hamburger {
    display: inline-flex;
  }
}

@media (max-width: 1024px) {
  .topbar {
    z-index: 1000;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    z-index: 1300;
  }
}

@media (max-width: 1024px) {
  body.sidebar-open .topbar {
    pointer-events: none;
  }
}

.sidebar-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 20px;
  cursor: pointer;
  display: none;
}

@media (max-width: 1024px) {
  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

body.sidebar-open .hamburger {
  display: none !important;
}

.sidebar {
  overflow-y: auto;
  scrollbar-width: none;  
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}