:root {
  /* Ana palette — kırık beyaz arka, mavi kartlar */
  --bg: #f5f1e8;              /* kırık beyaz (warm off-white) */
  --bg-2: #efe9dc;            /* biraz daha koyu kırık beyaz */
  --surface: #ffffff;         /* açık yüzeyler */

  --brand: #0b58a4;           /* ana mavi */
  --brand-deep: #084378;      /* koyu mavi */
  --brand-light: #1170c9;     /* açık mavi */
  --brand-tint: #e8f0fa;      /* çok açık mavi (subtle bg) */

  --text: #1a2433;            /* koyu lacivert metin */
  --text-on-blue: #ffffff;    /* mavi üzerinde metin */
  --muted: #5a6b80;           /* gri-mavi muted */
  --muted-on-blue: rgba(255,255,255,0.78);
  --muted-2: #8895a8;

  --border: #d8d0c0;          /* warm border */
  --border-strong: #c4b8a0;
  --border-blue: rgba(11, 88, 164, 0.15);

  --accent: #f59e0b;          /* sıcak amber CTA */
  --accent-h: #fbbf24;
  --accent-deep: #d97706;

  --green: #16a34a;
  --green-bg: #dcfce7;
  --amber: #ea580c;
  --amber-bg: #ffedd5;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --info: #2563eb;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
  min-height: 100vh;
}

/* ===== Header ===== */
header {
  padding: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: var(--text-on-blue);
  box-shadow: 0 4px 16px rgba(11, 88, 164, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-on-blue);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { opacity: 0.92; }
.brand-icon {
  font-size: 36px;
  line-height: 1;
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.brand .sub {
  color: var(--muted-on-blue);
  margin: 0;
  font-size: 11.5px;
  font-weight: 500;
}

/* Top nav — grouped horizontal */
.top-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-left: auto;
  align-items: stretch;
}
.top-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.top-group-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  padding-left: 8px;
}
.top-group-items {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}
.top-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-blue);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.top-link:hover {
  background: rgba(255, 255, 255, 0.18);
}
.top-link.active {
  background: var(--bg);
  color: var(--brand);
  font-weight: 700;
  border-color: var(--accent);
}
@media (max-width: 1100px) {
  .top-nav { width: 100%; margin-left: 0; }
  .top-group { flex: 1; min-width: 180px; }
}
.muted { color: var(--muted); margin: 0; }
.muted-2 { color: var(--muted-2); }

main {
  padding: 24px 40px 60px;
  max-width: 1280px;
  margin: 0 auto;
}
footer {
  padding: 20px 40px 28px;
  max-width: 1280px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

/* ===== Home page grid ===== */
.hero-lg { padding: 32px; }
.hero-lg h2 { font-size: 28px; margin-bottom: 8px; }
.hero-lg p { font-size: 15px; max-width: 700px; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 12px 0 28px;
}
.home-card {
  display: block;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.home-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--brand);
  transition: width 0.18s;
}
.home-card-yks::before { background: var(--brand); }
.home-card-atlas::before { background: var(--accent); }
.home-card-okul::before { background: #16a34a; }
.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(11, 88, 164, 0.18);
  border-color: var(--brand);
}
.home-card:hover::before { width: 10px; }
.home-icon { font-size: 30px; margin-bottom: 10px; }
.home-name { font-size: 16px; font-weight: 700; color: var(--brand); margin-bottom: 4px; padding-left: 4px; }
.home-aciklama { font-size: 12.5px; color: var(--muted); padding-left: 4px; line-height: 1.4; }

/* ===== Page nav grid (page bottom — diğer araçlar) ===== */
.page-nav {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}
.page-nav-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.page-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.page-nav-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.page-nav-card:hover {
  background: var(--brand-tint);
  border-color: var(--brand);
  transform: translateY(-1px);
}
.page-nav-icon { font-size: 22px; flex-shrink: 0; }
.page-nav-body { flex: 1; min-width: 0; }
.page-nav-name { font-weight: 700; color: var(--brand); font-size: 13.5px; }
.page-nav-aciklama { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin: 2px 0 4px; }
.page-nav-grup {
  display: inline-block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--muted-2);
  padding: 1px 6px;
  background: var(--bg-2);
  border-radius: 4px;
}
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Cards / Form ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0;
  padding: 20px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.form-grid.two-col { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
label input[type=checkbox] {
  width: auto;
  margin-right: 6px;
  accent-color: var(--brand);
}
label.inline {
  flex-direction: row;
  align-items: center;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
}

input, select, textarea {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

/* Test cards (D/Y inputs) — koyu mavi */
.test-card {
  border: 1px solid var(--border-blue);
  border-radius: 10px;
  padding: 14px;
  background: var(--brand);
  color: var(--text-on-blue);
  box-shadow: 0 4px 12px rgba(11, 88, 164, 0.18);
}
.test-card h4 {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.test-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 56px 56px;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.test-row > label.inline {
  color: var(--text-on-blue);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  flex-direction: row;
  gap: 4px;
  display: flex;
  font-size: 12.5px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.test-row > label.inline small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10.5px;
  margin-left: 2px;
  flex-shrink: 0;
}
.test-row input {
  padding: 6px 4px;
  text-align: center;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
  width: 100%;
  min-width: 0;
  font-size: 13px;
}
.test-row .net {
  color: var(--text);
  background: var(--accent);
  padding: 5px 4px;
  border-radius: 5px;
  font-weight: 700;
  text-align: center;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
}

/* Test cards within form-grid: span 2 columns by default */
.test-card { grid-column: span 2; }
@media (max-width: 768px) {
  .test-card { grid-column: span 1; }
  .test-row { grid-template-columns: minmax(0, 1fr) 48px 48px 48px; }
}

/* Filters strip */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Buttons */
button.primary {
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  font-family: inherit;
}
button.primary:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}
button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
button.secondary {
  background: var(--brand-tint);
  color: var(--brand);
  border: 1px solid var(--border-blue);
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
button.secondary:hover { background: var(--brand); color: #fff; }

/* ===== Output panel ===== */
.out {
  margin-top: 22px;
  padding: 22px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.out h3 {
  margin: 0 0 16px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-tint);
}
.out h3:not(:first-child) { margin-top: 22px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}
.stat {
  padding: 14px 16px;
  background: var(--brand);
  color: var(--text-on-blue);
  border-radius: 10px;
  border: 1px solid var(--brand-deep);
  box-shadow: 0 2px 6px rgba(11, 88, 164, 0.2);
}
.stat .label {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
  font-weight: 600;
}
.stat .value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-on-blue);
  line-height: 1.1;
}
.stat.success { background: var(--green); border-color: #15803d; box-shadow: 0 2px 6px rgba(22,163,74,0.2); }
.stat.success .value { color: #fff; }
.stat.warn { background: var(--amber); border-color: var(--accent-deep); }
.stat.warn .value { color: #fff; }
.stat.neutral { background: var(--bg-2); color: var(--text); border-color: var(--border); box-shadow: none; }
.stat.neutral .value { color: var(--brand); }
.stat.neutral .label { color: var(--muted); }

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
table th, table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table th {
  background: var(--brand);
  color: var(--text-on-blue);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.4px;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 2px solid var(--brand-deep);
}
table tbody tr:hover { background: var(--brand-tint); }
table tbody tr:nth-child(even) { background: var(--bg-2); }
table tbody tr:nth-child(even):hover { background: var(--brand-tint); }
.tbl-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge.devlet { background: var(--green-bg); color: #166534; }
.badge.vakif  { background: var(--amber-bg); color: var(--accent-deep); }
.badge.kktc   { background: var(--brand-tint); color: var(--brand); }
.badge.guvenli { background: var(--green-bg); color: #166534; }
.badge.dengeli { background: var(--amber-bg); color: var(--accent-deep); }
.badge.riskli  { background: var(--red-bg); color: var(--red); }
.badge.yil { background: var(--brand-tint); color: var(--brand); border: 1px solid var(--border-blue); }

.err {
  color: var(--red);
  padding: 12px 16px;
  background: var(--red-bg);
  border-radius: 8px;
  border: 1px solid var(--red);
  margin-top: 12px;
}
.loading {
  color: var(--muted);
  font-style: italic;
  padding: 24px;
  text-align: center;
  background: var(--bg-2);
  border-radius: 8px;
  margin-top: 12px;
}

/* ===== Hero ===== */
.hero {
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: var(--text-on-blue);
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(11, 88, 164, 0.2);
}
.hero h2 { margin: 0 0 6px; color: #fff; font-size: 20px; }
.hero p { margin: 0; color: rgba(255, 255, 255, 0.85); font-size: 13.5px; }

/* ===== University cards (atlas) ===== */
.uni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.uni-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.uni-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--brand);
  transition: width 0.18s;
}
.uni-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(11, 88, 164, 0.15);
}
.uni-card:hover::before { width: 8px; }
.uni-card .uni-name { font-weight: 700; margin-bottom: 4px; padding-left: 8px; color: var(--brand); font-size: 14px; }
.uni-card .uni-meta { font-size: 12px; color: var(--muted); padding-left: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Linked text */
.link {
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--brand-tint);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 600;
}
.link:hover { text-decoration-color: var(--brand); }

/* Section dividers */
.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 24px 0 10px;
  font-weight: 700;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

/* Subtle info banner */
.note {
  padding: 12px 16px;
  background: var(--brand-tint);
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text);
}
.note.warn {
  background: var(--amber-bg);
  border-left-color: var(--amber);
}

details {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 6px;
  border: 1px solid var(--border);
}
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
  font-size: 13px;
}
details pre {
  margin: 10px 0 0;
  padding: 10px;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 12px;
  overflow-x: auto;
}

/* Curriculum cards */
.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.curriculum-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.curriculum-card:hover {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.curriculum-card .ders-ad { font-weight: 700; color: var(--brand); font-size: 14px; margin-bottom: 4px; }
.curriculum-card .ders-meta { font-size: 12px; color: var(--muted); }

.kazanim-list { margin-top: 16px; }
.kazanim-item {
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  font-size: 13.5px;
}
.kazanim-item .kod {
  display: inline-block;
  padding: 2px 8px;
  background: var(--brand);
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  margin-right: 8px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.kazanim-item .parent-baslik {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.kazanim-item .metin { color: var(--text); line-height: 1.55; }

/* Sınıf chips */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  padding: 8px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}
.chip:hover { border-color: var(--brand); }
.chip.active {
  background: var(--brand);
  color: var(--text-on-blue);
  border-color: var(--brand);
}

/* SEO content block (sayfa altı "nasıl kullanılır" + keywords) */
.seo-block {
  margin-top: 40px;
  padding: 28px 32px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.seo-block h2 {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-tint);
}
.seo-block h3 {
  margin: 22px 0 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}
.seo-block p { margin: 0 0 14px; line-height: 1.65; }
.seo-block ul, .seo-block ol { margin: 0 0 16px; padding-left: 24px; line-height: 1.7; }
.seo-block li { margin-bottom: 4px; }
.seo-block li b { color: var(--brand); }
.seo-block code {
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 90%;
  color: var(--brand-deep);
}

/* Responsive */
@media (max-width: 768px) {
  header, main, nav.tabs { padding-left: 16px; padding-right: 16px; }
  .form-grid { padding: 14px; }
  .stat .value { font-size: 20px; }
  .test-row { grid-template-columns: 1fr 50px 50px 50px; }
  .seo-block { padding: 18px 16px; }
  .seo-block h2 { font-size: 18px; }
  .seo-block h3 { font-size: 14px; }
}
