
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f7f8;
  color: #1f2937;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.sub {
  color: #6b7280;
  margin-bottom: 24px;
}

.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

.th-group {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e5e7eb;
}

.th-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.th-group-title {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.th-group-lines {
  padding-left: 18px;
}

.th-group-line {
  position: relative;
}

.th-group-line::before {
  content: "↳";
  position: absolute;
  left: -14px;
  color: #6b7280;
}

.th-arrow {
  display: inline-block;
  width: 14px;
  color: #6b7280;
}

.panel {
  background: white;
  border: none;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
  box-shadow: 0 20px 50px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 12px;
  background: linear-gradient(90deg, #1f2937 0%, #4b5563 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.question {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  transition: all 0.2s ease;
  cursor: pointer;
}

.question:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
  transform: translateX(2px);
}

.question-category {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.question-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.option {
  display: block;
  margin: 6px 0;
  font-size: 14px;
  cursor: pointer;
}

.top-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.mini-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06), inset 0 1px 2px rgba(255,255,255,0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.mini-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mini-card:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.12), inset 0 1px 2px rgba(255,255,255,0.6);
  transform: translateY(-4px);
  border-color: #cbd5e1;
}

.mini-card:hover::before {
  opacity: 1;
}

.mini-card .label {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}

.mini-card .value {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mini-card .value.top-small {
  font-size: 24px;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 700;
}

.score-list {
  display: grid;
  gap: 10px;
}

.score-item {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), inset 0 1px 1px rgba(255,255,255,0.5);
  transition: all 0.2s ease;
}

.score-item:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.1), inset 0 1px 1px rgba(255,255,255,0.5);
  transform: translateY(-2px);
}

.score-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.bar {
  width: 100%;
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

.fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 999px;
}

.target-item {
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), inset 0 1px 1px rgba(255,255,255,0.5);
  transition: all 0.2s ease;
}

.target-item:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.1), inset 0 1px 1px rgba(255,255,255,0.5);
  transform: translateX(2px);
}

.target-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.target-reasons {
  font-size: 13px;
  color: #4b5563;
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.channel-box {
  border: none;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  min-height: 140px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06), inset 0 1px 2px rgba(255,255,255,0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.channel-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  border-radius: 16px 16px 0 0;
  opacity: 0.3;
}

.channel-box:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.12), inset 0 1px 2px rgba(255,255,255,0.6);
  transform: translateY(-3px);
}

.channel-box:hover::before {
  opacity: 1;
}

.channel-box h4 {
  margin: 8px 0 12px 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #1f2937;
}

.channel-box ul {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
}

.channel-box li {
  margin-bottom: 14px;
  line-height: 1.45;
}

.channel-box li:last-child {
  margin-bottom: 0;
}

.channel-box li strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  color: #111827;
}

.channel-box li .muted {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.detail-box {
  border: none;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: 0 4px 15px rgba(0,0,0,0.06), inset 0 1px 2px rgba(255,255,255,0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-box:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.12), inset 0 1px 2px rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

.detail-box strong {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  margin: 3px 4px 0 0;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

.detail-space {
  margin-top: 8px;
}

.submit-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.submit-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: #1f2937;
  color: #fff;
  transition: opacity .2s ease, transform .2s ease;
}

.submit-btn:hover {
  opacity: .92;
}

.submit-btn:active {
  transform: scale(.99);
}

.submit-status {
  min-height: 20px;
}

.detail-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  display: block;
}

.detail-card-title {
  margin: 0 0 14px 0;
  font-size: 18px;
}

.detail-accordion {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fcfcfd;
}

.detail-summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  outline: none;
  color: #1f2937;
}

.detail-table-wrap {
  margin-top: 14px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  table-layout: fixed;
}

.detail-table th:nth-child(1),
.detail-table td:nth-child(1) {
  width: 28%;
}

.detail-table th:nth-child(2),
.detail-table td:nth-child(2) {
  width: 16%;
}

.detail-table th:nth-child(3),
.detail-table td:nth-child(3) {
  width: 28%;
}

.detail-table th:nth-child(4),
.detail-table td:nth-child(4) {
  width: 28%;
}

.detail-table th,
.detail-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.35;
}

.detail-table th {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
}

.detail-table td {
  color: #1f2937;
  border-bottom: 1px solid #f1f5f9;
}

.detail-table tr:last-child td {
  border-bottom: none;
}

.detail-note {
  margin-top: 12px;
  font-size: 12px;
  color: #64748b;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
}

  .detail-group {
    margin-bottom: 10px;
  }

  .detail-group-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #111827;
  }


.detail-subtle {
  color: #64748b;
  font-size: 11px;
}

.question-tools {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.question-tool-select,
.question-tool-input {
  height: 42px;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.question-tool-select {
  min-width: 200px;
}

.question-tool-input {
  flex: 1;
  min-width: 200px;
}

.question-tool-select:focus,
.question-tool-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}

.questions-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  max-height: 78vh;
}

.questions-scroll::-webkit-scrollbar {
  width: 6px;
}

.questions-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.questions-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.questions-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.page-btn {
  min-width: 140px;
  padding: 10px 14px;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: #f3f4f6;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
}

.no-question-result {
  padding: 18px 10px;
  color: #6b7280;
  font-size: 14px;
}

.error {
  min-height: 22px;
  margin-top: 14px;
  font-size: 14px;
  color: #dc2626;
}

.questions-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 780px;
}

.questions-panel-header {
  flex-shrink: 0;
}

.recommendation-detail-row td {
  background: #fafafa;
  padding: 10px 14px 14px;
}

.recommendation-detail-box {
  border-left: 3px solid #d9d9d9;
  padding-left: 12px;
}

.rec-group + .rec-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #dcdcdc;
}

.rec-group-title {
  margin-bottom: 6px;
  line-height: 1.5;
}

.rec-detail-list {
  margin-top: 4px;
}

.rec-detail-list li {
  margin-bottom: 4px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .top-cards,
  .detail-grid,
  .rec-grid {
    grid-template-columns: 1fr;
  }

  .question-tools {
    flex-direction: column;
  }

  .question-tool-select,
  .question-tool-input {
    width: 100%;
    min-width: 100%;
  }

  .questions-pagination {
    flex-wrap: wrap;
  }

  .page-btn {
    flex: 1;
    min-width: 120px;
  }

  .page-indicator {
    width: 100%;
    text-align: center;
  }
}

/* Admin tablo kartları */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 20px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 8px;

  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;

  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  transition: all 0.2s ease;
  cursor: pointer;

  text-decoration: none;
  color: inherit;
  min-height: 135px;
}

.admin-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
  transform: translateX(2px);
}

.admin-card-title {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 16px;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
}

.admin-card-icon {
  font-size: 20px;
  opacity: 0.8;
  line-height: 1;
}

.admin-card-code {
  display: inline-block;
  width: fit-content;

  padding: 4px 9px;
  border-radius: 8px;

  background: #eef2ff;
  color: #3730a3;

  font-size: 12px;
  font-family: Consolas, Monaco, monospace;
  font-weight: 600;
}

.admin-card-description {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 1200px) {
  .admin-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 600px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* Help Button */

.help-btn {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: #111827;
  color: #ffffff;
  font-size: 34px;
  font-weight: 800;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}

.help-btn:hover {
  transform: scale(1.05);
  background: #1f2937;
}

/* Help Popup */

.help-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}

.help-popup.is-open {
    display: flex;
}

.help-popup-box {
  position: relative;
  width: min(920px, calc(100vw - 64px));
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 22px;
  padding: 34px 38px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  text-align: left;
  border: 1px solid #e5e7eb;
}

.help-popup-box h2 {
  margin: 0 44px 12px 0;
  font-size: 26px;
  color: #111827;
  line-height: 1.25;
}

.help-intro {
  margin: 0 0 20px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
}

.help-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #111827;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.help-close:hover {
  background: #e5e7eb;
}

.help-rule-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0 24px;
}

.help-rule-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.help-rule-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #111827;
}

.help-rule-card span {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
}

.help-rule-card.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.help-rule-card.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.help-rule-card.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.help-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.help-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #111827;
}

.help-section p {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
}

.help-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.help-flow span {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
  font-family: Consolas, Monaco, monospace;
}

.help-flow b {
  color: #4b5563;
}

.help-list {
  margin: 0;
  padding-left: 20px;
  color: #374151;
  font-size: 14px;
  line-height: 1.8;
}

.help-list li {
  margin-bottom: 8px;
}

.help-list code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-family: Consolas, Monaco, monospace;
}

body.help-popup-open {
  overflow: hidden;
}

/* DİKKAT: CSS dosyasında tek @ olacak. @@media değil. */
@media (max-width: 900px) {
  .help-popup {
    padding: 32px 16px;
  }

  .help-popup-box {
    width: 100%;
    max-height: calc(100vh - 64px);
    padding: 28px 22px;
    border-radius: 18px;
  }

  .help-rule-cards {
    grid-template-columns: 1fr;
  }

  .help-btn {
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    font-size: 30px;
  }
}


/* Admin Relations cards */

.relations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1180px;
}

.relations-card {
  display: flex;
  flex-direction: column;
  gap: 12px;

  min-height: 115px;
  padding: 18px;

  text-decoration: none;
  color: inherit;

  border: 1px solid #e2e8f0;
  border-radius: 14px;

  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  transition: all 0.2s ease;
}

.relations-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
  transform: translateY(-2px);
}

.relations-card strong {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.relations-card span {
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
}

@media (max-width: 1000px) {
  .relations-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 650px) {
  .relations-grid {
    grid-template-columns: 1fr;
  }
}