@font-face { font-family: "Playfair Display"; src: url("/fonts/PlayfairDisplay.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/fonts/Montserrat.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F6F1E8;
  --surface: #FFFDF9;
  --surface-2: #FBF7F0;
  --ink: #1E2A24;
  --muted: #6E6B60;
  --line: #E7DDCC;
  --green: #0F3D2A;
  --green-soft: #E3ECE5;
  --gold: #B8925A;
  --gold-soft: #F4EAD9;
  --ok: #2F7A4F;   --ok-bg: #E4F1E8;
  --warn: #9A6414; --warn-bg: #FBF0DC;
  --err: #A63A32;  --err-bg: #F8E3E0;
  --info: #3D5A6E; --info-bg: #E5EDF2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 42, 36, .05), 0 6px 24px rgba(30, 42, 36, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1512; --surface: #151E1A; --surface-2: #1A2520; --ink: #ECE5D8; --muted: #A39E90; --line: #2A3832;
    --green: #9DD1B3; --green-soft: #1E2E27; --gold: #D6B47C; --gold-soft: #2C271D;
    --ok: #7CC79A; --ok-bg: #18301F; --warn: #E3B467; --warn-bg: #33281A; --err: #EE8C84; --err-bg: #3A1E1B;
    --info: #9EC1D6; --info-bg: #1A2A33;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "Montserrat", system-ui, sans-serif; }
a { color: var(--green); }
h1, h2, h3 { font-family: "Playfair Display", Georgia, serif; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
code { font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* ---- yerleşim ---- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brandmark { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.brandmark .z { font-family: "Playfair Display", serif; font-size: 26px; letter-spacing: .18em; color: var(--gold); font-weight: 600; }
.brandmark .h { font-size: 10px; letter-spacing: .5em; color: var(--green); font-weight: 600; margin-left: .5em; }
.brandmark .t { font-size: 11px; color: var(--muted); margin-top: 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--green-soft); color: var(--green); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--muted); }
.main { padding: 36px 44px 64px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head p { color: var(--muted); margin: 0; max-width: 640px; }

/* ---- bileşenler ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-top: 14px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.err { color: var(--err); background: var(--err-bg); }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.plain { color: var(--muted); background: var(--surface-2); }
.badge.plain::before { display: none; }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .value { font-family: "Playfair Display", serif; font-size: 22px; }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.info { background: var(--info-bg); color: var(--info); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--green); background: var(--green); color: var(--surface); font: 600 14px "Montserrat", sans-serif; cursor: pointer; text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn { color: #0E1512; } }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.danger { background: transparent; border-color: var(--err); color: var(--err); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- formlar ---- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 13px; }
.field .help { font-size: 12px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font: 14px "Montserrat", sans-serif;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
textarea { font: 13px/1.6 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; min-height: 520px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.secret-state { font-size: 12px; }
input[type=color] { width: 52px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 3px; }
.color-row { display: flex; gap: 10px; align-items: center; }

/* ---- tablolar / listeler ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.plan-row { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; }
.plan-row .slot { font-family: "Playfair Display", serif; font-size: 22px; color: var(--green); }
.plan-row .times { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); align-self: center; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.thumb { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); }
.thumb .img { aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ribbon { position: absolute; left: 8px; top: 8px; }
.thumb .t { font-weight: 600; font-size: 14px; line-height: 1.35; }
.thumb:hover .img { outline: 2px solid var(--gold); }

.detail { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
.detail .cover img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.caption-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.warn-list { margin: 0; padding-left: 18px; color: var(--warn); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 500; background: var(--surface); }
.tabs a.active { background: var(--green); color: var(--surface); border-color: var(--green); }
@media (prefers-color-scheme: dark) { .tabs a.active { color: #0E1512; } }

.preview { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.preview img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 400px; padding: 34px; }
.login .brandmark { border: 0; padding-bottom: 8px; margin-bottom: 18px; }

.progress { list-style: none; padding: 0; margin: 0; }
.progress li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* ---- mobil ---- */
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brandmark { flex-direction: row; gap: 8px; border: 0; padding: 0; align-items: baseline; }
  .brandmark .t { display: none; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .side .foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .side .foot .who { display: none; }
  .main { padding: 22px 16px 48px; }
  .grid.cols-3, .grid.cols-2, .form-grid, .detail, .preview { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  h1 { font-size: 25px; }
}

/* ---- yardımcı sınıflar (CSP satır içi stile izin vermez) ---- */
.mt { margin-top: 18px; }
.mt-m { margin-top: 14px; }
.mt-s { margin-top: 10px; }
.mt-xs { margin-top: 8px; }
.mt-0 { margin-top: 0; }
.w-full { width: 100%; }
.field.end { justify-content: flex-end; }
.check.inline { display: inline-flex; }
.text-warn { color: var(--warn); }
.list-tight { margin: 0; padding-left: 18px; }
.sans { font-family: "Montserrat", sans-serif; }

/* ---- düzeltmeler ---- */
.grid > .card + .card, .grid > * + * { margin-top: 0; }
.grid { align-items: start; }
.grid.cols-3 { align-items: stretch; }
.stat .badge { align-self: flex-start; }
.badge { white-space: normal; }
.small, .help, .badge, .caption-box, .kv dd { overflow-wrap: anywhere; }
.thumb .ribbon { top: auto; bottom: 8px; left: 8px; }
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; }
}

/* --- Takvim, kuyruk, kayıtlar --- */
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid.cols-4 { grid-template-columns: 1fr; } }
.card.attention { border-color: var(--gold); margin-bottom: 18px; }
.queue-row, .slot-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.queue-row:last-child, .slot-row:last-child { border-bottom: 0; padding-bottom: 0; }
.slot-row { justify-content: flex-start; align-items: flex-start; }
.slot-time { display: flex; flex-direction: column; min-width: 170px; }
.slot-time .slot { font: 600 20px "Playfair Display", Georgia, serif; }
.slot-body { flex: 1; min-width: 240px; }
.slot-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.slot-form input[type="text"] { flex: 1; min-width: 200px; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.timeline li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mt-s form, form.mt-s { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* --- Zenit AI --- */
.chat { display: flex; flex-direction: column; gap: 12px; }
.bubble { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.bubble.user { background: var(--green-soft); align-self: flex-end; max-width: 85%; }
.bubble.tool { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface); }
.bubble .who { display: block; font: 600 11px "Montserrat", sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
pre.json { margin: 0; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Zenit AI */
textarea.compact { min-height: 150px; font: 14px/1.6 inherit; font-family: inherit; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.steps > li:last-child { border-bottom: 0; }
.steps .step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.steps pre.json { max-height: 360px; overflow: auto; }
.steps details summary { cursor: pointer; }
