/* Selçuk Üniversitesi Dashboard - Ek stiller */

/* --- Layout: sol sidebar + ana içerik --- */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}
.sidebar {
  width: 280px;
  min-width: 280px;
  background: white;
  border-right: 1px solid #e2e8f0;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.25s ease, min-width 0.25s ease, padding 0.25s ease;
}
.dashboard-layout.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}
.sidebar-toggle {
  flex-shrink: 0;
  width: 32px;
  align-self: flex-start;
  margin-top: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #e2e8f0;
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  height: 40px;
}
.sidebar-toggle:hover {
  background: #f8fafc;
  color: #334155;
}
.sidebar-toggle__icon {
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 19l-7-7 7-7'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  transition: transform 0.25s ease;
}
.dashboard-layout.sidebar-collapsed .sidebar-toggle {
  border-left: 1px solid #e2e8f0;
  border-radius: 0 8px 8px 0;
}
.dashboard-layout.sidebar-collapsed .sidebar-toggle__icon {
  transform: rotate(180deg);
}
.sidebar__header {
  margin-bottom: 1rem;
}
.sidebar__title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
}
.sidebar__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.filter-select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
}
.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
/* Açılır çoklu seçim (Streamlit tarzı) */
.multiselect-wrap {
  position: relative;
  width: 100%;
}
.multiselect-trigger {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.65rem;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' width='18' height='18'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 0.5rem center;
  background-size: 18px;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  display: flex;
  align-items: center;
}
.multiselect-trigger__text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multiselect-trigger:hover {
  border-color: #cbd5e1;
}
.multiselect-trigger:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.multiselect-clear {
  position: absolute;
  right: 1.75rem;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #e2e8f0;
  color: #64748b;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.multiselect-clear:hover {
  background: #f87171;
  color: #fff;
}
.multiselect-wrap.has-selection .multiselect-clear {
  display: inline-flex;
}
.multiselect-clear:focus {
  outline: none;
}
.multiselect-clear__icon {
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}
.multiselect-wrap.is-open .multiselect-trigger {
  border-color: #3b82f6;
  border-radius: 8px 8px 0 0;
}
.multiselect-placeholder {
  color: #94a3b8;
}
.multiselect-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: -1px;
  max-height: 260px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #3b82f6;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 50;
  flex-direction: column;
}
.multiselect-wrap.is-open .multiselect-dropdown {
  display: flex;
}
.multiselect-search-wrap {
  flex-shrink: 0;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.multiselect-search {
  width: 100%;
  padding: 0.35rem 0.5rem 0.35rem 1.75rem;
  font-size: 0.8125rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' width='14' height='14'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat 0.4rem center;
  background-size: 14px;
  color: #334155;
}
.multiselect-search::placeholder {
  color: #94a3b8;
}
.multiselect-search:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: #fff;
}
.multiselect-dropdown-list {
  overflow-y: auto;
  max-height: 200px;
}
.multiselect-option {
  padding: 0.4rem 0.65rem;
  font-size: 0.875rem;
  color: #334155;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.multiselect-option.multiselect-option-hidden {
  display: none;
}
.multiselect-option:last-child {
  border-bottom: none;
}
.multiselect-option:hover {
  background: #f8fafc;
}
.multiselect-option.is-selected {
  background: #eff6ff;
  color: #1e40af;
}
.multiselect-option.is-selected::after {
  content: ' ✓';
  font-weight: bold;
}
.filter-select--multiple {
  padding: 0.25rem 0;
  height: auto;
}
.filter-select--multiple option {
  padding: 0.35rem 0.65rem;
}
.filter-radios,
.filter-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.filter-checkboxes {
  margin-bottom: 0.15rem;
}
.filter-hint {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: -0.2rem;
  margin-bottom: 0;
}
.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
}
.radio-label input,
.checkbox-label input {
  margin: 0;
}
.filter-reset-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.filter-reset-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.main {
  flex: 1;
  min-width: 0;
}

/* --- Kart başlık + indirme butonu --- */
.card-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.card-section__header .section-title {
  margin-bottom: 0;
  flex: 1;
}
.card-section--kpis .card-section__header {
  display: none;
}
.download-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.download-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #3b82f6;
}
.download-btn__icon {
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* --- Tablar --- */
.tab-btn {
  border-bottom: 2px solid transparent;
}
.tab-btn.active {
  border-bottom-color: rgb(30 41 59);
  color: rgb(30 41 59);
}
.tab-pane {
  display: block;
}
.tab-pane.hidden {
  display: none !important;
}

/* --- Genel gizleme --- */
#kpis:not(.hidden) {
  display: grid;
}
#loading.hidden,
#error.hidden {
  display: none !important;
}

/* --- KPI kartları --- */
.kpi-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  padding: 1rem 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}
.kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

/* --- Bölüm / kart bölümleri --- */
.card-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

/* --- Tablo kaydırma alanı: sabit yükseklik, dikey + yatay scroll --- */
.table-toolbar {
  margin-bottom: 0.75rem;
}
.table-search-input {
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' width='18' height='18'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat 0.65rem center;
  color: #334155;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.table-search-input::placeholder {
  color: #94a3b8;
}
.table-search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.table-scroll-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0;
}
.table-scroll-wrap--short {
  max-height: 220px;
}
/* Scrollbar görünümü (isteğe bağlı) */
.table-scroll-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.table-scroll-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.table-scroll-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.table-scroll-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- Tablolar: sticky thead + satır stilleri --- */
.data-table {
  border-collapse: collapse;
  min-width: 100%;
}
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: 0 1px 0 #e2e8f0;
}
.data-table thead th {
  padding: 0.75rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  text-align: left;
  white-space: nowrap;
}
.data-table thead th.text-right {
  text-align: right;
}
.data-table thead th.sortable-th {
  cursor: pointer;
  user-select: none;
}
.data-table thead th.sortable-th:hover {
  background: rgba(0, 0, 0, 0.04);
}
.data-table tbody tr.row-hidden {
  display: none;
}
.data-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s;
}
.data-table tbody tr:hover {
  background-color: #f8fafc;
}
.data-table tbody tr:last-child {
  border-bottom: none;
}
.data-table tbody td {
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: #334155;
}
.data-table tbody td.text-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Grafik alanları --- */
.chart-in-card {
  height: 280px;
  position: relative;
}
.chart-in-card--tall {
  height: 320px;
}
canvas {
  max-width: 100%;
}

/* --- En Başarılı kartları --- */
.success-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 0.5rem;
}
@media (min-width: 768px) {
  .success-cards {
    grid-template-columns: 0.3fr 0.4fr 0.3fr;
  }
}
.success-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
}
.success-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.success-list-scroll {
  max-height: 330px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 6px;
}
.success-list-scroll::-webkit-scrollbar {
  width: 6px;
}
.success-list-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}
.success-list-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.success-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: #475569;
}
.success-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.4;
}
.success-list li:last-child {
  border-bottom: none;
}
.success-list li:hover {
  color: #1e293b;
}
