/*
 * Renkler ve fontlar urfakulturatlasi.com.tr'nin kendi tasarım değişkenlerinden alındı:
 * krem zemin (--warm-100), bronz/altın vurgular (--warm-400..600), lacivert (--cool-800/900),
 * Cormorant Garamond (başlık) + Jost (metin). Tüm metin/zemin çiftleri WCAG AA (≥4.5:1).
 */
:root {
  --ff-display: "Cormorant Garamond", Georgia, serif;
  --ff-body: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: #FBF7F1;          /* sitenin krem zemini */
  --surface: #FFFFFF;
  --surface-2: #F7F0E4;
  --text: #1A1108;        /* 17.4:1 */
  --muted: #7A6A52;       /* 4.9:1 */
  --line: #EADFCB;
  --brand: #131F2A;       /* lacivert: ana butonlar, seçili sekme */
  --brand-ink: #FBF7F1;
  --link: #7A5A2E;        /* bronz: bağlantılar (5.9:1) */
  --gold: #C4A06E;        /* altın: rozet ve süsleme (metin rengi olarak kullanılmaz) */
  --gold-ink: #2C1D0A;
  --tr: #6B4E26;
  --tr-bg: #F2E8D8;
  --en: #1E2D3A;
  --en-bg: #E6EBEF;
  --final: #3F5E31;
  --final-bg: #ECF1E3;
  --warn: #8A5A00;
  --warn-bg: #FBF0D9;
  --err: #A3271C;
  --err-bg: #FBE9E6;
  --ok-bg: #ECF1E3;
  --ins: #DCE8CC;
  --del: #F5D9D2;
  --shadow: 0 1px 2px rgba(44, 29, 10, .05), 0 4px 14px rgba(44, 29, 10, .05);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  /* Koyu tema: sitenin lacivert skalası (--cool-700..900) + altın vurgu */
  :root:not([data-theme="light"]) {
    --bg: #0B131B; --surface: #131F2A; --surface-2: #182634; --text: #EDE6DA; --muted: #B0A08A; --line: #26394A;
    --brand: #C4A06E; --brand-ink: #0B131B; --link: #DEC9A8; --gold: #C4A06E; --gold-ink: #0B131B;
    --tr: #DEC9A8; --tr-bg: #22190E; --en: #A9C0D3; --en-bg: #142130; --final: #A8C79A; --final-bg: #17231A;
    --warn: #E7B24A; --warn-bg: #2A2112; --err: #F2867B; --err-bg: #2E1A18; --ok-bg: #17231A;
    --ins: #2F4A27; --del: #5A2520; --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.6 var(--ff-body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold); color: var(--gold-ink); }
a { color: var(--link); text-underline-offset: .15em; }
h1, h2 { font-family: var(--ff-display); font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 2.05rem; line-height: 1.15; margin: 0 0 .35rem; }
h2 { font-size: 1.4rem; line-height: 1.25; margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* ---------- Üst bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: .6rem 1.25rem; border-bottom: 1px solid var(--line);
  /* Sitedeki gibi yarı saydam krem başlık */
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none;
  font-family: var(--ff-display); font-size: 1.3rem; font-weight: 600; }
.brand-logo { display: block; height: 44px; width: auto; flex-shrink: 0; }
.brand-text { line-height: 1.1; }
.brand-sub { color: var(--link); font-style: italic; font-weight: 500; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: .35rem .65rem; border-radius: 7px; }
.topbar nav a:hover { background: var(--surface-2); color: var(--text); }
.topbar nav a.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.who { display: flex; gap: .85rem; align-items: center; font-size: .9rem; }
.who span { font-weight: 600; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 6rem; }

/* ---------- Ortak ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.narrow { max-width: 440px; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--final) 30%, transparent); }
.flash-err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.flash-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }

label { display: block; font-weight: 550; font-size: .9rem; margin-bottom: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.filters input, .filters select, .inline input, .inline select { display: inline-block; width: auto; margin: 0; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus, .rte:focus {
  outline: 2px solid color-mix(in srgb, var(--gold) 70%, transparent); outline-offset: 1px; border-color: var(--gold);
}

.btn {
  display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .95rem; font: inherit; font-weight: 550;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-sm { padding: .3rem .65rem; font-size: .88rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.btn-success { background: var(--final); border-color: var(--final); color: var(--surface); }
.btn-success:hover { background: color-mix(in srgb, var(--final) 88%, black); }
.btn-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }
.btn-danger { color: var(--err); }
button.link { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: .15em; }

.badge { display: inline-block; font-size: .76rem; font-weight: 500; letter-spacing: .02em; padding: .12rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.st-bekliyor { color: var(--muted); }
.st-atandi { color: var(--en); background: var(--en-bg); border-color: transparent; }
.st-devam { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.st-gonderildi { color: var(--tr); background: var(--tr-bg); border-color: transparent; }
.st-iade { color: var(--err); background: var(--err-bg); border-color: transparent; }
.st-onaylandi { color: var(--final); background: var(--final-bg); border-color: transparent; }

.chip { display: inline-block; padding: .1rem .5rem; margin: 0 .3rem .3rem 0; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; }

/* ---------- Giriş ---------- */
.page-login .wrap { display: grid; place-items: center; min-height: 80vh; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { margin-bottom: .2rem; }
.login-card p { margin-top: 0; margin-bottom: 1.25rem; }

/* ---------- Liste sayfaları ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: 0; }
.progress-card { min-width: 240px; }
.progress-num { font-size: .9rem; margin-bottom: .3rem; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--final); border-radius: 99px; }

.filters { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=search] { min-width: 220px; }
.tabs { display: flex; gap: .2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: .2rem; }
.tabs a { padding: .3rem .7rem; border-radius: 7px; text-decoration: none; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.tabs a.on { background: var(--brand); color: var(--brand-ink); }

.table-wrap { padding: 0; overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: .6rem .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list th { text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; font-size: .72rem; background: var(--surface-2); }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.title-link { color: var(--text); text-decoration: none; font-weight: 550; }
.title-link:hover { color: var(--link); text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem; }
.pager { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: 1rem; }
.pager a, .pager span { min-width: 2.1rem; text-align: center; padding: .3rem .5rem; border-radius: 7px; text-decoration: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.pager a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
.stat { padding: 1rem 1.1rem; }
.stat .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.stat .v { font-family: var(--ff-display); font-size: 2.3rem; line-height: 1.1; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.section-title { margin: 1.75rem 0 .75rem; font-size: 1.1rem; }
.mini-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); min-width: 120px; }
.mini-bar span { display: block; height: 100%; }
.bg-onaylandi { background: var(--final); }
.bg-gonderildi { background: var(--gold); }
.bg-devam { background: var(--warn); }
.bg-iade { background: var(--err); }

.bulk { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .85rem 1rem; margin-bottom: 1rem; }
.bulk select { display: inline-block; width: auto; margin: 0; }
.bulk .sep { width: 1px; align-self: stretch; background: var(--line); }

/* ---------- Kullanıcı formları ---------- */
.user-form h2 { margin-bottom: 1rem; }
.user-form, #yeni { scroll-margin-top: 70px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; }
.pw-row { display: flex; gap: .4rem; align-items: center; margin-top: .3rem; }
.pw-row input { margin: 0; flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.check-row { align-self: end; margin-bottom: 1.4rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }

/* ---------- Editör ---------- */
.edit-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1.25rem; flex-wrap: wrap; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .35rem; }
.edit-head .meta { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; font-size: .88rem; margin-top: .4rem; }
.edit-nav { display: flex; gap: .4rem; }

.field { margin-bottom: 1.25rem; padding: 1rem 1.1rem 1.1rem; }
.field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.toggle { display: flex; gap: .35rem; align-items: center; font-weight: 500; font-size: .85rem; color: var(--muted); margin: 0; }
.pane { border-radius: 8px; border: 1px solid var(--line); margin-bottom: .7rem; overflow: hidden; }
.pane:last-child { margin-bottom: 0; }
.pane-label {
  display: flex; align-items: center; gap: .5rem; padding: .4rem .75rem; font-size: .8rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .12em; border-bottom: 1px solid var(--line);
}
.pane-label .link, .pane-tools { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.lang { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.3rem; border-radius: 5px; color: var(--surface); font-size: .7rem; font-weight: 600; letter-spacing: .04em; }
.pane-tr { border-color: color-mix(in srgb, var(--tr) 30%, var(--line)); }
.pane-tr .pane-label { background: var(--tr-bg); color: var(--tr); }
.pane-tr .lang { background: var(--tr); }
.pane-en { border-color: color-mix(in srgb, var(--en) 30%, var(--line)); }
.pane-en .pane-label { background: var(--en-bg); color: var(--en); }
.pane-en .lang { background: var(--en); }
.pane-final { border-color: color-mix(in srgb, var(--final) 45%, var(--line)); border-width: 2px; }
.pane-final .pane-label { background: var(--final-bg); color: var(--final); }
.pane-final .lang { background: var(--final); }

.pane-body { padding: .75rem .9rem; }
.pane-body.plain { white-space: pre-wrap; }
.pane-final input.final-input, .pane-final textarea.final-input { margin: 0; border: 0; border-radius: 0; padding: .75rem .9rem; background: var(--surface); }
.pane-final textarea.final-input { min-height: 5rem; }
.hint { font-size: .8rem; color: var(--muted); padding: .2rem .9rem .5rem; }

.field-big .pane-tr .pane-body, .field-big .pane-en .pane-body { max-height: 38vh; overflow-y: auto; }
.field-big .pane-final .pane-body, .field-big .pane-final textarea.final-input { max-height: 60vh; min-height: 30vh; overflow-y: auto; }
.field-big.type-textarea .pane-final textarea.final-input { height: 30vh; }

.rich { font-size: 1rem; line-height: 1.7; }
.rich p { margin: 0 0 .8em; }
.rich h1, .rich h2, .rich h3 { margin: 1em 0 .5em; line-height: 1.3; }
.rich h2 { font-size: 1.2rem; }
.rich h3 { font-size: 1.08rem; }
.rich figure { margin: 1em 0; padding: .5rem; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 6px; }
.rich img { max-width: 100%; max-height: 260px; height: auto; width: auto; display: block; margin: 0 auto; }
.rich figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: .35rem; }
.rte figcaption { color: var(--text); background: var(--surface); border-radius: 4px; padding: .15rem .3rem; outline: 1px dotted var(--line); }
.rte { min-height: 6rem; }
.rte:focus { outline-offset: -2px; }

.rte-toolbar { display: flex; flex-wrap: wrap; gap: .2rem; padding: .35rem .5rem; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
.rte-toolbar button { font: inherit; font-size: .85rem; padding: .2rem .5rem; border: 1px solid transparent; background: none; border-radius: 5px; color: var(--text); cursor: pointer; }
.rte-toolbar button:hover { background: var(--surface); border-color: var(--line); }
.rte-toolbar .sep { width: 1px; background: var(--line); margin: .15rem .2rem; }

.diff-out { line-height: 1.7; }
.field-big .diff-out { max-height: 60vh; overflow-y: auto; }
ins { background: var(--ins); text-decoration: none; border-radius: 3px; }
del { background: var(--del); border-radius: 3px; }

.note-card label { margin: 0; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem max(1.25rem, calc((100vw - 1180px) / 2 + 1.25rem)); background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .05); flex-wrap: wrap;
}
.actionbar .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.actionbar form { margin: 0; }
.save-state { font-size: .88rem; color: var(--muted); }
.save-state.is-dirty { color: var(--warn); }
.save-state.is-ok { color: var(--final); }
.save-state.is-error { color: var(--err); font-weight: 600; }

dialog { max-width: 520px; width: calc(100% - 2rem); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
dialog h2 { margin-bottom: 1rem; }
dialog .right { display: flex; justify-content: flex-end; gap: .5rem; }

@media (max-width: 720px) {
  .wrap { padding: 1rem 1rem 8rem; }
  .topbar { position: static; padding: .55rem 1rem; gap: .5rem; justify-content: space-between; }
  .topbar nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; }
  .topbar nav a { white-space: nowrap; }
  .brand { font-size: 1.1rem; gap: .45rem; min-width: 0; }
  .brand-logo { height: 36px; }
  .brand-text { white-space: normal; }
  .hide-sm { display: none; }
  .filters input[type=search] { min-width: 0; flex: 1; }
  .actionbar { padding: .6rem 1rem; }
  .actionbar .actions { width: 100%; }
  .actionbar .btn { flex: 1; justify-content: center; }
}

.steps { padding-left: 1.2rem; margin: .5rem 0 1rem; }
.steps li { margin-bottom: .5rem; }

.restore-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.restore-actions { display: flex; gap: .4rem; }
.stat .v a { text-decoration: none; color: var(--link); }
.stat .v a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.login-logo { display: block; height: 66px; width: auto; margin: 0 0 1rem; }
.page-login .topbar { display: none; }  /* girişte kimlik kartta gösterilir, tekrar etmesin */
