body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #1f232b;
  color: #e4e7ec;
}

.topbar {
  position: relative;
  background: #0f4c81;
  color: #fff;
  padding: 12px 16px;
}

.topbar-main,
.topbar-sub {
  margin-left: 80px; /* Logo sonrası metin başlangıcı */
}

.topbar-main {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.topbar-logo {
  position: absolute;
  left: 12px;
  top: 5px;
  bottom: 5px;
  height: calc(100% - 10px); /* banner üst-alt 5px boşluk */
  width: auto;
  max-width: 64px;
  object-fit: contain;
  opacity: 0.95;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.topbar-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar p {
  margin: 0;
  font-size: 13px;
}

.prepared-by {
  font-size: 11px;
  opacity: 0.92;
  white-space: nowrap;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 170px 170px 170px 120px 110px;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid #d0d5dd;
}

.filters input,
.filters select,
.filters button,
.file-label {
  height: 38px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  background: #fff;
}

.filters button {
  cursor: pointer;
  color: #1d2939;
  font-weight: 600;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1d2939;
  font-weight: 600;
}

.file-label input {
  display: none;
}

main {
  padding: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.card {
  display: grid;
  grid-template-columns: 90px 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
  background: #2b2f36;
  border: 1px solid #3b4250;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.cover {
  grid-column: 1;
  grid-row: 1;
  width: 90px;
  height: 130px;
  object-fit: cover;
  background: #e5e7eb;
}

.content {
  grid-column: 2;
  grid-row: 1;
  padding: 8px 10px 6px 0;
  color: #f2f4f7;
}

.content h3 {
  margin: 0;
  color: #f8fafc;
}

.card-bottom-note {
  grid-column: 1 / span 2;
  grid-row: 2;
  padding: 0 10px 10px;
  font-size: 16px;
  font-weight: 700;
  color: #ff6b57;
}

.card-bottom-note .hint {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #c7cedb;
}

.author,
.meta-line,
.summary {
  margin: 6px 0 0;
  font-size: 13px;
  color: #e4e7ec;
}

.summary {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  min-height: calc(1.35em * 2);
  max-height: calc(1.35em * 5);
}

.chips {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

.chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #98a2b3;
  color: #f2f4f7;
}

.chip.durum.musait {
  background: #ecfdf3;
  color: #027a48;
}

.chip.durum.oduncte {
  background: #fef3f2;
  color: #b42318;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(560px, 92vw);
  height: min(760px, 88vh);
  background: #1f2430;
  color: #f2f4f7;
  border: 1px solid #3b4250;
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-cover {
  position: absolute;
  right: 68px;
  top: 102px;
  width: 96px;
  height: 138px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #475467;
  background: #d0d5dd;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  color: #f8fafc;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

#modalTitle {
  margin: 0;
  padding-right: 28px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #f8fafc;
}

#modalBody {
  line-height: 1.45;
  font-size: 13px;
  color: #e4e7ec;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 14px;
}

.modal-meta {
  white-space: pre-wrap;
  padding-right: 160px;
  min-height: 150px;
}

.modal-summary {
  margin-top: 10px;
  white-space: pre-wrap;
  text-align: justify;
  text-justify: inter-word;
}

.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(15, 76, 129, 0.28);
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  display: none;
}

.back-to-top:hover {
  background: rgba(15, 76, 129, 0.45);
}

.back-to-top.show {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 980px) {
  .filters {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .prepared-by {
    font-size: 10px;
  }
}

@media (max-width: 640px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-main,
  .topbar-sub {
    margin-left: 60px;
  }

  .topbar-main h1 {
    font-size: 18px;
  }

  .topbar-logo {
    max-width: 46px;
    left: 10px;
  }

  .topbar-sub {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .modal {
    padding: 10px;
    align-items: flex-start;
  }

  .modal-content {
    width: 100%;
    height: min(86vh, 680px);
    border-radius: 10px;
    padding: 14px;
  }

  .modal-cover {
    right: 56px;
    top: 92px;
    width: 84px;
    height: 120px;
  }

  #modalTitle {
    font-size: 30px;
  }

  #modalBody {
    font-size: 12px;
    line-height: 1.4;
    padding-right: 4px;
  }

  .modal-meta {
    padding-right: 128px;
    min-height: 130px;
  }
}
