@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --color-bg: #050506;
  --color-bg-alt: #09090b;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-surface-hover: rgba(255, 255, 255, 0.08);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.16);
  --color-text: #f5f5f7;
  --color-muted: rgba(245, 245, 247, 0.6);
  --color-soft: rgba(245, 245, 247, 0.08);
  --gradient-accent: linear-gradient(135deg, #ffffff 0%, #f3f4f6 45%, #d1d5db 100%);
  --gradient-accent-soft: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(209, 213, 219, 0.12));
  --shadow-elevated: 0 40px 120px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 24px 64px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow-anchor: none; scroll-behavior: smooth; }
body { scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.04), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(148, 163, 184, 0.05), transparent 40%),
    radial-gradient(circle at 50% 70%, rgba(15, 23, 42, 0.15), transparent 55%),
    linear-gradient(180deg, #08090f 0%, #0c0d15 35%, #0e0d19 65%, #07060c 100%);
  background-attachment: fixed;
  color: var(--color-text);
  position: relative;
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(10, 14, 35, 0.9) 0%, rgba(7, 9, 20, 0.55) 40%, rgba(5, 6, 12, 0.25) 70%),
    linear-gradient(310deg, rgba(2, 3, 8, 0.85) 0%, rgba(2, 3, 8, 0.25) 60%),
    radial-gradient(circle at 20% 75%, rgba(34, 71, 132, 0.25), transparent 58%),
    radial-gradient(circle at 78% 18%, rgba(12, 16, 30, 0.7), transparent 48%);
  background-color: rgba(2, 3, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(32px) saturate(130%);
  -webkit-backdrop-filter: blur(32px) saturate(130%);
  box-shadow:
    inset 0 0 160px rgba(0, 0, 0, 0.65),
    inset 0 -80px 120px rgba(1, 2, 4, 0.85);
  opacity: 0.92;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(0, 0, 0, 0.45) 0%, transparent 45%),
    linear-gradient(315deg, rgba(1, 2, 6, 0.8) 0%, transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 6px),
    radial-gradient(circle at 25% 20%, rgba(46, 86, 150, 0.18), transparent 55%),
    radial-gradient(circle at 70% 75%, rgba(0, 0, 0, 0.75), transparent 70%);
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
  filter: blur(180px);
  opacity: 0.82;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body {
    background-attachment: scroll;
  }
}

.app { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 32px 24px; 
  position: relative;
  z-index: 1;
}

.topbar h1 { 
  margin: 0 0 24px; 
  font-size: 42px; 
  font-weight: 800; 
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.toolbar { display: flex; gap: 8px; align-items: center; margin: 8px 0 16px; }
.toolbar .spacer { flex: 1; }

.user-role-badge {
  min-width: 28px;
  text-align: center;
  font-size: 20px;
  line-height: 1;
  opacity: 0.9;
}

.tabs { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.tab {
  background: linear-gradient(135deg, #0f1014 0%, #25272f 100%);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 24px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.tab:hover { 
  background: linear-gradient(135deg, #15161b 0%, #2f3139 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.tab:focus,
.tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 8px 20px rgba(255, 255, 255, 0.18);
}
.tab:active { transform: none; }
.tab.active { 
  background: linear-gradient(135deg, #1a1b20 0%, #2f323a 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.12);
}

.section {
  display: none;
  opacity: 0;
  transform: translateY(32px);
}
.section.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: sectionFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes sectionFade {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: none;
  transition: all 0.3s ease;
}

.form-row { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: center; margin-bottom: 16px; }
.form-row.password-row { grid-template-columns: 1fr; gap: 10px; }
.form-row.password-row input { width: 100%; }
.label-with-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.label-with-toggle label {
  margin: 0;
}
.form-row label { 
  color: rgba(255, 255, 255, 0.9); 
  font-weight: 600;
  font-size: 14px;
}
.form-row input[type="text"], .form-row input[type="date"], .form-row input[type="number"], .form-row input[type="email"], .form-row input[type="password"], .form-row input[type="time"] {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.form-row input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.form-row input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.auth-gate .form-row input[type="text"],
.auth-gate .form-row input[type="password"],
.auth-gate .form-row input[type="email"] {
  background: #141824 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #f3f4f6 !important;
  border-radius: 12px;
  padding: 12px 16px;
}
.auth-gate .form-row input[type="text"]:focus,
.auth-gate .form-row input[type="password"]:focus,
.auth-gate .form-row input[type="email"]:focus {
  background: #1c2130 !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.primary {
  background: linear-gradient(135deg, #131419 0%, #23242b 100%);
  color: #e5e7eb;
  color: #eef0f4;
  border: none;
  padding: 14px 32px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.primary:hover::before {
  left: 100%;
}

.primary:hover { 
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
.primary:active { transform: none; }

.error-text { color: #f87171; font-size: 14px; }

.table-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }

.search-row { margin-bottom: 16px; }
.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.collapse-toggle {
  display: none;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.collapse-toggle:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.mobile-subtext {
  display: none;
  font-size: 13px;
  color: var(--color-muted);
}

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid transparent; backdrop-filter: blur(10px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.badge.near { background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(229, 231, 235, 0.25)); color: #ffffff; border-color: rgba(255, 255, 255, 0.4); }
.badge.expired { background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(185, 28, 28, 0.2)); color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
.badge.ok { background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(5, 150, 105, 0.2)); color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.badge.removed { background: linear-gradient(135deg, rgba(203, 213, 225, 0.2), rgba(71, 85, 105, 0.2)); color: #cbd5e1; border-color: rgba(203, 213, 225, 0.4); }

.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.01);
  margin: 0 -4px;
  padding: 0 4px 4px;
}
.table-container::-webkit-scrollbar {
  height: 8px;
}
.table-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.table-container table {
  min-width: 720px;
}

#activeTable, #expiredTable, #removedTable { width: 100%; border-collapse: collapse; border-radius: 16px; overflow: hidden; }
#activeTable th, #activeTable td, #expiredTable th, #expiredTable td, #removedTable th, #removedTable td {
  padding: 10px 12px;
  text-align: left;
}

.col-role {
  width: 50px;
  text-align: center;
  font-size: 1.1rem;
  opacity: 0.9;
}

#activeTable th, #activeTable td, #expiredTable th, #expiredTable td, #removedTable th, #removedTable td {
  padding: 10px 12px;
  text-align: left;
}

#activeTable th, #expiredTable th, #removedTable th { color: rgba(255, 255, 255, 0.9); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; background: rgba(255, 255, 255, 0.05); }
.table-select input[type="checkbox"],
#activeTable input[type="checkbox"],
#expiredTable input[type="checkbox"],
#removedTable input[type="checkbox"] {
  width: 22px;
  height: 22px;
  appearance: none;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #1d1f26 0%, #0e1015 100%);
  box-shadow:
    inset 2px 2px 5px rgba(0, 0, 0, 0.65),
    inset -2px -2px 4px rgba(255, 255, 255, 0.04),
    0 6px 16px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.table-select input[type="checkbox"]::after,
#activeTable input[type="checkbox"]::after,
#expiredTable input[type="checkbox"]::after,
#removedTable input[type="checkbox"]::after {
  content: '\2713';
  color: #1d2331;
  font-size: 14px;
  font-weight: 700;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%) scale(0.6);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.table-select input[type="checkbox"]:checked,
#activeTable input[type="checkbox"]:checked,
#expiredTable input[type="checkbox"]:checked,
#removedTable input[type="checkbox"]:checked {
  border-color: rgba(255, 255, 255, 0.7);
  background: radial-gradient(circle at 25% 25%, #f8fafc 0%, #dfe3ec 55%, #afb4bf 100%);
  box-shadow:
    0 8px 20px rgba(10, 12, 18, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.table-select input[type="checkbox"]:checked::after,
#activeTable input[type="checkbox"]:checked::after,
#expiredTable input[type="checkbox"]:checked::after,
#removedTable input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: translate(-50%, -58%) scale(1);
}
.table-select input[type="checkbox"]:active,
#activeTable input[type="checkbox"]:active,
#expiredTable input[type="checkbox"]:active,
#removedTable input[type="checkbox"]:active {
  transform: scale(0.95);
}
.table-select input[type="checkbox"]:focus-visible,
#activeTable input[type="checkbox"]:focus-visible,
#expiredTable input[type="checkbox"]:focus-visible,
#removedTable input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(96, 165, 250, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.sortable { cursor: pointer; user-select: none; }
.sortable::after { content: '\25B4\25BE'; font-size: 10px; opacity: 0.35; margin-left: 6px; }
.sort-asc::after { content: '\25B4'; opacity: 0.8; }
.sort-desc::after { content: '\25BE'; opacity: 0.8; }
/* Zebra rows */
#activeTable tbody tr:nth-child(odd), #expiredTable tbody tr:nth-child(odd), #removedTable tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }
/* Hover */
#activeTable tbody tr:hover, #expiredTable tbody tr:hover, #removedTable tbody tr:hover { background: rgba(255, 255, 255, 0.08); transition: background 0.2s ease; }

.btn { background: linear-gradient(135deg, #111217 0%, #24262d 100%); color: #e5e7eb; border: 1px solid rgba(255, 255, 255, 0.08); padding: 10px 16px; border-radius: 12px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 6px 20px rgba(0,0,0,0.45); font-weight: 500; }
.btn:hover { background: linear-gradient(135deg, #191b22 0%, #2f323a 100%); box-shadow: 0 10px 28px rgba(0,0,0,0.55); border-color: rgba(255, 255, 255, 0.15); }
.btn:focus,
.btn:focus-visible,
.primary:focus,
.primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 8px 20px rgba(255, 255, 255, 0.18);
}
.btn:active { transform: none; }
.btn.small { font-size: 13px; padding: 6px 12px; }
.btn.text { background: transparent; border: none; color: #e5e7eb; }
.btn.danger { background: linear-gradient(135deg, #3a1212, #5c1e1e); border-color: rgba(248, 113, 113, 0.45); color: #ffe4e6; box-shadow: 0 6px 20px rgba(0,0,0,0.45); }
.btn.danger:hover { background: linear-gradient(135deg, #4b1717, #6a2323); box-shadow: 0 10px 28px rgba(0,0,0,0.55); }

.row-edit input[type="text"], .row-edit input[type="date"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.row-edit input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #ffffff;
  padding: 16px 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  text-shadow: none;
  filter: none;
}

.auth-footer {
  margin-top: 12px;
}

.app-footer {
  padding-bottom: 32px;
}

@media (max-width: 1024px) {
  .app { padding: 28px 16px; }
  .topbar h1 { font-size: 36px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .spacer { flex-basis: 100%; height: 0; }
  .table-container table { min-width: 640px; }
}

@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
  .table-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .legend { width: 100%; justify-content: flex-start; }
  .tabs { overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .tab { flex: 1 0 auto; min-width: 180px; text-align: center; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .toolbar .btn, .toolbar #btnSignOut, .toolbar #btnSettings { width: 100%; }
  .toolbar .spacer { display: none; }
  .card { padding: 20px; }
  .inline-field, .duration-group { flex-direction: column; align-items: stretch; }
  .duration-field { min-width: 100%; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .primary, .form-actions .btn { width: 100%; }
  .search-row { margin-bottom: 20px; }
  #toastContainer { left: 16px; right: 16px; bottom: 16px; }
  .table-container table { min-width: 560px; }
  /* Checkbox yerine "Kalan Süre" sütununu gizle (column 6) */
  #activeTable th:nth-child(6), #activeTable td:nth-child(6) { display: none; }
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }
  body::before,
  body::after {
    display: none;
  }
  .app {
    padding: 20px 14px 72px;
  }
  .topbar h1 {
    font-size: 30px;
    margin-bottom: 18px;
  }
  .tabs {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: 0 -14px 20px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(7, 8, 15, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    gap: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
  }
  .tab {
    flex: 0 0 auto;
    min-width: auto;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
  }
  .card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(10, 11, 18, 0.9);
    box-shadow: var(--shadow-soft);
  }
  .table-header {
    gap: 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  .legend {
    width: 100%;
    gap: 10px;
  }
  .legend .badge {
    flex: 1 1 calc(50% - 10px);
    justify-content: center;
  }
  .table-container {
    overflow: visible;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
  }
  .table-container table {
    min-width: 100%;
    border: none;
  }
  #activeTable, #expiredTable, #removedTable {
    border-radius: 0;
  }
  #activeTable thead, #expiredTable thead, #removedTable thead {
    display: none;
  }
  #activeTable tbody, #expiredTable tbody, #removedTable tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  #activeTable tr, #expiredTable tr, #removedTable tr {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 6, 12, 0.92);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  }
  #activeTable td, #expiredTable td, #removedTable td {
    padding: 6px 0;
    border: none;
    display: flex !important;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
  }
  .collapsible-row {
    position: relative;
  }
  .collapsible-row.collapsed td {
    display: none !important;
  }
  .collapsible-row.collapsed td.col-name,
  .collapsible-row.collapsed td.col-select,
  .collapsible-row.collapsed td.col-actions {
    display: flex !important;
  }
  .collapsible-row.collapsed td.col-select {
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }
  .collapsible-row.collapsed td.col-name {
    flex-direction: column;
    gap: 6px;
  }
  .collapsible-row.collapsed td.col-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
    margin-top: 2px;
  }
  .collapsible-row.collapsed td.col-actions::before {
    display: none;
  }
  #activeTable td::before, #expiredTable td::before, #removedTable td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    flex: 0 0 130px;
  }
  #activeTable td:last-child, #expiredTable td:last-child, #removedTable td:last-child {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }
  #activeTable td:nth-child(6) {
    display: flex !important;
  }
  #activeTable td:nth-child(1)::before,
  #expiredTable td:nth-child(1)::before,
  #removedTable td:nth-child(1)::before { content: 'Oyuncu'; }
  #activeTable td:nth-child(2)::before,
  #expiredTable td:nth-child(2)::before,
  #removedTable td:nth-child(2)::before { content: 'Sebep'; }
  #activeTable td:nth-child(3)::before,
  #expiredTable td:nth-child(3)::before,
  #removedTable td:nth-child(3)::before { content: 'Başlangıç'; }
  #activeTable td:nth-child(4)::before,
  #expiredTable td:nth-child(4)::before,
  #removedTable td:nth-child(4)::before { content: 'Bitiş'; }
  #activeTable td:nth-child(5)::before { content: 'Kalan Süre'; }
  #activeTable td:nth-child(6)::before,
  #expiredTable td:nth-child(5)::before,
  #removedTable td:nth-child(5)::before { content: 'Durum'; }
  #activeTable td:nth-child(7)::before,
  #expiredTable td:nth-child(7)::before,
  #removedTable td:nth-child(7)::before { content: 'İşlemler'; }
  #expiredTable td:nth-child(6)::before,
  #removedTable td:nth-child(6)::before { content: 'Arşiv Tarihi'; }
  .collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    font-weight: 600;
    letter-spacing: 0.2px;
  }
  .mobile-subtext {
    display: inline-block;
  }
  .footer {
    margin-top: 40px;
    font-size: 11px;
    opacity: 0.8;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 18px 10px 64px;
  }
  .topbar h1 {
    font-size: 26px;
    letter-spacing: -0.4px;
  }
  .tabs {
    margin: 0 -10px 16px;
    padding: 6px 8px;
    gap: 4px;
  }
  .tab {
    padding: 8px 14px;
    font-size: 13px;
  }
  .card {
    padding: 16px;
  }
  .form-row label {
    font-size: 13px;
  }
  .form-row input[type="text"],
  .form-row input[type="date"],
  .form-row input[type="number"],
  .form-row input[type="email"],
  .form-row input[type="password"],
  .form-row input[type="time"] {
    padding: 10px 14px;
    font-size: 14px;
  }
  .search-input {
    padding: 12px 16px;
    font-size: 14px;
  }
  .primary,
  .toolbar .btn,
  .form-actions .btn {
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
  }
  .legend .badge {
    flex: 1 1 100%;
    font-size: 11px;
  }
  #activeTable td,
  #expiredTable td,
  #removedTable td {
    font-size: 13px;
  }
  .footer {
    font-size: 11px;
  }
}

/* Modal */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; z-index: 50; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content { background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(40px); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 24px; padding: 32px; width: min(640px, 92vw); box-shadow: 0 24px 64px rgba(0,0,0,0.4); animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.modal-content h3 { margin: 0 0 24px; font-size: 24px; font-weight: 700; color: #ffffff; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.settings-grid label { display: grid; gap: 8px; color: rgba(255, 255, 255, 0.9); font-weight: 600; font-size: 14px; }
.settings-grid input, .settings-grid select { background: rgba(255, 255, 255, 0.1); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px; padding: 10px 12px; transition: all 0.2s ease; }
.settings-grid input:focus, .settings-grid select:focus { outline: none; border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.15); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* Toast */
#toastContainer { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 12px; z-index: 60; }
.toast { background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(20px); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 16px; padding: 16px 20px; box-shadow: 0 12px 40px rgba(0,0,0,0.3); animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); font-weight: 500; }
.toast.success { border-color: rgba(52, 211, 153, 0.5); box-shadow: 0 12px 40px rgba(52, 211, 153, 0.2); }
.toast.warn { border-color: rgba(255, 255, 255, 0.45); box-shadow: 0 12px 40px rgba(255, 255, 255, 0.2); }
.toast.error { border-color: rgba(248, 113, 113, 0.5); box-shadow: 0 12px 40px rgba(248, 113, 113, 0.2); }

.logout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 12, 0.8);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 70;
  animation: fadeIn 0.3s ease;
}
.logout-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}
.logout-text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: 0.04em;
}

/* Light theme overrides */
body.light { background: #f3f4f6; color: #111827; }
body.light .tab { background: #f8fafc; color: #111827; border-color: #d1d5db; }
body.light .tab.active { background: #e5e7eb; border-color: #9ca3af; }
body.light .card { background: #ffffff; border-color: #e5e7eb; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
body.light .search-input, body.light .form-row input[type="text"], body.light .form-row input[type="date"], body.light .form-row input[type="number"], body.light .form-row input[type="email"], body.light .form-row input[type="password"], body.light .row-edit input[type="text"], body.light .row-edit input[type="date"] { background: #ffffff; color: #111827; border-color: #d1d5db; }
body.light .btn { background: #f8fafc; color: #111827; border-color: #d1d5db; }
body.light .btn:hover { background: #e5e7eb; }
body.light .badge.removed { background: #f8fafc; color: #111827; border-color: #d1d5db; }
body.light #activeTable tbody tr:nth-child(odd), body.light #expiredTable tbody tr:nth-child(odd), body.light #removedTable tbody tr:nth-child(odd) { background: rgba(0,0,0,0.03); }

.inline-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.duration-group { gap: 12px; align-items: stretch; }
.duration-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 6px 12px;
  min-width: 160px;
}
.duration-field input {
  background: transparent;
  border: none;
  color: #fff;
  width: 100%;
  font-size: 15px;
  padding: 8px 4px;
}
.duration-field input:focus {
  outline: none;
}
.duration-unit {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}
#addBanForm .form-row {
  grid-template-columns: 1fr;
}
#addBanForm .form-row > label:not(.toggle-permanent) {
  display: none;
}
.toggle-permanent {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  user-select: none;
}
.toggle-permanent:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.settings-grid label { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-grid input[type="checkbox"],
.toggle-permanent input {
  width: 20px;
  height: 20px;
  appearance: none;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, #0f0f12, #1d1d22);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.settings-grid input[type="checkbox"]:checked,
.toggle-permanent input:checked {
  border-color: rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, #9ca3af, #d1d5db);
  box-shadow: 0 0 8px rgba(209, 213, 219, 0.4);
}
.settings-grid input[type="checkbox"]:checked::after,
.toggle-permanent input:checked::after {
  content: '\2713';
  color: #1f2933;
  font-size: 12px;
  font-weight: 700;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
}
.settings-grid input[type="checkbox"]:focus-visible,
.toggle-permanent input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.4);
}
body.light .toggle-permanent { background: #f8fafc; color: #111827; border-color: #d1d5db; }
body.light .settings-grid input[type="checkbox"],
body.light .toggle-permanent input {
  background: #f1f5f9;
  border-color: #cbd5f5;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.hidden { display: none !important; }

.auth-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.auth-aurora {
  position: absolute;
  width: clamp(300px, 40vw, 520px);
  height: clamp(300px, 40vw, 520px);
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.4;
  z-index: 0;
}
.aurora-primary { top: -10%; left: 15%; background: radial-gradient(circle, rgba(59,130,246,0.6), transparent 60%); }
.aurora-secondary { bottom: -15%; right: 10%; background: radial-gradient(circle, rgba(147,51,234,0.6), transparent 60%); }

.auth-content {
  width: clamp(320px, 85vw, 420px);
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.auth-logo { display: flex; align-items: center; gap: 16px; }
.logo-ring {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
}
.logo-eyebrow { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.25em; color: rgba(248,250,252,0.5); }
.auth-logo h1 { margin: 4px 0 0; font-size: 32px; color: #f8fafc; }
.auth-lead { margin: 0; color: rgba(248, 250, 252, 0.7); line-height: 1.6; }

.login-card,
.gate-loading {
  width: 100%;
  padding: 24px;
  position: relative;
  background: rgba(8, 10, 15, 0.08);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 15px 45px rgba(3, 5, 12, 0.35);
  overflow: hidden;
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.login-card::before,
.gate-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.login-card > *,
.gate-loading > * {
  position: relative;
  z-index: 1;
}
.login-card { display: grid; gap: 14px; }
.login-card .form-row { margin-bottom: 6px; }
.auth-actions { margin-top: 6px; }
.gate-loading {
  display: grid;
  place-items: center;
  gap: 18px;
  text-align: center;
  width: clamp(280px, 80vw, 360px);
  margin: 0 auto;
}
.gate-loading .spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 0.9s linear infinite;
}
.brand { 
  display: grid; 
  place-items: center; 
  width: 72px; 
  height: 72px; 
  border-radius: 20px; 
  background: var(--gradient-accent); 
  box-shadow: 0 12px 40px rgba(255, 255, 255, 0.28); 
  margin: 0 auto 16px; 
  font-size: 32px; 
}
.auth-title { margin: 12px 0 0; font-size: 28px; font-weight: 800; text-align: center; color: #ffffff; }
.auth-subtitle { margin: 8px 0 32px; color: rgba(255, 255, 255, 0.7); text-align: center; font-size: 15px; }
.w-full { width: 100%; }
.auth-actions { display: grid; gap: 12px; }
.login-card .form-row { grid-template-columns: 1fr; margin-bottom: 20px; }
.login-card .form-row label { color: rgba(255, 255, 255, 0.9); margin-bottom: 8px; }
.login-card .form-row input[type="email"],
.login-card .form-row input[type="text"],
.login-card .form-row input[type="password"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f3f4f6;
  border-radius: 12px;
  padding: 12px 16px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.input-with-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 4px 6px;
}
.input-with-toggle input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  padding: 10px 12px;
  color: #f3f4f6;
  min-width: 0;
}
.input-with-toggle input:focus {
  outline: none;
  box-shadow: none;
}
.password-toggle { 
  background: rgba(12, 14, 25, 0.75); 
  color: #e5e7eb; 
  border: 1px solid rgba(255, 255, 255, 0.12); 
  padding: 8px 16px; 
  border-radius: 12px; 
  cursor: pointer; 
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 13px;
  min-width: 78px;
}
.password-toggle:hover { background: linear-gradient(135deg, #181b24 0%, #212530 100%); }
.login-card input:focus { outline: none; border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1); }
.login-card .primary { padding: 14px 24px; width: 100%; }
.login-card .error-text { text-align: center; margin-top: 12px; }
.email-input-wrapper { 
  display: flex; 
  align-items: center; 
  gap: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding-right: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}
.email-input-wrapper:focus-within {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}
.email-input-wrapper input {
  background: transparent !important;
  border: none !important;
  flex: 1;
  min-width: 0;
  box-shadow: none !important;
}
.email-domain {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  white-space: nowrap;
  font-weight: 500;
  user-select: none;
}
