/* ==========================================================================
   Nehir Belgelendirme - Sınav Evrakı & Değerlendirme Sistemi
   Tasarım dili: Aday Takip Programı (kırmızı / bordo palet, kompakt ölçüler)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Marka paleti (aday takip programı ile birebir) */
  --brand: #ce1126;
  --brand-dark: #8a0c1a;
  --brand-mid: #a91a2b;
  --brand-tint: #fadbdd;
  --brand-soft: #fff0f1;
  --brand-line: #e9bec4;
  --gold: #ff9f1c;

  /* Eski değişken adları: mevcut sayfalardaki inline stiller bozulmasın */
  --primary: var(--brand);
  --primary-hover: var(--brand-dark);
  --primary-light: var(--brand-soft);
  --accent: #b4232f;
  --accent-light: #fff5f5;
  --success: #2a9d8f;
  --success-light: #e8f6f4;
  --warning: #d97706;
  --warning-light: #fff7e6;

  --ink: #1b263b;
  --muted: #626a73;
  --line: #e4e5e8;
  --bg: #f6f6f8;

  --gray-50: #f8f9fa;
  --gray-100: #f3f4f6;
  --gray-200: #e4e5e8;
  --gray-300: #d6d8dd;
  --gray-400: #9aa1ab;
  --gray-500: #626a73;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2a3c;
  --gray-900: #1b263b;

  --font-family: 'Inter', Arial, Helvetica, sans-serif;
  --shadow-sm: 0 1px 2px rgba(27, 38, 59, .05);
  --shadow: 0 2px 8px rgba(27, 38, 59, .07);
  --shadow-lg: 0 12px 32px rgba(27, 38, 59, .18);
  --radius-sm: 6px;
  --radius: 9px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Tüm rem ölçüleri tek noktadan küçültülür */
html { font-size: 13px; scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
svg.lucide, [data-lucide] { width: 15px; height: 15px; flex: none; }

/* ---------- ÜST MENÜ ---------- */
.navbar {
  background: linear-gradient(180deg, var(--brand-dark), #7a0a17);
  padding: 0 10px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(138, 12, 26, .35);
  border-bottom: 2px solid var(--brand);
}

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  background: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  flex: none;
}
.brand-logo img {
  height: 26px;
  max-height: 26px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  display: block;
}

.brand-text h1 { font-size: 12px; font-weight: 700; color: #fff; line-height: 1.2; letter-spacing: .1px; white-space: nowrap; }
.brand-text p { font-size: 9.5px; color: rgba(255, 255, 255, .7); white-space: nowrap; }

.nav-links { display: flex; gap: 1px; list-style: none; flex: 1; align-items: center; margin-left: 4px; min-width: 0; }
.nav-links li.nav-item-right-start { margin-left: auto; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  text-decoration: none;
  color: rgba(255, 255, 255, .88);
  font-weight: 500;
  font-size: 11px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

/* 1400px altındaki ekranlarda taşmayı kesin olarak önleyen kurallar */
@media (min-width: 993px) and (max-width: 1400px) {
  .navbar { padding: 0 8px; gap: 6px; }
  .brand-text p { display: none; }
  .nav-link { padding: 4px 5px; font-size: 10.5px; gap: 3px; }
  .nav-link svg, .nav-link [data-lucide] { width: 12.5px; height: 12.5px; }
  .btn-support-ticket { padding: 0 6px !important; font-size: 10.5px !important; }
}
@media (min-width: 993px) and (max-width: 1220px) {
  .brand-text { display: none; }
  .nav-link { padding: 4px 4px; font-size: 10px; }
}
.nav-link:hover { background: var(--brand-mid); color: #fff; }
.nav-link.active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.nav-link svg { opacity: .9; }

.badge-issue {
  background: var(--gold);
  color: #4a2a00;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
}

/* ---------- KAPSAYICI & SAYFA BAŞLIĞI ---------- */
.container { max-width: 1360px; margin: 14px auto; padding: 0 16px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #fff 0%, var(--brand-soft) 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.page-header h2 { font-size: 15px; font-weight: 700; color: var(--brand-dark); letter-spacing: -.1px; }
.page-header p { font-size: 11.5px; color: var(--muted); margin-top: 1px; max-width: 760px; }

/* ---------- BUTONLAR ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid rgba(255, 159, 28, .55); outline-offset: 1px; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 3px 10px rgba(206, 17, 38, .28); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.92); }

.btn-danger { background: var(--accent-light); color: #a13b48; border-color: #efc9ce; }
.btn-danger:hover { background: #a13b48; color: #fff; border-color: #a13b48; }

.btn-outline { background: #fff; color: var(--ink); border-color: var(--gray-300); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-line); }

.btn-sm { height: 26px; padding: 0 9px; font-size: 11.5px; }

/* ---------- IZGARA ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-sidebar { display: grid; grid-template-columns: 320px 1fr; gap: 12px; }

/* ---------- KARTLAR (Zarif Arduvaz Gri Çerçeve + Kurumsal Bordo Üst Accent) ---------- */
.card {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  margin-bottom: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover {
  border-color: #94a3b8;
  border-top-color: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.card-header {
  padding: 9px 14px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}
.card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-title svg { color: var(--brand); }
.card-body { padding: 14px; }

/* ---------- FORM ---------- */
.form-group { margin-bottom: 10px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 4px;
  letter-spacing: .1px;
}
.form-control, .form-select {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--ink);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background-color: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.form-control { height: auto; padding: 8px 10px; line-height: 1.5; }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(206, 17, 38, .14); }
.form-control[readonly] { background-color: #f3f4f6; }
.form-control-sm, .form-select-sm { height: 26px; padding: 0 7px; font-size: 11.5px; border-radius: var(--radius-sm); }
input[type="checkbox"] { accent-color: var(--brand); width: 14px; height: 14px; cursor: pointer; }

/* ---------- SORU KARTLARI (B soruları) ---------- */
.question-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.question-pill {
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s ease;
  flex: 1;
  min-width: 150px;
  position: relative;
}
.question-pill:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.question-pill.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(206, 17, 38, .12); }
.question-pill-code { font-size: 13px; font-weight: 700; color: var(--brand); display: block; }
.question-pill-title {
  font-size: 11px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  line-height: 1.35;
}

/* ---------- ROZETLER ---------- */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.score-badge.perfect { background: var(--success-light); color: #17655c; border: 1px solid #b7e0da; }
.score-badge.warning { background: var(--warning-light); color: #92520a; border: 1px solid #f6d9a3; }

/* ---------- TABLOLAR ---------- */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { padding: 6px 10px; border-bottom: 1px solid #eceded; text-align: left; vertical-align: middle; }
.table th {
  background: #f8e6e8;
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.table tbody tr:nth-child(even) { background: #fbfafa; }
.table tbody tr:hover { background: var(--brand-soft); }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 38, 59, .55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px);
  transition: transform .2s ease;
  border-top: 3px solid var(--brand);
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header { padding: 11px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { color: var(--brand-dark); }
.modal-body { padding: 14px 16px; overflow-y: auto; }
.modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fcfafa;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* ---------- DOSYA YÜKLEME ALANI ---------- */
.dropzone {
  border: 2px dashed var(--brand-line);
  border-radius: var(--radius);
  padding: 26px 16px;
  text-align: center;
  background: #fffafa;
  cursor: pointer;
  transition: all .2s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone-icon { font-size: 2rem; color: var(--brand); margin-bottom: 8px; }
.dropzone h3 { font-size: 13px !important; }

/* ---------- GRUP / OTURUM SEÇİMİ ---------- */
.group-btn {
  height: 26px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--gray-300);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.group-btn:hover { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); }
.group-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(206, 17, 38, .28); }

.cand-table-row { transition: background .15s ease; }
.cand-table-row.selected { background: #fff7f7 !important; box-shadow: inset 3px 0 0 var(--brand); }

/* ---------- Sayfa altı ---------- */
.app-footer {
  text-align: center;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  background: #fff;
}

/* ---------- Mobil Menü Butonu & Backdrop (Masaüstünde Gizli) ---------- */
.mobile-nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex: none;
}
.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
}
.mobile-nav-backdrop {
  display: none;
}

/* ==========================================================================
   MOBİL VE TABLET UYUMLULUK DÜZENLEMELERİ (RESPONSIVE)
   ========================================================================== */

/* 1. Tablet ve Küçük Ekranlar (<= 992px) */
@media (max-width: 992px) {
  .navbar {
    height: 52px;
    padding: 0 12px;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 990;
  }
  .brand-text h1 {
    font-size: 11.5px;
  }
  .brand-text p {
    font-size: 9.5px;
  }

  /* Hamburger menü açma butonu aktif */
  .mobile-nav-toggle {
    display: flex;
  }

  /* Karartma katmanı */
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 995;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .mobile-nav-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-nav-locked {
    overflow: hidden;
  }

  /* Mobil Çekmece Menüsü */
  .nav-links {
    position: fixed;
    top: 52px;
    right: 0;
    bottom: 0;
    width: 290px;
    max-width: 86vw;
    background: linear-gradient(180deg, #8a0c1a 0%, #540610 100%);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 12px 30px;
    gap: 4px;
    margin-left: 0;
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .nav-links.mobile-open {
    transform: translateX(0);
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links li:last-child {
    margin-left: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }
  .nav-link {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 3px 0 0 var(--gold);
  }
  .user-info-item {
    margin: 8px 0;
    padding: 0 4px;
  }
  .user-info-item > div {
    width: 100%;
    justify-content: center;
    padding: 8px 12px !important;
  }
  .btn-support-ticket {
    width: 100% !important;
    height: 36px !important;
    justify-content: center !important;
    margin-left: 0 !important;
    font-size: 12.5px !important;
  }
}

/* 2. Akıllı Telefonlar ve Mobil Ekranlar (<= 768px) */
@media (max-width: 768px) {
  html {
    font-size: 13.5px;
  }
  .container {
    max-width: 100%;
    margin: 8px auto;
    padding: 0 10px;
  }

  /* Başlık ve Üst Aksiyonlar */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }
  .page-header h2 {
    font-size: 14px;
  }
  .page-header p {
    font-size: 11px;
    line-height: 1.4;
  }
  .page-header > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  .page-header > div:last-child .btn {
    flex: 1 1 calc(50% - 6px);
    height: 36px;
    font-size: 12px;
    padding: 0 8px;
  }
  .page-header > div:last-child .btn.btn-primary {
    flex: 1 1 100%;
    order: -1;
    font-size: 13px;
    font-weight: 700;
  }

  /* Grid Sisteminin Tek Kolona Düşürülmesi */
  .grid-2, .grid-3, .grid-4, .grid-sidebar {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 2fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns:2fr 1fr"],
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Kartlar ve Formlar */
  .card {
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
  }
  .card-header {
    padding: 9px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .card-header > div {
    width: 100%;
    justify-content: space-between;
  }
  .card-body {
    padding: 12px;
  }

  /* Form kontrolleri dokunmatik için geniş ve ergonomik */
  .form-group {
    margin-bottom: 10px;
  }
  .form-label {
    font-size: 11.5px;
    margin-bottom: 3px;
  }
  .form-control, .form-select {
    height: 38px;
    font-size: 14px;
    padding: 0 10px;
  }
  .form-control-sm, .form-select-sm {
    height: 32px;
    font-size: 12.5px;
  }

  /* B Soruları Kartları (Mobil Liste Şekli) */
  .question-pills {
    flex-direction: column;
    gap: 8px;
  }
  .question-pill {
    min-width: 100%;
    width: 100%;
    padding: 10px 12px;
  }

  /* Aday İşlem Çubuğu ve Butonlar */
  .card-header .btn-sm {
    flex: 1 1 calc(50% - 6px);
    height: 32px;
    font-size: 11px;
    justify-content: center;
  }
  #blankModeContainer {
    width: 100%;
    justify-content: space-between;
    padding: 6px 10px !important;
  }

  /* Toplu Soru Araçları */
  div[style*="background: #fdfafa; border-bottom: 1px solid var(--line);"] > div > div {
    width: 100%;
  }
  #bulkQuestionSelect {
    max-width: 100% !important;
    width: 100% !important;
    height: 34px !important;
    margin-bottom: 4px;
  }

  /* Tablolar - Rahat Kaydırma */
  .table-responsive {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
    position: relative;
  }
  .table th, .table td {
    padding: 8px 6px;
    font-size: 11.5px;
  }

  /* Meslekler & Kriterler Sayfası */
  #profListContainer {
    max-height: 240px !important;
  }

  /* Ayarlar - 39 Alan Listesi */
  #fieldsGrid, #obFieldsGrid {
    grid-template-columns: 1fr !important;
    max-height: 220px !important;
  }

  /* Modallar (Mobil Tam Ekran Deneyimi) */
  .modal-overlay {
    padding: 6px;
    align-items: flex-end;
  }
  .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 94vh;
    border-radius: 12px 12px 0 0;
  }
  .modal-header {
    padding: 12px 14px;
  }
  .modal-body {
    padding: 12px 14px;
    max-height: calc(94vh - 115px);
  }
  .modal-footer {
    padding: 10px 14px;
    flex-direction: column;
    gap: 8px;
  }
  .modal-footer .btn {
    width: 100%;
    height: 38px;
    font-size: 13px;
    justify-content: center;
  }
}

/* 3. Küçük Telefonlar (<= 480px) */
@media (max-width: 480px) {
  .brand-logo {
    height: 32px;
    padding: 2px 6px;
  }
  .brand-logo img {
    height: 24px;
    max-height: 24px;
  }
  .brand-text h1 {
    font-size: 10.5px;
  }
  .brand-text p {
    display: none;
  }
  .card-header .btn-sm {
    flex: 1 1 100%;
  }
}

/* ---------- RESMİ SINAV EVRAKI BASKI TASARIMI ---------- */
@media print {
  body { background: white; color: black; font-size: 11pt; }
  .navbar, .page-header, .no-print, .btn, .nav-links, .app-footer { display: none !important; }
  .container { max-width: 100%; margin: 0; padding: 0; }
  .print-page { page-break-after: always; padding: 10mm; min-height: 270mm; background: white; }
  .print-table { width: 100%; border-collapse: collapse; margin-top: 5mm; }
  .print-table th, .print-table td { border: 1px solid black; padding: 4px 6px; font-size: 9.5pt; }
  .print-table th { background-color: #eee !important; -webkit-print-color-adjust: exact; }
}
