/* NTPRO Platform paneli (D34a-2). Görsel dil: frontend/src/index.css token'ları, Plus Jakarta Sans. */

@font-face {
  font-family: "Plus Jakarta Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --background: #f6f9fa;
  --foreground: #15232e;
  --card: #ffffff;
  --primary: #0e8087;
  --primary-ink: #0a5f64;
  --primary-soft: #e7f2f3;
  --amber: #d98a2b;
  --amber-soft: #fbf0e0;
  --amber-ink: #9a6015;
  --navy: #16294a;
  --muted: #eef3f4;
  --muted-foreground: #6a7b85;
  --border: #e7edef;
  --input: #829199;
  --danger: #c0392b;
  --danger-soft: #fbeceb;
  --success: #3ba55c;
  --success-soft: #e9f6ed;
  --radius: 0.625rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Plus Jakarta Sans Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--primary-ink);
}

h1 {
  font-size: 1.375rem;
  margin: 0 0 0.25rem;
  font-weight: 700;
}

h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.5rem;
  font-weight: 650;
  color: var(--navy);
}

/* ── üst şerit ─────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: #fff;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand img {
  width: 26px;
  height: 26px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
}

.nav a {
  color: #dce6ea;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  font-weight: 550;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.who {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #dce6ea;
  font-size: 0.875rem;
}

.who form {
  margin: 0;
}

.who button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.5rem;
  padding: 0.25rem 0.6rem;
  font: inherit;
  cursor: pointer;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.page-head p {
  margin: 0;
  color: var(--muted-foreground);
}

/* ── kart, ızgara ──────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}

.facts div {
  min-width: 0;
}

.facts dt {
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ── tablo ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  font-weight: 600;
  background: #fbfcfd;
}

tr:last-child td {
  border-bottom: 0;
}

td.wrap {
  white-space: normal;
  min-width: 9rem;
  overflow-wrap: anywhere;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tr.problem td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

/* Telefonda ve tablette (≤ 900 px) tablo kart listesine döner: her hücre etiketiyle alt alta. */
@media (max-width: 900px) {
  .table-wrap.stack {
    background: transparent;
    border: 0;
  }

  .stack table,
  .stack tbody,
  .stack tr,
  .stack td {
    display: block;
    width: 100%;
  }

  .stack thead {
    display: none;
  }

  .stack tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    padding: 0.35rem 0;
  }

  .stack tr.problem {
    border-left: 3px solid var(--danger);
  }

  .stack tr.problem td:first-child {
    box-shadow: none;
  }

  .stack td {
    border: 0;
    padding: 0.2rem 0.85rem;
    white-space: normal;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    text-align: right;
  }

  .stack td::before {
    content: attr(data-label);
    color: var(--muted-foreground);
    font-size: 0.8rem;
    text-align: left;
  }

  .stack td.num {
    text-align: right;
  }
}

/* ── rozet ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--muted);
  color: var(--foreground);
  white-space: nowrap;
}

.badge.ok {
  background: var(--success-soft);
  color: #22703d;
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber-ink);
}

.badge.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.stale {
  color: var(--danger);
  font-weight: 600;
}

.muted {
  color: var(--muted-foreground);
}

/* ── uyarı şeridi, ileti ───────────────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert.error {
  background: var(--danger-soft);
  border-color: #f0c9c5;
  color: #8e2a20;
}

.alert.warn {
  background: var(--amber-soft);
  border-color: #f1d9b5;
  color: var(--amber-ink);
}

.alert.success {
  background: var(--success-soft);
  border-color: #c7e6d1;
  color: #22703d;
}

.alert.info {
  background: var(--primary-soft);
  border-color: #cbe3e5;
  color: var(--primary-ink);
}

/* ── form ──────────────────────────────────────────────────── */
label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.field {
  margin-bottom: 0.85rem;
  min-width: 0;
}

.field .help {
  color: var(--muted-foreground);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.field .error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input:not([type]),
select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.65rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--input);
  border-radius: 0.5rem;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-grid {
  display: grid;
  gap: 0 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  background: var(--primary);
  color: #fff;
}

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

.btn.secondary {
  background: #fff;
  color: var(--foreground);
  border-color: var(--input);
}

.btn.secondary:hover {
  background: var(--muted);
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  background: #a02f23;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── özellik anahtarları ───────────────────────────────────── */
.features {
  display: grid;
  gap: 0 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.module {
  min-width: 0;
}

.switch-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}

.switch-row.locked,
.switch-row.planned {
  cursor: default;
}

.switch-row.planned {
  opacity: 0.55;
}

.switch-row .text {
  flex: 1;
  min-width: 0;
}

.switch-row .name {
  font-weight: 600;
  display: block;
}

.switch-row .desc {
  color: var(--muted-foreground);
  font-size: 0.82rem;
  display: block;
}

.switch-row .tag {
  font-size: 0.72rem;
  color: var(--muted-foreground);
  font-weight: 600;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 2.5rem;
  height: 1.45rem;
  margin: 0.1rem 0 0;
  border-radius: 999px;
  background: #c2cdd3;
  position: relative;
  cursor: inherit;
  transition: background 0.15s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.switch:checked {
  background: var(--primary);
}

.switch:checked::after {
  transform: translateX(1.05rem);
}

.switch:disabled {
  opacity: 0.7;
}

/* ── adımlar ───────────────────────────────────────────────── */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.steps li:last-child {
  border-bottom: 0;
}

.steps .dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--muted);
  color: var(--muted-foreground);
  flex: none;
}

.steps li[data-state="done"] .dot {
  background: var(--success);
  color: #fff;
}

.steps li[data-state="running"] .dot {
  background: var(--primary);
  color: #fff;
}

.steps li[data-state="failed"] .dot {
  background: var(--danger);
  color: #fff;
}

.steps .label {
  flex: 1;
  font-weight: 600;
}

/* ── giriş ─────────────────────────────────────────────────── */
.auth {
  max-width: 400px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.auth .card {
  padding: 1.5rem;
}

.auth .brand-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.auth .brand-line img {
  width: 32px;
  height: 32px;
}

.qr {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 1rem;
}

.qr svg {
  max-width: 100%;
  height: auto;
}

.secret {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  background: var(--muted);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  word-break: break-all;
  text-align: center;
  font-size: 0.95rem;
}

.codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  padding: 0;
  list-style: none;
}

details summary {
  cursor: pointer;
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

pre.output {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--muted);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  max-height: 260px;
  overflow: auto;
}

.filters {
  display: grid;
  gap: 0 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  align-items: end;
}

.tight {
  margin-bottom: 0.25rem;
}

.mt {
  margin-top: 1rem;
}

/* Telefonda dokunma hedefi en az 44 px (menü, çıkış, düğmeler). */
@media (max-width: 640px) {
  .nav a,
  .who button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .btn {
    min-height: 44px;
  }
}
