:root {
  --bg: #dfe7f0;
  --panel: rgba(239, 244, 248, .97);
  --panel-soft: #e4ebf2;
  --input: #fbfcfd;
  --text: #15243c;
  --muted: #5d6d85;
  --accent: #3977df;
  --accent-2: #137c76;
  --border: rgba(43, 82, 136, .16);
  --danger: #b4233b;
  --success: #08766e;
  --shadow: 0 18px 45px rgba(41, 77, 129, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, rgba(87, 150, 255, .08), transparent 28%),
    radial-gradient(circle at 90% 15%, rgba(66, 202, 185, .06), transparent 26%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1180px) minmax(180px, 220px);
  gap: 20px;
  width: min(1660px, calc(100% - 28px));
  margin: 0 auto;
  align-items: start;
}

.page {
  width: 100%;
  margin: 28px 0 48px;
}

.side-rail {
  position: sticky;
  top: 20px;
  margin-top: 88px;
}

.rail-panel {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(232, 239, 245, .94);
  box-shadow: 0 14px 38px rgba(41, 77, 129, .10);
}

.rail-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.rail-panel h2 {
  margin-bottom: 7px;
  font-size: 17px;
  line-height: 1.2;
}

.rail-meta,
.method-panel p,
.method-panel li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.48;
}

.rail-meta {
  margin-bottom: 14px;
}

.participant-count {
  padding: 12px;
  border: 1px solid rgba(19, 124, 118, .18);
  border-radius: 13px;
  background: rgba(19, 124, 118, .06);
}

.participant-count span,
.sidebar-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.participant-count strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-2);
  font-size: 26px;
  line-height: 1;
}

.sidebar-stats {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.sidebar-stats > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar-stats > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.sidebar-stats b {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.method-panel ul {
  display: grid;
  gap: 9px;
  margin: 13px 0;
  padding-left: 17px;
}

.method-panel .method-note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
}

.hero,
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  border-color: #294b72;
  border-left: 6px solid #22a69a;
  border-radius: 18px;
  background: #26486f;
  box-shadow: 0 18px 38px rgba(25, 55, 91, .19);
}

.admin-header {
  background: #f2f6fb;
}

.hero h1 {
  color: #ffffff;
}

.hero-title-line {
  display: flex;
  align-items: center;
  gap: 13px;
}

.hero-symbol {
  display: inline-grid;
  flex: 0 0 49px;
  width: 49px;
  height: 49px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 13px;
  color: #eef6ff;
  background: rgba(255, 255, 255, .08);
}

.hero-symbol svg {
  width: 32px;
  height: 32px;
}

.hero .eyebrow {
  color: #8ee6d9;
}

.hero p {
  color: #d9e5f1;
}

.hero .ghost,
.hero .outline {
  border-color: rgba(255, 255, 255, .26);
  color: #eef6ff;
  background: rgba(255, 255, 255, .10);
}

.hero .ghost:hover,
.hero .outline:hover {
  background: rgba(255, 255, 255, .18);
}

.mobile-calculation-info {
  display: none;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 9px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.03;
}

.hero p,
.admin-header p {
  max-width: 780px;
  margin-bottom: 0;
  line-height: 1.55;
}

.hero p {
  color: #d9e5f1;
}

.admin-header p {
  color: var(--muted);
}

.header-actions,
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  margin-top: 18px;
}

.entry-column {
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 13px;
  border-bottom: 1px solid var(--border);
}

.panel-title h2 {
  margin-bottom: 4px;
  font-size: 19px;
}

.panel-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.test-grid {
  display: grid;
  gap: 10px;
  padding: 17px 20px 20px;
}

.test-card {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 96px 96px 86px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
}

.test-meta {
  align-self: center;
}

.test-meta strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.test-meta span {
  color: var(--muted);
  font-size: 12px;
}

label {
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(43, 82, 136, .22);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: var(--input);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 119, 223, .15);
}

.live-net {
  min-height: 41px;
  padding: 7px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
}

.live-net small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.live-net b {
  color: var(--accent-2);
}

.actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}

.primary,
.save-button,
.share-button {
  border: 0;
  border-radius: 11px;
  padding: 12px 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #5688e5);
  font-weight: 800;
}

.ghost,
.outline,
.danger-button {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  color: var(--text);
  background: #edf3ff;
  font-weight: 750;
}

.danger-button {
  border-color: rgba(251,113,133,.35);
  color: #b4233b;
  background: rgba(251,113,133,.10);
}

.outline {
  white-space: nowrap;
  background: #ffffff;
}

.button-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.message {
  display: none;
  margin: 12px 20px 16px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.dialog-card .message {
  margin-left: 0;
  margin-right: 0;
}

.message.show {
  display: block;
}

.message.error {
  color: var(--danger);
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.22);
}

.message.success {
  color: var(--success);
  background: rgba(94,234,212,.08);
  border: 1px solid rgba(94,234,212,.22);
}

.empty-result {
  padding: 38px 24px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.result-content {
  display: grid;
  gap: 12px;
  padding: 18px 20px 22px;
}

.rank-card,
.score-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(87, 150, 255, .12), rgba(255, 255, 255, .9));
}

.rank-card span,
.rank-card small,
.score-card span,
.score-card small {
  display: block;
  color: var(--muted);
}

.rank-card strong {
  display: block;
  margin-top: 3px;
  color: var(--accent-2);
  font-size: 42px;
}

.rank-card.locked strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
}

.score-card strong {
  display: block;
  margin: 3px 0;
  font-size: 29px;
}

.score-card small,
.rank-card small {
  font-size: 11px;
}

.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.totals div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f1f6ff;
}

.totals .wide {
  grid-column: 1 / -1;
}

.totals span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.totals b {
  font-size: 19px;
}

.net-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
}

.net-row {
  display: grid;
  grid-template-columns: 1fr 58px 58px 66px;
  gap: 6px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.net-row:last-child {
  border-bottom: 0;
}

.net-row span:not(:first-child) {
  text-align: right;
}

.net-row b {
  color: var(--accent-2);
  text-align: right;
}

.net-comparison {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
}

.net-comparison.loading,
.net-comparison.same {
  color: var(--muted);
}

.net-comparison.above {
  color: #08766e;
}

.net-comparison.below {
  color: #b4233b;
}

.save-button {
  width: 100%;
}

.result-actions {
  display: grid;
  gap: 9px;
}

.share-button {
  width: 100%;
  border: 1px solid rgba(19, 124, 118, .25);
  color: #ffffff;
  background: linear-gradient(135deg, #137c76, #3977df);
}

.share-status {
  min-height: 18px;
  margin: -3px 2px 0;
  color: var(--success);
  font-size: 12px;
  text-align: center;
}

.leaderboard {
  margin-top: 18px;
}

.public-stats {
  margin: 0 18px 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(241, 246, 255, .82);
}

.public-stats-head h3 {
  margin: 0;
  font-size: 18px;
}

.public-stats-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.public-stats-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.public-stats-cards > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.public-stats-cards span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.public-stats-cards strong {
  display: block;
  margin-top: 7px;
  color: var(--accent-2);
  font-size: 22px;
}

.subject-average-table {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.subject-average-table th:first-child,
.subject-average-table td:first-child {
  text-align: left;
}

.subject-average-table th:last-child,
.subject-average-table td:last-child {
  text-align: right;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-size: 13px;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  color: var(--muted);
  background: #f1f6ff;
}

td:first-child {
  color: var(--accent-2);
  font-weight: 800;
}

.privacy-note,
.consent-note {
  margin: 0;
  padding: 13px 18px 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.consent-note {
  padding: 12px 0 0;
}

footer {
  padding: 20px 4px 0;
  color: #64748b;
  text-align: center;
  font-size: 12px;
}

dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(21, 36, 60, .38);
  backdrop-filter: blur(5px);
}

.dialog-card {
  padding: 20px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin-bottom: 4px;
}

.dialog-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.dialog-card > label {
  display: block;
  margin-top: 12px;
}

.close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #edf3ff;
  font-size: 23px;
}

.full-button {
  width: 100%;
  margin-top: 14px;
}

.lookup-rank {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(19, 124, 118, .28);
  border-radius: 15px;
  text-align: center;
  background: rgba(19, 124, 118, .07);
}

.lookup-rank span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.lookup-rank strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-2);
  font-size: 25px;
}

.lookup-rank small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* Yönetici */
.admin-page {
  width: min(1700px, calc(100% - 28px));
  margin: 24px auto 50px;
}

.admin-header h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.summary-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-2);
  font-size: 25px;
}

.admin-section {
  margin-top: 18px;
}

.admin-record-title {
  align-items: flex-end;
}

.record-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 130px;
  gap: 8px;
}

.record-filters input,
.record-filters select {
  margin: 0;
}

.admin-table-scroll {
  max-height: 690px;
}

.admin-record-table th,
.admin-record-table td {
  padding: 10px 11px;
  font-size: 12px;
}

.admin-record-table tbody tr {
  cursor: pointer;
}

.admin-record-table tbody tr:hover {
  background: rgba(57, 119, 223, .06);
}

.inactive-row {
  opacity: .55;
}

.action-cell {
  display: flex;
  gap: 6px;
}

.small-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  background: #edf3ff;
  font-size: 11px;
  font-weight: 700;
}

.small-button.danger {
  color: #b4233b;
  border-color: rgba(251,113,133,.3);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
}

.detail-dialog-card {
  width: min(850px, calc(100vw - 50px));
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.detail-summary div {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #f1f6ff;
}

.detail-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.detail-summary b {
  font-size: 17px;
}

/* Giriş */
.auth-card {
  width: min(440px, calc(100% - 28px));
  margin: 8vh auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 34px;
}

.auth-card > p {
  color: var(--muted);
  line-height: 1.5;
}

.auth-form label {
  display: block;
  margin-top: 13px;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

@media (max-width: 1150px) {
  .stat-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-header {
    flex-direction: column;
  }
}

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

  .hero {
    flex-direction: column;
  }

  .admin-record-title {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 1450px) {
  .site-shell {
    display: block;
    width: min(1180px, calc(100% - 28px));
  }

  .side-rail {
    display: none;
  }

  .mobile-calculation-info {
    display: block;
    margin-top: 12px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: rgba(232, 239, 245, .9);
  }

  .mobile-calculation-info summary {
    padding: 14px 0;
    cursor: pointer;
    color: #26486f;
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-calculation-info ol {
    display: grid;
    gap: 8px;
    margin: 0 0 10px;
    padding-left: 19px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }

  .mobile-calculation-info p {
    margin-bottom: 14px;
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 700;
  }
}

@media (max-width: 650px) {
  .hero-title-line {
    gap: 10px;
  }

  .hero-symbol {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }

  .hero-symbol svg {
    width: 28px;
    height: 28px;
  }

  .test-card {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .test-meta {
    grid-column: 1;
    grid-row: 1;
  }

  .test-meta strong {
    margin-bottom: 0;
  }

  .test-meta span {
    display: none;
  }

  .live-net {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    padding: 5px;
  }

  .test-card label {
    grid-row: 2;
  }

  .test-card input {
    margin-top: 4px;
    padding: 9px 10px;
  }

  .net-row {
    grid-template-columns: 1fr 52px 52px 58px;
  }

  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }

  .public-stats-cards {
    grid-template-columns: 1fr 1fr;
  }

  .record-filters {
    grid-template-columns: 1fr;
  }

  .detail-summary {
    grid-template-columns: 1fr 1fr;
  }
}


.leaderboard-pagination {
  border-top: 1px solid var(--border);
}

button:disabled {
  cursor: not-allowed;
  opacity: .52;
}
