:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #06b6d4;
  --admin: #0f172a;
  --light: #f0f9ff;
  --white: #ffffff;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #e2e8f0;
  --gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --soft-shadow:
    0 4px 20px -2px rgba(59, 130, 246, 0.08),
    0 2px 6px -2px rgba(59, 130, 246, 0.04);
  --hover-shadow:
    0 12px 25px -5px rgba(59, 130, 246, 0.15),
    0 8px 10px -6px rgba(59, 130, 246, 0.1);
}
/* Masaüstü ekranlarda ikonları gizle */
.masaustu-gizle {
  display: none !important;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: "Inter", sans-serif;
  background-color: #f8fafc;
  margin: 0;
  color: #334155;
  position: relative;
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url("logo.svg");
  background-repeat: repeat;
  background-size: 140px;
  opacity: 0.03;
  z-index: -1;
  pointer-events: none;
  transform: rotate(-15deg);
}
.hidden {
  display: none !important;
}
.fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}
.spinner {
  border: 4px solid var(--light);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin-bottom: 20px;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.navbar {
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: max(15px, env(safe-area-inset-top));
  transition: all 0.3s ease;
}
.navbar.admin-nav {
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(15px);
  color: white;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.navbar.admin-nav .nav-links button {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}
.navbar.admin-nav .nav-links button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}
.navbar.admin-nav .nav-links button.active {
  background: var(--gradient);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}
.navbar.teacher-nav {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
  color: var(--admin);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--soft-shadow);
}
.navbar.teacher-nav .nav-links button {
  background: transparent;
  color: #64748b;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}
.navbar.teacher-nav .nav-links button:hover {
  color: var(--primary);
  background: var(--light);
}
.navbar.teacher-nav .nav-links button.active {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.nav-links i {
  margin-right: 6px;
  font-size: 15px;
}
.navbar button {
  font-family: "Inter", sans-serif;
  font-size: 14px;
}

.container {
  max-width: 1150px;
  margin: 35px auto;
  padding: 0 20px;
}
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(
    135deg,
    rgba(240, 249, 255, 0.85) 0%,
    rgba(224, 242, 254, 0.95) 100%
  );
  padding: 20px;
}
.login-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 45px;
  border-radius: 24px;
  box-shadow: 0 20px 40px -10px rgba(59, 130, 246, 0.1);
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.login-box input[type="text"],
.login-box input[type="password"],
.login-box input[type="email"] {
  width: 100%;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 15px;
  font-family: "Inter", sans-serif;
  transition: all 0.3s;
  background: #f8fafc;
}
.login-box input:focus {
  border-color: var(--accent);
  outline: none;
  background: white;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
}
.login-tabs {
  display: flex;
  margin-bottom: 25px;
  background: #f1f5f9;
  border-radius: 14px;
  overflow: hidden;
  padding: 5px;
}
.login-tabs button {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: #64748b;
  transition: 0.3s;
  border-radius: 10px;
  font-family: "Inter", sans-serif;
}
.login-tabs button.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.login-box button[type="submit"],
button.btn-primary {
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
  padding: 14px 22px;
}
.login-box button[type="submit"]:hover,
button.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
  filter: brightness(1.05);
}
.login-box button[type="submit"] {
  width: 100%;
  font-size: 16px;
  padding: 16px;
}

.box {
  background: var(--white);
  padding: 28px;
  border-radius: 20px;
  box-shadow: var(--soft-shadow);
  margin-bottom: 25px;
  border: 1px solid rgba(59, 130, 246, 0.05);
  transition: all 0.3s ease;
}
.box:hover {
  box-shadow: var(--hover-shadow);
}
.box h3 {
  margin-top: 0;
  color: var(--admin);
  border-bottom: 1px solid var(--light);
  padding-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.flex-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.flex-row input,
.flex-row select,
.flex-row textarea {
  flex: 1;
  min-width: 180px;
  height: 48px;
}
.flex-row button {
  height: 48px;
  white-space: nowrap;
  flex-shrink: 0;
}

input,
select,
textarea {
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
  color: #334155;
  background: #fff;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

button {
  font-family: "Inter", sans-serif;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
button.btn-danger {
  background: var(--danger);
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
button.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}
button.btn-success {
  background: var(--success);
  color: white;
  padding: 14px 22px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}
button.btn-success:hover {
  background: #059669;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}
button.btn-info {
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
button.btn-info:hover {
  filter: brightness(0.9);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
  transform: translateY(-1px);
}
button.btn-secondary {
  background: var(--admin);
  color: white;
  padding: 14px 22px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
}
button.btn-secondary:hover {
  background: #1e293b;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}
button.btn-action {
  background: #f1f5f9;
  color: #475569;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
}
button.btn-action:hover {
  background: var(--light);
  color: var(--primary);
}

.btn-kaynak {
  background: var(--white);
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: 14px;
}
.btn-kaynak:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--light);
}
.btn-kaynak.active {
  background: var(--gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}
.class-card {
  background: var(--white);
  border: 1px solid rgba(59, 130, 246, 0.1);
  padding: 16px 12px;
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  color: var(--admin);
  box-shadow: var(--soft-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.class-card div:last-child {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-top: 4px;
}
.class-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}
.class-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--hover-shadow);
  border-color: transparent;
}
.class-card:hover::after {
  transform: scaleX(1);
}

.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  white-space: nowrap;
}
th,
td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background-color: #f8fafc;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:nth-child(even) {
  background-color: rgba(240, 249, 255, 0.3);
}
tbody tr:hover {
  background-color: var(--light);
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.item-list li {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}
.item-list li:hover {
  background: var(--light);
}
.item-list li:last-child {
  border-bottom: none;
}

/* --- UZUN METİN VE BUTON KAYMASINI ÖNLEME (TÜM EKRANLAR) --- */
.item-list li > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  padding-right: 15px;
}
.item-list li > div:last-child {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}

.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: var(--white);
  flex: 1;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.radio-label:hover {
  border-color: var(--primary);
  background: var(--light);
}
.radio-label input[type="radio"] {
  transform: scale(1.1);
  margin: 0;
  cursor: pointer;
}
.radio-label.bitirdi {
  color: #059669;
  border-color: #a7f3d0;
  background: #ecfdf5;
}
.radio-label.bitirmedi {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}
.radio-label.kontrol-edilmedi {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}
.radio-label.disabled-label {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: var(--border);
  color: #94a3b8;
}

.islendi-toggle {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 22px 28px;
  border-radius: 16px;
  border: 1px solid #bae6fd;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 600;
  color: #0369a1;
  flex-wrap: wrap;
  box-shadow: var(--soft-shadow);
}
.islendi-toggle input[type="checkbox"] {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: var(--primary);
}

.stat-box {
  background: var(--white);
  padding: 30px 20px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow: var(--soft-shadow);
  transition: transform 0.3s;
}
.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}
.stat-box i {
  font-size: 34px;
  color: var(--accent);
  margin-bottom: 15px;
  display: block;
}
.stat-number {
  font-size: 40px;
  font-weight: 800;
  color: var(--admin);
  margin-bottom: 5px;
  line-height: 1;
}

.stat-progress-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  transition: background 0.2s;
}
.stat-progress-wrapper:hover {
  background: var(--light);
}
.stat-progress-label {
  width: 160px;
  font-weight: 700;
  color: var(--admin);
  font-size: 13px;
}
.stat-progress-bar-bg {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 15px;
  position: relative;
}
.stat-progress-bar-fill {
  height: 100%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
}
.stat-progress-value {
  width: 45px;
  text-align: right;
  font-weight: 800;
  font-size: 13px;
  color: var(--primary);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(8px);
}
.modal-content {
  background: var(--white);
  padding: 40px;
  border-radius: 24px;
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  -webkit-overflow-scrolling: touch;
}
.modal-close {
  position: absolute;
  top: 25px;
  right: 25px;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  transition: 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f1f5f9;
}
.modal-close:hover {
  color: white;
  background: var(--danger);
  transform: rotate(90deg);
}

.badge-success {
  background: #ecfdf5;
  color: #059669;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #a7f3d0;
}
.badge-danger {
  background: #fef2f2;
  color: #dc2626;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #fecaca;
}
.badge-warning {
  background: #fffbeb;
  color: #b45309;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #fde68a;
}
.badge-secondary {
  background: #f1f5f9;
  color: #64748b;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
}

.report-book-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  background-color: var(--white);
  box-shadow: var(--soft-shadow);
  page-break-inside: avoid;
}
.report-book-card h4 {
  margin: 0 0 15px 0;
  color: var(--admin);
  border-bottom: 2px solid var(--light);
  padding-bottom: 12px;
  font-size: 17px;
  font-weight: 700;
}

.announcement-banner {
  padding: 20px 25px;
  border-radius: 16px;
  margin-bottom: 25px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  box-shadow: var(--soft-shadow);
  line-height: 1.6;
}
@keyframes pulse-warning {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
    color: #ef4444;
  }
  100% {
    transform: scale(1);
  }
}
.banner-warning i {
  animation: pulse-warning 2s infinite;
  color: #dc2626;
}
.banner-warning {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.banner-info {
  background-color: #f0f9ff;
  color: #075985;
  border: 1px solid #bae6fd;
}
.banner-default {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 18px 24px;
  border-radius: 14px;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
  min-width: 300px;
  font-weight: 600;
  font-size: 15px;
}
.toast.success {
  background-color: var(--success);
}
.toast.error {
  background-color: var(--danger);
}
.toast.info {
  background-color: var(--admin);
}
.toast.fade-out {
  animation: fadeOut 0.3s forwards;
}
.toast i {
  font-size: 22px;
}
@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.empty-state i {
  font-size: 64px;
  margin-bottom: 20px;
  color: #e2e8f0;
}
.empty-state p {
  margin: 0;
  font-size: 16px;
  color: #64748b;
  font-weight: 500;
}

@media (max-width: 1024px) {
  /* --- GENEL MOBİL DÜZELTMELER --- */
  .grid-2 {
    grid-template-columns: 1fr !important;
  }
  .navbar {
    flex-direction: column !important;
    padding: 15px 10px !important;
    gap: 12px !important;
  }
  .navbar h2 {
    flex-wrap: wrap !important;
    text-align: center !important;
    font-size: 18px !important;
    justify-content: center !important;
  }
  .nav-links {
    position: relative !important;
    width: 100% !important;
    background: transparent !important;
    padding: 5px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 10px !important;
    justify-content: flex-start !important;
    box-shadow: none !important;
    border: none !important;
  }
  .nav-links::-webkit-scrollbar {
    display: none !important;
  }
  .nav-links button {
    flex: 0 0 auto !important;
    min-width: 80px !important;
    min-height: 65px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    padding: 10px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
  }
  .nav-links button i {
    font-size: 22px !important;
    margin: 0 0 6px 0 !important;
    display: block !important;
  }
  .navbar.admin-nav .nav-links button {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #cbd5e1 !important;
  }
  .navbar.teacher-nav .nav-links button {
    background: rgba(0, 0, 0, 0.02) !important;
    color: #64748b !important;
  }
  .navbar.admin-nav .nav-links button.active {
    color: white !important;
    background: var(--gradient) !important;
    border-color: transparent !important;
  }
  .navbar.teacher-nav .nav-links button.active {
    color: white !important;
    background: var(--gradient) !important;
    border-color: transparent !important;
  }
  .container {
    padding-bottom: 20px !important;
    margin-top: 10px !important;
  }
  .flex-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .flex-row > * {
    width: 100% !important;
    margin-bottom: 0 !important;
  }
  .flex-row > button {
    padding: 16px !important;
    font-size: 15px !important;
  }
  .modal {
    align-items: flex-end !important;
    padding: 0 !important;
    background: rgba(15, 23, 42, 0.7) !important;
  }
  .modal-content {
    border-radius: 28px 28px 0 0 !important;
    max-height: 85vh !important;
    padding: 35px 20px 40px 20px !important;
    margin: 0 !important;
    animation: slideUpModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
      forwards !important;
  }
  .stat-progress-wrapper {
    flex-wrap: wrap !important;
  }
  .stat-progress-label {
    width: 100% !important;
    margin-bottom: 4px !important;
  }
  .stat-progress-bar-bg {
    margin: 0 !important;
    margin-right: 15px !important;
  }
  .islendi-toggle {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 15px !important;
  }
  .islendi-toggle > div {
    width: 100% !important;
    justify-content: space-between !important;
  }
  .islendi-toggle input[type="date"] {
    flex: 1 !important;
  }
  .islendi-toggle button {
    width: 100% !important;
    padding: 16px !important;
  }

  /* --- LİSTELER VE TARİH KUTULARI --- */
  .item-list li {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .item-list li > span:first-child {
    width: 100% !important;
    word-break: break-word !important;
    white-space: normal !important;
    padding-right: 0 !important;
    line-height: 1.5 !important;
  }
  .item-list li > div:last-child {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }
  .item-list li > div:last-child button {
    flex: 1 !important;
    justify-content: center !important;
  }
  .date-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .date-group input {
    flex: 1 1 40% !important;
    max-width: 48% !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    font-size: 13px !important;
    font-family: "Inter", sans-serif !important;
    color: #475569 !important;
    background-color: #fff !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }
  .date-group input::-webkit-datetime-edit {
    padding: 0 !important;
    text-align: center !important;
  }
  .date-group span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    color: #94a3b8 !important;
    flex: 0 0 auto !important;
  }
  .date-group button {
    flex: 1 1 100% !important;
    height: 46px !important;
    margin-top: 5px !important;
  }

  /* --- ÖĞRETMEN ÜST BUTONLAR VE RAPOR KUTULARI --- */
  #tchrTrackingButtons {
    width: 100% !important;
    flex-direction: column !important;
  }
  #tchrTrackingButtons button {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 2px !important;
  }
  #tchrTabRapor .box > div[style*="background: #f8fafc"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 15px !important;
  }
  #tchrTabRapor .box > div[style*="background: #f8fafc"] > div {
    width: 100% !important;
  }
  #tchrTabRapor .box > div[style*="background: #f8fafc"] > button {
    width: 100% !important;
    justify-content: center !important;
    height: 48px !important;
    margin-top: 5px !important;
  }

  /* =========================================================
     ÖĞRETMEN MOBİL GÖRÜNÜM İYİLEŞTİRMELERİ (KART YAPISI)
     ========================================================= */
  #trackingListBox thead {
    display: none !important;
  }
  #trackingListBox table,
  #trackingListBox tbody,
  #trackingListBox tr,
  #trackingListBox td {
    display: block !important;
    width: 100% !important;
  }

  /* TEST BELİRTECİ: Tasarımın yüklendiğini anlamak için kenarlıkları geçici olarak mavi yapıyoruz */
  #trackingListBox tbody tr {
    background: var(--white) !important;
    border: 2px solid var(--primary) !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
    padding: 16px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    position: relative !important;
  }

  #trackingListBox tbody td {
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
  }
  #trackingListBox tbody td:nth-child(1) {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--admin) !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
    border-bottom: 1px dashed var(--border) !important;
    display: flex !important;
    align-items: center !important;
  }
  #trackingListBox tbody td:nth-child(1)::before {
    content: "\f007";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary);
    margin-right: 10px;
    font-size: 14px;
    background: var(--light);
    padding: 8px;
    border-radius: 50%;
  }
  #trackingListBox tbody td:nth-child(2) {
    margin-bottom: 10px !important;
  }
  /* --- BUTONLARI YAN YANA İKONLU HALE GETİRME --- */
  #trackingListBox .radio-group {
    display: flex !important;
    flex-direction: row !important; /* Alt alta yerine yan yana dizer */
    gap: 8px !important;
    width: 100% !important;
    margin-top: 8px !important;
  }
  #trackingListBox .radio-label {
    flex: 1 !important; /* Butonların alana eşit yayılmasını sağlar */
    padding: 10px 4px !important;
    font-size: 15px !important; /* İkon boyutunu dengeler */
    justify-content: center !important;
    border-radius: 10px !important;
    align-items: center !important;
  }
  /* Sadece mobil ekranlarda "mobil-gizle" sınıfına sahip metinleri görünmez yap */
  #trackingListBox .radio-label .mobil-gizle {
    display: none !important;
  }

  /* Mobil ekranlarda gizli ikonları görünür yap */
  #trackingListBox .radio-label .masaustu-gizle {
    display: inline-block !important;
  }

  /* --- İSİM VE RAPOR BUTONUNUN KUSURSUZ ORANTISI --- */
  #trackingListBox tbody td:nth-child(1) {
    font-size: 14px !important; /* İsim boyutu */
    font-weight: 700 !important;
    padding-right: 45px !important; /* Rapor butonunun ismin üstüne binmesini engeller */
    line-height: 1.3 !important;
  }
  #trackingListBox tbody td:nth-child(3) {
    position: absolute !important;
    top: 14px !important; /* İsmin yatay hizasına tam ortalar */
    right: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    width: 32px !important; /* Butonun genişliği sabitlendi */
    height: 32px !important; /* Butonun yüksekliği sabitlendi (Tam Kare) */
  }
  #trackingListBox tbody td:nth-child(3) button {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: 14px !important; /* İkon büyüklüğü */
    background: var(--light) !important;
    color: var(--primary) !important;
    border: 1px solid #bae6fd !important;
  }

  /* =========================================================
     GENİŞ RAPOR TABLOSU MOBİL İYİLEŞTİRMELERİ
     ========================================================= */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 10px !important;
  }

  .table-responsive table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: visible !important; /* Sabitlemeyi (sticky) bozan kuralı iptal eder */
  }

  /* Sadece thead'in İLK satırının İLK hücresini (Öğrenci Başlığı) ve tbody'nin ilk sütununu hedefliyoruz */
  .table-responsive thead tr:first-child th:first-child,
  .table-responsive tbody td:first-child {
    position: -webkit-sticky !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 20 !important;
    background: #ffffff !important;
    box-shadow: 4px 0px 8px -2px rgba(0, 0, 0, 0.15) !important;

    /* Genişliği dar ekranlar için optimize ediyoruz */
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;

    /* Hücre içi taşmaları engelliyoruz */
    overflow: hidden !important;
  }

  /* Konu başlıklarının (ikinci satırdaki th'lerin) z-index'ini düşürerek üst üste binmeyi önlüyoruz */
  .table-responsive thead th {
    z-index: 1 !important;
  }

  /* Ana başlık (Öğrenci Adı) her zaman en üstte kalmalı */
  .table-responsive thead tr:first-child th:first-child {
    z-index: 20 !important;
  }

  .table-responsive th,
  .table-responsive td {
    padding: 12px 10px !important;
    white-space: normal !important;
    min-width: 90px !important;
    word-wrap: break-word !important;
  }
}
