/* ============================================================
   table.css — Kurs Yönetim Sistemi Tablo Bileşeni
   Modern, responsive, sıralanabilir ve sayfalanabilir tablolar
   ============================================================ */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  container-type: inline-size;
  scrollbar-width: thin;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  color: var(--color-ink);
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--color-surface-hover);
  color: var(--color-ink-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  user-select: none;
}

.table th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.table th.sortable:hover {
  color: var(--color-accent);
}

.table th .sort-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.25rem;
  opacity: 0.5;
}

.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  transition: background-color var(--transition-fast);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-hover tbody tr:hover td {
  background-color: var(--color-surface-hover);
}

/* ── TABLO HOVER DEVRE DIŞI BIRAKMA & YÖNETİCİ TABLOSU ── */
.table-no-hover tbody tr:hover td,
.table-no-hover tbody tr:hover,
#managers-table tbody tr:hover td,
#managers-table tbody tr:hover {
  background-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Yöneticiler Kompakt & Dinamik Tablo Tasarımı */
.managers-compact-table th {
  padding: 0.75rem 0.95rem;
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background-color: var(--color-surface-hover);
}

.managers-compact-table td {
  padding: 0.75rem 0.95rem;
  font-size: 0.85rem;
  vertical-align: middle;
}

.managers-compact-table .btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── TABLO FİLTRE VE ARAMA ÇUBUĞU ── */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.table-search {
  max-width: 320px;
  width: 100%;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── SAYFALAMA (Pagination) ── */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface);
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-item .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-item .page-link:hover {
  background-color: var(--color-surface-hover);
  border-color: var(--color-ink-muted);
}

.page-item.active .page-link {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
  font-weight: 700;
}

.page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── BOŞ DURUM (Empty State) ── */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-hover);
  color: var(--color-ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.empty-state-icon svg {
  width: 2rem;
  height: 2rem;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 0.375rem;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--color-ink-muted);
  max-width: 360px;
  margin-bottom: 1.25rem;
}

/* ── KOMPAKT TABLO (Compact & Dense Presentation) ── */
.table-compact th {
  padding: 0.625rem 0.875rem;
  font-size: 0.71875rem;
}

.table-compact td {
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
}

/* Sabit sağ aksiyon kolonu */
.table-sticky-actions th:last-child,
.table-sticky-actions td:last-child {
  position: sticky;
  right: 0;
  background-color: var(--color-surface);
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.04);
  z-index: 2;
}

.table-hover tbody tr:hover td:last-child {
  background-color: var(--color-surface-hover);
}

/* ── MOBİL UYUMLU KART LİSTESİ (Table-to-Cards Adaptive View) ── */
.dash-mobile-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
}

.dash-mobile-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dash-mobile-card:hover {
  box-shadow: var(--shadow-md);
}

.dash-mobile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--color-border);
}

.dash-mobile-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-ink);
}

.dash-mobile-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8125rem;
}

.dash-mobile-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-mobile-label {
  color: var(--color-ink-muted);
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

.dash-mobile-value {
  color: var(--color-ink);
  font-size: 0.8125rem;
  text-align: right;
  font-weight: 500;
}

.dash-mobile-card-footer {
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .dash-mobile-cards {
    display: none !important;
  }
}

@media (max-width: 767.98px) {
  .dash-desktop-table {
    display: none !important;
  }
}
