/* =========================================================
   KLÜ Fitness Merkezi Online Başvuru Sistemi
   Ortak Şablon Stil Dosyası
   ========================================================= */

:root {
  /* --- Renk Paleti --- */
  --klu-navy: #182958;
  --klu-navy-600: #223670;
  /* hover / açık ton */
  --klu-navy-800: #101d40;
  /* koyu ton / active */
  --klu-white: #ffffff;
  --klu-gray: #dddddd;
  --klu-gray-100: #f4f4f5;
  /* sayfa arka planı */
  --klu-gray-300: #c7c7cc;
  --klu-black: #000000;
  --klu-text-muted: #5a5f6d;
  --klu-danger: #b3261e;
  --klu-success: #1e7a3d;
  --klu-warning: #a5680a;

  /* --- Tipografi --- */
  --font-display: 'Roboto', Arial, sans-serif;
  --font-body: 'Open Sans', Arial, sans-serif;

  /* --- Boyutlar --- */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(24, 41, 88, 0.06), 0 1px 3px rgba(24, 41, 88, 0.08);
  --shadow-md: 0 4px 14px rgba(24, 41, 88, 0.10);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--klu-gray-100);
  color: var(--klu-black);
  font-size: 15px;
  line-height: 1.55;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-title,
.page-title {
  font-family: var(--font-display);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Erişilebilirlik: klavye odağı her zaman görünür olmalı */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--klu-navy-600);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Hareket azaltma tercihine saygı */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* =========================================================
   1) SAYFA İSKELETİ
   ========================================================= */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------------------------------------------------------
   SIDEBAR
   --------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--klu-navy);
  color: var(--klu-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  transition: width var(--transition), transform var(--transition);
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  min-height: var(--topbar-h);
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-text {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.brand-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 400;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 10px 12px 6px;
  white-space: nowrap;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.sidebar .nav-link i,
.sidebar .nav-link svg {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-size: 1.05rem;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--klu-white);
}

.sidebar .nav-link.active {
  background: var(--klu-navy-600);
  color: var(--klu-white);
}

.sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  background: var(--klu-white);
  border-radius: 0 4px 4px 0;
}

.sidebar .nav-link .badge-dot {
  margin-left: auto;
  background: var(--klu-danger);
  color: var(--klu-white);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
}

/*
 * Yönetici menüsü öğrenci menüsünden daha uzun olduğu için düşük kullanılabilir
 * yüksekliğe sahip masaüstlerinde (ör. Windows %125 ölçeklendirme) kompaktlaşır.
 * Menü yine de sığmazsa yalnızca .sidebar-nav kaydırılabilir kalır.
 */
@media (min-width: 992px) and (max-height: 820px) {
  .admin-sidebar .sidebar-brand {
    gap: 10px;
    min-height: 58px;
    padding: 9px 16px;
  }

  .admin-sidebar .sidebar-brand img {
    width: 34px;
    height: 34px;
  }

  .admin-sidebar .brand-title {
    font-size: 0.88rem;
  }

  .admin-sidebar .brand-subtitle,
  .admin-sidebar .sidebar-footer {
    font-size: 0.68rem;
  }

  .admin-sidebar .sidebar-nav {
    padding: 7px 10px;
    scrollbar-width: thin;
  }

  .admin-sidebar .sidebar-section-label {
    padding: 6px 10px 3px;
    font-size: 0.63rem;
  }

  .admin-sidebar .nav-link {
    gap: 12px;
    margin-bottom: 1px;
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .admin-sidebar .nav-link i,
  .admin-sidebar .nav-link svg {
    font-size: 0.98rem;
  }

  .admin-sidebar .sidebar-footer {
    padding: 8px 16px;
  }
}

@media (min-width: 992px) and (max-height: 680px) {
  .admin-sidebar .sidebar-brand {
    min-height: 52px;
    padding-block: 7px;
  }

  .admin-sidebar .sidebar-brand img {
    width: 30px;
    height: 30px;
  }

  .admin-sidebar .sidebar-nav {
    padding-block: 4px;
  }

  .admin-sidebar .sidebar-section-label {
    padding-block: 4px 2px;
  }

  .admin-sidebar .nav-link {
    padding-block: 6px;
  }

  .admin-sidebar .sidebar-footer {
    display: none;
  }
}

/* --- Sidebar: daraltılmış (icon-rail) durum --- */
.app-shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
}

.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .sidebar-section-label,
.app-shell.sidebar-collapsed .nav-link span,
.app-shell.sidebar-collapsed .sidebar-footer {
  opacity: 0;
  width: 0;
  visibility: hidden;
}

.app-shell.sidebar-collapsed .nav-link .badge-dot {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar .nav-link {
  justify-content: center;
  gap: 0;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* ---------------------------------------------------------
   TOPBAR + CONTENT
   --------------------------------------------------------- */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
  min-width: 0;
}

.app-shell.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-w-collapsed);
}

.topbar {
  height: var(--topbar-h);
  background: var(--klu-white);
  border-bottom: 1px solid var(--klu-gray);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.sidebar-toggle-btn {
  border: none;
  background: transparent;
  color: var(--klu-navy);
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-toggle-btn:hover {
  background: var(--klu-gray-100);
}

.page-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--klu-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  border: none;
  background: transparent;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--klu-navy);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background var(--transition);
}

.icon-btn:hover {
  background: var(--klu-gray-100);
}

.icon-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--klu-danger);
  color: var(--klu-white);
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--klu-white);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: transparent;
}

.user-chip:hover {
  background: var(--klu-gray-100);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--klu-navy);
  color: var(--klu-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-chip-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--klu-black);
  line-height: 1.1;
}

.user-chip-role {
  font-size: 0.72rem;
  color: var(--klu-text-muted);
}

.logout-btn {
  color: var(--klu-danger);
}

/* Sağdaki dropdown menüler */
.dropdown-menu-klu {
  border: 1px solid var(--klu-gray);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px;
  min-width: 280px;
}

.dropdown-menu-klu .dropdown-header-klu {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--klu-navy);
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--klu-gray);
  margin-bottom: 6px;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.83rem;
  transition: background var(--transition);
}

.notif-item:hover {
  background: var(--klu-gray-100);
}

.notif-item .notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--klu-gray-100);
  color: var(--klu-navy);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-item .notif-text {
  color: var(--klu-black);
}

.notif-item .notif-time {
  color: var(--klu-text-muted);
  font-size: 0.74rem;
}

/* ---------------------------------------------------------
   CONTENT
   --------------------------------------------------------- */
.content {
  flex: 1;
  padding: 28px clamp(16px, 4vw, 36px);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.content-header {
  margin-bottom: 22px;
}

.content-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--klu-navy);
  margin: 0 0 4px;
}

.content-header p {
  color: var(--klu-text-muted);
  margin: 0;
  font-size: 0.92rem;
}

.card-klu {
  background: var(--klu-white);
  border: 1px solid var(--klu-gray);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-klu .card-body {
  padding: 20px;
}

.stat-card {
  padding: 18px 20px;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--klu-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--klu-navy);
  margin-top: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-pill.beklemede {
  background: #fdf3e2;
  color: var(--klu-warning);
}

.status-pill.onaylandi {
  background: #e6f4ea;
  color: var(--klu-success);
}

.status-pill.reddedildi {
  background: #fbe9e7;
  color: var(--klu-danger);
}

.table-klu {
  width: 100%;
  min-width: 760px;
  /* dar ekranlarda sıkışıp üst üste binmek yerine yatay kaydırma tetiklenir */
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table-klu thead th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--klu-text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--klu-gray);
  white-space: nowrap;
}

.table-klu tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--klu-gray);
  vertical-align: middle;
}

.table-klu tbody tr:hover {
  background: var(--klu-gray-100);
}

.table-klu tbody tr:last-child td {
  border-bottom: none;
}

.applications-table {
  min-width: 920px;
  table-layout: fixed;
}

.applications-table th:nth-child(1) {
  width: 12%;
}

/* Öğrenci */
.applications-table th:nth-child(2) {
  width: 12%;
}

/* Öğrenci No */
.applications-table th:nth-child(3) {
  width: 18%;
}

/* Fakülte */
.applications-table th:nth-child(4) {
  width: 17%;
}

/* Bölüm */
.applications-table th:nth-child(5) {
  width: 15%;
}

/* Tarih */
.applications-table th:nth-child(6) {
  width: 12%;
}

/* Durum */
.applications-table th:nth-child(7) {
  width: 14%;
}

/* İşlem */

.applications-table th:nth-child(2),
.applications-table td:nth-child(2),
.applications-table th:nth-child(5),
.applications-table td:nth-child(5),
.applications-table th:nth-child(6),
.applications-table td:nth-child(6),
.applications-table th:nth-child(7),
.applications-table td:nth-child(7) {
  white-space: nowrap;
}

/* --- Sıralanabilir sütun başlıkları --- */
.th-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 22px !important;
}

.th-sortable::after {
  content: "\2195";
  /* ↕ nötr - düz Unicode karakter, font'a bağımlı değil */
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--klu-gray-300);
  line-height: 1;
}

.th-sortable.sort-asc::after {
  content: "\25B2";
  /* ▲ artan */
  color: var(--klu-navy);
}

.th-sortable.sort-desc::after {
  content: "\25BC";
  /* ▼ azalan */
  color: var(--klu-navy);
}

/* --- Tablo üstü arama kutusu --- */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
}

.search-box-klu {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.search-box-klu i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--klu-text-muted);
  font-size: 0.9rem;
}

.search-box-klu input {
  width: 100%;
  border: 1px solid var(--klu-gray);
  border-radius: var(--radius);
  padding: 8px 12px 8px 34px;
  font-size: 0.87rem;
  font-family: var(--font-body);
  color: var(--klu-black);
  background: var(--klu-white);
  transition: border-color var(--transition);
}

.search-box-klu input:focus {
  outline: none;
  border-color: var(--klu-navy);
}

.search-box-klu input::placeholder {
  color: var(--klu-text-muted);
}

/* --- Sayfalama --- */
.pagination-klu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 16px;
}

.page-btn-klu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--klu-gray);
  background: var(--klu-white);
  color: var(--klu-navy);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.page-btn-klu:hover:not(.disabled):not(.active) {
  background: var(--klu-gray-100);
}

.page-btn-klu.active {
  background: var(--klu-navy);
  border-color: var(--klu-navy);
  color: var(--klu-white);
  cursor: default;
}

.page-btn-klu.disabled {
  color: var(--klu-gray-300);
  cursor: not-allowed;
  background: var(--klu-white);
}

.page-btn-klu.ellipsis {
  border: none;
  background: transparent;
  cursor: default;
  color: var(--klu-text-muted);
}

.table-empty-state {
  display: none;
  text-align: center;
  padding: 40px 20px;
  color: var(--klu-text-muted);
  font-size: 0.9rem;
}

.table-empty-state i {
  font-size: 1.8rem;
  color: var(--klu-gray-300);
  display: block;
  margin-bottom: 8px;
}

/* --- Küçük ekranlarda tablo araç çubuğu tam genişlik --- */
@media (max-width: 575.98px) {
  .search-box-klu {
    max-width: 100%;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

.btn-klu-primary,
.btn-klu-outline,
.btn-klu-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.btn-klu-primary {
  background: var(--klu-navy);
  color: var(--klu-white);
  border: 1px solid var(--klu-navy);
  border-radius: var(--radius);
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background var(--transition);
}

.btn-klu-primary:hover {
  background: var(--klu-navy-600);
  color: var(--klu-white);
}

.btn-klu-outline {
  background: transparent;
  color: var(--klu-navy);
  border: 1px solid var(--klu-navy);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition);
}

.btn-klu-outline:hover {
  background: var(--klu-navy);
  color: var(--klu-white);
}

.btn-klu-danger {
  background: transparent;
  color: var(--klu-danger);
  border: 1px solid var(--klu-danger);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  transition: all var(--transition);
}

.btn-klu-danger:hover {
  background: var(--klu-danger);
  color: var(--klu-white);
}

/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */
.footer-klu {
  border-top: 1px solid var(--klu-gray);
  background: var(--klu-white);
  padding: 16px clamp(16px, 4vw, 36px);
  text-align: center;
  font-size: 0.8rem;
  color: var(--klu-text-muted);
}

.footer-klu a {
  color: var(--klu-navy);
  font-weight: 600;
}

.footer-klu a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------
   OVERLAY (mobil sidebar arkaplanı)
   --------------------------------------------------------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 29, 64, 0.45);
  z-index: 1030;
}

.app-shell.sidebar-mobile-open .sidebar-overlay {
  display: block;
}

/* =========================================================
   2) RESPONSIVE DAVRANIŞ
   ========================================================= */

/* Tablet ve altı: sidebar varsayılan olarak gizli, off-canvas */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
    box-shadow: var(--shadow-md);
  }

  .app-shell.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .main-wrapper,
  .app-shell.sidebar-collapsed .main-wrapper {
    margin-left: 0;
  }

  .content {
    padding: 20px 16px;
  }
}

@media (max-width: 575.98px) {

  .user-chip-name,
  .user-chip-role {
    display: none;
  }

  .user-chip {
    padding: 6px;
  }

  .page-title {
    font-size: 0.92rem;
  }
}
