/* Kalafika panel — "tarife" görünümü: gün, istasyon panosu gibi saat saat akar. */
@font-face { font-family: "Poppins"; src: url("/assets/fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/assets/fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/assets/fonts/Poppins-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --fog: #edf0f3; --surface: #ffffff; --ink: #17213a; --muted: #5b6680; --line: #d9dfe7; --soft: #f5f7f9;
  --board: #17213a; --board-ink: #ffffff;
  --brand: #e4572e; --brand-ink: #ffffff; --brand-soft: #fdeee9;
  --wait: #6f7b92; --work: #2c6bd6; --ask: #b36b00; --go: #0b8a76; --done: #2b8a3e; --bad: #c42f3b; --off: #939cac;
  --wait-bg: #eef1f5; --work-bg: #e6eefb; --ask-bg: #fdf1dc; --go-bg: #dff4ef; --done-bg: #e1f3e5; --bad-bg: #fbe5e7; --off-bg: #eef0f3;
  --focus: #2c6bd6;
  --body: ui-sans-serif, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Poppins", var(--body);
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fog: #0e1420; --surface: #161e2f; --ink: #e8ecf4; --muted: #9aa5bd; --line: #28324a; --soft: #1b2539;
    --board: #0a0f19; --board-ink: #f4f6fb; --brand-soft: #3a2018;
    --wait: #98a3ba; --work: #6ea0ff; --ask: #f0b254; --go: #4fd1b9; --done: #6fcf84; --bad: #ff7b86; --off: #7a8498;
    --wait-bg: #202a3f; --work-bg: #1a2a4a; --ask-bg: #3a2c14; --go-bg: #143a34; --done-bg: #17361f; --bad-bg: #44191e; --off-bg: #202838;
    --focus: #6ea0ff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fog: #0e1420; --surface: #161e2f; --ink: #e8ecf4; --muted: #9aa5bd; --line: #28324a; --soft: #1b2539;
  --board: #0a0f19; --board-ink: #f4f6fb; --brand-soft: #3a2018;
  --wait: #98a3ba; --work: #6ea0ff; --ask: #f0b254; --go: #4fd1b9; --done: #6fcf84; --bad: #ff7b86; --off: #7a8498;
  --wait-bg: #202a3f; --work-bg: #1a2a4a; --ask-bg: #3a2c14; --go-bg: #143a34; --done-bg: #17361f; --bad-bg: #44191e; --off-bg: #202838;
  --focus: #6ea0ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fog); color: var(--ink); font: 16px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; font-weight: 500; }
p { margin: 0 0 .6em; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .tiny { font-size: .78rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* iskelet */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.word { font: 700 1.35rem var(--display); padding: 0 10px 14px; letter-spacing: -0.02em; }
.word i { font-style: normal; color: var(--brand); }
.side a.nav { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; }
.side a.nav:hover { background: var(--soft); color: var(--ink); }
.side a.nav.on { background: var(--board); color: var(--board-ink); }
.side .foot { margin-top: auto; padding: 10px; }
.main { padding: 26px clamp(16px, 3vw, 40px) 90px; max-width: 1120px; width: 100%; }
.top { display: none; }
.tabs { display: none; }

/* durum çubukları */
.banner { border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.mock { background: var(--ask-bg); color: var(--ask); }
.banner.sens { background: var(--bad-bg); color: var(--bad); }
.banner.pause { background: var(--off-bg); color: var(--muted); }
.banner b { font-weight: 700; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; background: var(--go-bg); color: var(--go); font-weight: 500; overflow-wrap: anywhere; }
.flash.err { background: var(--bad-bg); color: var(--bad); }

/* düğmeler ve formlar */
.btn { font: 500 .95rem var(--body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 15px; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-block; min-height: 40px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(.94); }
.btn.dark { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: .86rem; }
.btn.ghost { background: transparent; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
form.inline { display: inline; }
label { display: block; font-weight: 500; margin-bottom: 4px; font-size: .92rem; }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=date], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 42px; }
textarea { min-height: 84px; resize: vertical; }
input[type=color] { width: 54px; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); vertical-align: middle; }
.field { margin-bottom: 14px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 3px; flex: none; }

/* yüzeyler */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.panel > h2 { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pagehead { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.pagehead .sub { color: var(--muted); }

/* hat (pipeline) */
.line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 8px; }
.stage { background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; position: relative; border-left-width: 0; }
.stage:first-child { border-left-width: 1px; border-radius: 12px 0 0 12px; }
.stage:last-child { border-radius: 0 12px 12px 0; }
.stage::after { content: ""; position: absolute; right: -9px; top: 50%; width: 16px; height: 16px; background: var(--surface); border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); z-index: 2; }
.stage:last-child::after { display: none; }
.stage .n { font: 500 .82rem var(--display); color: var(--muted); }
.stage .big { font: 700 1.9rem var(--display); line-height: 1.1; margin: 2px 0; }
.stage .s { font-size: .82rem; color: var(--muted); }
.stage.ok { background: var(--go-bg); } .stage.ok::after { background: var(--go-bg); }
.stage.ok .big { color: var(--go); }
.stage.now { background: var(--ask-bg); } .stage.now::after { background: var(--ask-bg); }
.stage.now .big { color: var(--ask); }
.nextline { margin: 10px 2px 22px; color: var(--muted); }

/* tarife satırları */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dep { display: grid; grid-template-columns: 112px 64px minmax(0, 1fr) auto; gap: 0 16px; align-items: center; padding: 0 16px 0 0; border-bottom: 1px solid var(--line); }
.dep:last-child { border-bottom: 0; }
.dep .time { background: var(--board); color: var(--board-ink); align-self: stretch; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 14px 6px; }
.dep .time b { font: 700 1.7rem/1 var(--display); letter-spacing: .01em; }
.dep .time span { font-size: .74rem; opacity: .75; margin-top: 5px; }
.dep .thumb { width: 64px; height: 92px; border-radius: 8px; background: var(--soft); object-fit: cover; margin: 12px 0; border: 1px solid var(--line); }
.dep .thumb.post { height: 80px; }
.dep .body { padding: 12px 0; min-width: 0; }
.dep .title { font-weight: 500; overflow-wrap: anywhere; }
.dep .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.dep .act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding: 12px 0; }
.dep a.cover { position: absolute; inset: 0; }
.dep { position: relative; }
.dep .body a { text-decoration: none; }
.dep .body a:hover .title { text-decoration: underline; }
.dep .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; position: relative; z-index: 2; }
.dep.cls-bad { box-shadow: inset 4px 0 0 var(--bad); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }

/* durum etiketleri */
.pill { display: inline-block; border-radius: 99px; padding: 3px 11px; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.pill.wait { background: var(--wait-bg); color: var(--wait); } .pill.work { background: var(--work-bg); color: var(--work); }
.pill.ask { background: var(--ask-bg); color: var(--ask); } .pill.go { background: var(--go-bg); color: var(--go); }
.pill.done { background: var(--done-bg); color: var(--done); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.off { background: var(--off-bg); color: var(--off); }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 7px; padding: 1px 8px; font-size: .78rem; color: var(--muted); background: var(--surface); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--off); display: inline-block; }
.chip.published i { background: var(--done); } .chip.retry i { background: var(--ask); } .chip.failed i { background: var(--bad); } .chip.pending i { background: var(--work); }
.chip.type { background: var(--soft); color: var(--ink); }
.chip.ai { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* içerik sayfası */
.itemgrid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 22px; align-items: start; }
.preview { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); display: block; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: .84rem; }
.logrow { font-size: .86rem; }
.logrow.ERROR td:first-child { box-shadow: inset 3px 0 0 var(--bad); } .logrow.WARN td:first-child { box-shadow: inset 3px 0 0 var(--ask); }
details summary { cursor: pointer; }
pre.rep { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border: 1px solid var(--line); border-radius: 9px; padding: 12px; font: .82rem/1.45 ui-monospace, Menlo, Consolas, monospace; max-height: 340px; overflow: auto; }
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.thumbs img { height: 190px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); }
.photo { position: relative; display: inline-block; margin: 0 8px 8px 0; }
.photo img { height: 84px; width: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.photo button { position: absolute; top: 3px; right: 3px; border: 0; border-radius: 50%; width: 24px; height: 24px; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; line-height: 1; }
.tabsbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabsbar a { padding: 7px 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: .9rem; }
.tabsbar a.on { background: var(--board); color: var(--board-ink); border-color: var(--board); }
.todo li { margin-bottom: 8px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding-left: 38px; position: relative; margin-bottom: 10px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--board); color: var(--board-ink); font: 700 .85rem/26px var(--display); text-align: center; }
.ok-mark { color: var(--go); font-weight: 700; } .no-mark { color: var(--ask); font-weight: 700; }
.codebox { font: .88rem ui-monospace, Menlo, Consolas, monospace; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; display: inline-block; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { display: none; }
  .top { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .top .word { padding: 0; font-size: 1.15rem; }
  .main { padding: 16px 14px 96px; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabs a { text-align: center; padding: 12px 2px 11px; text-decoration: none; color: var(--muted); font-size: .76rem; font-weight: 500; }
  .tabs a.on { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
  h1 { font-size: 1.4rem; }
  .line { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stage, .stage:first-child, .stage:last-child { border: 1px solid var(--line); border-radius: 12px; }
  .stage::after { display: none; }
  .grid2, .grid3, .itemgrid { grid-template-columns: 1fr; }
  .dep { grid-template-columns: 78px minmax(0, 1fr); padding: 0 12px 0 0; }
  .dep .time { grid-row: 1 / span 3; padding: 10px 4px; }
  .dep .time b { font-size: 1.3rem; }
  .dep .thumb { display: none; }
  .dep .act { grid-column: 2; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 0 0 12px; }
  .dep .btns { justify-content: flex-start; }
  th:nth-child(n+4), td:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .flash { animation: drop .25s ease-out; }
  @keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* ek bileşenler */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; font-weight: 500; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-width: 190px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 40; }
.menu nav a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; }
.menu nav a.on { background: var(--board); color: var(--board-ink); }
.menu nav form { padding: 6px 4px 2px; }
.bare { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.card .word { padding: 0 0 14px; font-size: 1.6rem; }
.stack > * + * { margin-top: 12px; }
.err { color: var(--bad); background: var(--bad-bg); border-radius: 9px; padding: 9px 12px; }
.right { margin-left: auto; }
.num { font-variant-numeric: tabular-nums; }
.dim { opacity: .55; }
.tight { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.pv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pv figure { margin: 0; }
.pv img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); display: block; aspect-ratio: 9 / 16; object-fit: cover; }
.pv img.post { aspect-ratio: 4 / 5; }
.pv figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.tele { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--soft); margin-bottom: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tele img { max-width: 160px; border-radius: 8px; display: block; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 860px) { .two, .kv { grid-template-columns: 1fr; } }

.skipped-box { margin-top: 18px; }
.skipped-box summary { color: var(--muted, #5b6478); font-size: 14px; padding: 8px 2px; }
.skipped-box .dep { opacity: .55; }
