:root {
  --bg: #eef3f0;
  --surface: #ffffff;
  --text: #14241c;
  --muted: #5f7368;
  --border: #d5e0d9;
  --primary: #0f766e;
  --primary-dark: #0d5f59;
  --cyan: #0e7490;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --filter-head: #12352f;
  --filter-head-text: #ecfdf5;
  --shadow: 0 18px 50px rgba(20, 36, 28, 0.08);
  --radius: 16px;
  --font-ui: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: -0.01em;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 34%),
    radial-gradient(circle at top right, rgba(14, 116, 144, 0.08), transparent 28%),
    linear-gradient(180deg, #f7faf8 0%, var(--bg) 45%, #e8efea 100%);
}

.app {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-home {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.brand-home:hover .brand h1 {
  color: var(--primary);
}

.brand-home:focus,
.brand-home:active {
  outline: none;
  box-shadow: none;
  border: 0;
}

.site-logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.about-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-link:hover,
.about-link.active {
  color: var(--primary);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.main-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.15s ease;
}

.nav-btn:hover { color: var(--text); background: white; }

.nav-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.nav-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.22);
}

.nav-btn:not(.active) .nav-badge {
  background: #dff3ef;
  color: var(--primary);
}

.view { display: none; }
.view.active { display: block; }

.view-intro {
  margin-bottom: 18px;
}

.view-intro h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.view-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98rem;
  max-width: 62ch;
}

.seo-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.seo-link-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f7faf8;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: 0.15s ease;
}

.seo-link-chip:hover {
  background: white;
  border-color: #99e2d5;
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.12);
}

.row-between {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: #0f172a;
  color: white;
}

.btn-cyan {
  background: var(--cyan);
  color: white;
}

.btn-danger-solid {
  background: #e11d48;
  color: white;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); background: white; }

.btn-add {
  background: #059669;
  color: white;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.86rem;
  white-space: nowrap;
}

.btn-add:hover { background: #047857; }
.btn-add.added { background: #64748b; }

.plus {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  line-height: 1;
}

/* SEARCH LAYOUT — sol şerit + sağ sonuçlar */
.search-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.filter-rail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}

.rail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.rail-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.rail-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.btn-text {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 6px 0;
}

.btn-text:hover { color: var(--danger); }

.filter-group {
  border-bottom: 1px solid #e7eee9;
  padding: 4px 0 10px;
}

.filter-group summary {
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
  padding: 10px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-group summary::-webkit-details-marker { display: none; }

.filter-group summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 700;
  font-size: 1rem;
}

.filter-group[open] summary::after { content: "–"; }

.filter-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.filter-search {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.84rem;
  background: #f4f8f6;
}

.mini-check {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-weight: 600;
}

.filter-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-body.scroll {
  max-height: 160px;
  overflow: auto;
  padding-right: 4px;
}

.filter-body.chip-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-body.chip-row label {
  background: #f3f7f5;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  align-items: center;
}

.filter-body.chip-row label:has(input:checked) {
  background: #dff7f2;
  border-color: #99e2d5;
  color: var(--primary-dark);
}

.filter-body label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  color: #24362e;
}

.filter-body input[type="checkbox"],
.special-checks input[type="checkbox"],
.mini-check input[type="checkbox"] {
  accent-color: var(--primary);
  margin-top: 2px;
}

.filter-body label.hidden { display: none; }

.range-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.range-row.stacked {
  flex-direction: column;
}

.range-row label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--muted);
}

.range-row input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #f4f8f6;
}

.special-checks {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
}

.special-checks label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.rail-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), #fff 35%);
}

.rail-actions .btn { width: 100%; justify-content: center; }

.results-main { min-width: 0; }

.results-main .view-intro {
  margin-bottom: 14px;
}

/* RESULTS */
.results-card,
.table-card {
  background: var(--surface);
  border: 1px solid rgba(213, 224, 217, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.results-card { min-height: 320px; }
.table-card { min-height: 320px; }

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.results-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.results-head span { color: var(--muted); font-size: 0.92rem; font-weight: 600; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.results-table { min-width: 1100px; }

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: #405066;
  background: #f8fafc;
  white-space: nowrap;
}

tbody tr:hover { background: #fafcff; }

.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px;
}

.results-foot {
  padding: 12px;
  display: flex;
  justify-content: center;
}

.col-num { width: 64px; }
.col-wide { width: 22%; }
.col-actions { width: 168px; text-align: center; }

.rank-badge {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e, #0e7490);
  color: white;
  font-weight: 800;
}

input[type="text"],
input[type="number"],
textarea,
.combo-input {
  width: 100%;
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea {
  min-height: 44px;
  resize: none;
  overflow: hidden;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

input:focus,
textarea:focus,
.combo-input:focus {
  background: white;
  border-color: #5eead4;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.search-select {
  position: relative;
}

.search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 45;
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(20, 36, 28, 0.16);
  overflow: hidden;
}

.picker-panel {
  display: flex;
  flex-direction: column;
  max-height: 320px;
}

.picker-head {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: #f4f8f6;
}

.picker-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
}

.picker-list {
  overflow: auto;
  flex: 1;
  padding: 6px;
  max-height: 240px;
}

.picker-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: #f8faf9;
}

.picker-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.search-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid #eef3f0;
}

.search-option:last-child {
  border-bottom: none;
}

.search-option:hover,
.search-option:focus {
  background: #e8f7f3;
  color: var(--primary-dark);
}

.search-empty {
  padding: 16px 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}

body.exporting .search-dropdown {
  display: none !important;
}

input::placeholder,
textarea::placeholder { color: #98a2b3; }

.cell-text {
  display: none;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.row-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover:not(:disabled) {
  background: #e5e7eb;
  color: var(--text);
}

.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.icon-btn.danger:hover:not(:disabled),
.icon-btn.mark:hover:not(:disabled),
.icon-btn.mark.active {
  background: var(--danger-soft);
  color: var(--danger);
}

tbody tr.row-marked { background: #fee2e2; }
tbody tr.row-marked:hover { background: #fecaca; }

tbody tr.row-marked input,
tbody tr.row-marked textarea {
  background: #fff5f5;
  border-color: #fecaca;
}

tbody tr.row-marked input:focus,
tbody tr.row-marked textarea:focus {
  background: #ffffff;
  border-color: #f87171;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

tbody tr.row-marked .rank-badge {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

tbody tr.row-marked .cell-text { color: #991b1b; }

.empty-state {
  display: none;
  position: absolute;
  inset: 0;
  place-content: center;
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}

.empty-state.visible { display: grid; }

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: #dff7f2;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
}

.empty-state h2 { margin: 0 0 8px; color: var(--text); }
.empty-state p { margin: 0; max-width: 420px; line-height: 1.5; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.about-card,
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px 28px 32px;
  max-width: 860px;
}

.about-card h2,
.detail-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.about-card h3,
.detail-card h3 {
  margin: 22px 0 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.about-card p,
.detail-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.about-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

.about-card a,
.detail-card a {
  color: var(--primary);
  font-weight: 700;
}

.about-meta {
  margin-top: 20px !important;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
}

.back-btn { margin-bottom: 14px; }

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0 8px;
}

.detail-stat {
  background: #f3f7f5;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.detail-stat span {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail-stat strong {
  font-size: 1.05rem;
  color: var(--text);
}

.detail-sart {
  margin-top: 8px;
  background: #f8faf9;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  max-height: 320px;
  overflow: auto;
}

.detail-sart li {
  margin-bottom: 10px;
  color: #31453c;
  line-height: 1.5;
  font-size: 0.92rem;
}

.detail-programs {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.detail-program-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.detail-program-link:hover {
  border-color: #99e2d5;
  background: #f3fbf8;
}

.detail-program-link strong { color: var(--text); }
.detail-program-link span { color: var(--muted); font-size: 0.86rem; white-space: nowrap; }

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

.info-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #f4f8f6;
  color: var(--primary);
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: help;
  flex-shrink: 0;
}

.info-btn:hover,
.info-btn:focus {
  background: #dff7f2;
  border-color: #99e2d5;
}

.info-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.uni-link,
.bolum-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.uni-link:hover,
.bolum-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.sart-popover {
  position: fixed;
  z-index: 80;
  width: min(420px, calc(100vw - 24px));
  max-height: min(360px, 50vh);
  overflow: auto;
  background: #10241f;
  color: #ecfdf5;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(16, 36, 31, 0.35);
  font-size: 0.88rem;
  line-height: 1.5;
}

.sart-popover h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #5eead4;
}

.sart-popover ul {
  margin: 0;
  padding-left: 1.1rem;
}

.sart-popover li { margin-bottom: 8px; }

.sart-popover .empty {
  margin: 0;
  opacity: 0.85;
}


.print-only { display: none; }

@media (max-width: 1100px) {
  .search-layout {
    grid-template-columns: 1fr;
  }

  .filter-rail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .topbar { align-items: stretch; }
  .brand-home { align-self: flex-start; }
  .main-nav { width: 100%; }
  .nav-btn { flex: 1; justify-content: center; }
  .footer { flex-direction: column; }
}

/* PDF / print */
body.exporting .topbar,
body.exporting .view-intro,
body.exporting .footer,
body.exporting .empty-state,
body.exporting .no-print,
body.exporting .row-actions,
body.exporting #viewSearch {
  display: none !important;
}

body.exporting #viewList { display: block !important; }

body.exporting .print-only {
  display: block;
  padding: 24px 24px 8px;
}

body.exporting .print-title h1 { font-size: 1.6rem; }
body.exporting .print-title p { margin: 6px 0 0; color: var(--muted); }

body.exporting .table-card {
  box-shadow: none;
  border: 1px solid #d0d7e2;
  min-height: auto;
}

body.exporting table { min-width: 0; table-layout: fixed; }

body.exporting input,
body.exporting textarea { display: none; }

body.exporting .cell-text { display: block; }
body.exporting tbody tr:hover { background: transparent; }
body.exporting tbody tr.row-marked { background: #fee2e2 !important; }
body.exporting tbody tr.row-marked .cell-text { color: #991b1b; }

@media print {
  body { background: white; }
  .topbar, .view-intro, .footer, .empty-state, .no-print, #viewSearch { display: none !important; }
  #viewList { display: block !important; }
  .print-only { display: block; padding: 0 0 12px; }
  .table-card { box-shadow: none; border: none; min-height: auto; }
  table { min-width: 0; }
  input, textarea { display: none; }
  .cell-text { display: block; }
  .app { width: 100%; padding: 0; }
}
