/* ofistg — telgraf odası */
:root {
  --paper: #E6ECE9;
  --sheet: #F9FBFA;
  --sheet-2: #F1F5F3;
  --ink: #16202A;
  --ink-2: #445060;
  --muted: #758190;
  --rule: #CBD4D0;
  --rule-soft: #DDE4E1;
  --stamp: #2E3FC4;
  --stamp-ink: #1F2C99;
  --stamp-soft: #DCE0F8;
  --signal: #C77A0A;
  --signal-soft: #F7E7CC;
  --ok: #1E7449;
  --ok-soft: #D6EEDF;
  --bad: #B3242F;
  --bad-soft: #F6DADC;
  --rail: #16202A;
  --rail-text: #C9D2DA;
  --rail-dim: #7C8896;
  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 12px;
  --r-md: 8px;
  --r-sm: 5px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--body);
  font-feature-settings: "tnum" 1;
}
a { color: var(--stamp-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--stamp); }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -0.015em; margin: 0; line-height: 1.15; }
h1 { font-size: 32px; font-variation-settings: "opsz" 96; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 .75em; }
code { font-size: .92em; background: var(--sheet-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--rule-soft); }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- iskelet ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail {
  background: var(--rail); color: var(--rail-text);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 22px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; color: #fff; text-decoration: none; }
.brand svg { flex: none; }
.brand b { font: 700 21px/1 var(--display); letter-spacing: -0.03em; }
.brand:hover { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-md);
  color: var(--rail-text); text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--ink); }
.nav a[aria-current="page"] svg { opacity: 1; color: var(--stamp); }
.nav .cta { margin-top: 10px; background: var(--stamp); color: #fff; justify-content: center; }
.nav .cta:hover { background: #3a4cd6; }
.rail-lines { margin-top: 26px; }
.rail-lines h4 { margin: 0 10px 8px; font: 500 12px/1 var(--body); color: var(--rail-dim); }
.rail-lines a { display: flex; align-items: center; gap: 9px; padding: 6px 10px; color: var(--rail-text); text-decoration: none; border-radius: var(--r-sm); font-size: 14px; }
.rail-lines a:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail-lines .dot { width: 7px; height: 7px; border-radius: 50%; background: #47C27E; flex: none; }
.rail-lines .dot.off { background: #5b6672; }
.rail-lines .dot.err { background: #E5A33A; }
.rail-lines span.n { margin-left: auto; color: var(--rail-dim); font-size: 12px; }
.rail-lines .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.rail-foot a { color: var(--rail-text); text-decoration: none; font-size: 14px; flex: 1; min-width: 0; }
.rail-foot a small { display: block; color: var(--rail-dim); font-size: 12px; }
.rail-foot button { background: none; border: 1px solid rgba(255,255,255,.14); color: var(--rail-text); border-radius: var(--r-sm); padding: 5px 9px; cursor: pointer; font: inherit; font-size: 13px; }
.rail-foot button:hover { border-color: rgba(255,255,255,.35); color: #fff; }

.main { padding: 30px 36px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 64ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-block; margin-bottom: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.crumb:hover { color: var(--stamp); }

.topbar { display: none; }

/* ---------- yüzeyler ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--rule-soft); border-radius: var(--r-lg); }
.sheet + .sheet, .sheet + .grid, .grid + .sheet, .grid + .grid { margin-top: 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.sheet-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.sheet-body { padding: 16px 20px 20px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-compose { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }

/* ---------- bugün şeridi ---------- */
.today {
  display: grid; grid-template-columns: auto minmax(0,1fr); gap: 32px; align-items: stretch;
  background: var(--sheet); border: 1px solid var(--rule-soft); border-radius: var(--r-lg); padding: 22px 24px;
}
.today-figure { display: flex; flex-direction: column; justify-content: space-between; min-width: 220px; }
.today-figure .label { color: var(--ink-2); font-weight: 500; }
.big { font: 700 72px/0.95 var(--display); letter-spacing: -0.045em; font-variation-settings: "opsz" 96, "wdth" 85; }
.delta { font-size: 14px; color: var(--ink-2); }
.delta b { font-weight: 600; }
.delta .up { color: var(--ok); }
.delta .down { color: var(--bad); }
.today-side { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0; border-left: 1px solid var(--rule-soft); }
.today-side > div { padding: 2px 20px; border-right: 1px solid var(--rule-soft); }
.today-side > div:last-child { border-right: 0; }
.today-side .v { font: 650 30px/1.1 var(--display); letter-spacing: -0.03em; margin-top: 6px; }
.today-side .k { color: var(--ink-2); font-size: 14px; }
.today-side .s { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* sayı satırı */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--rule-soft); }
.figures > div { padding: 14px 20px 16px; border-right: 1px solid var(--rule-soft); }
.figures > div:last-child { border-right: 0; }
.figures .k { color: var(--ink-2); font-size: 13px; }
.figures .v { font: 650 26px/1.15 var(--display); letter-spacing: -0.025em; margin-top: 2px; }
.figures .s { color: var(--muted); font-size: 12.5px; }

/* ---------- tablolar ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t th.num, .t td.num { text-align: right; }
.t tbody tr:hover td { background: var(--sheet-2); }
.t a.row-link { color: inherit; text-decoration: none; font-weight: 550; }
.t a.row-link:hover { color: var(--stamp); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who img { width: 32px; height: 32px; border-radius: 50%; background: var(--rule-soft); flex: none; }
.who .nm { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.who .sub { font-size: 12.5px; color: var(--muted); }

/* rozetler */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 550; white-space: nowrap; background: var(--sheet-2); color: var(--ink-2); border: 1px solid var(--rule-soft); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.plain::before { display: none; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.live { background: var(--signal-soft); color: #8a5300; border-color: transparent; }
.tag.live::before { animation: pulse 1.4s ease-in-out infinite; }
.tag.stamp { background: var(--stamp-soft); color: var(--stamp-ink); border-color: transparent; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- form ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f > span, .f-label { display: block; font-weight: 550; font-size: 14px; margin-bottom: 6px; }
label.f small, .hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
input[type=text], input[type=password], input[type=search], input[type=url], input[type=number], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--rule); border-radius: var(--r-md); padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--stamp); box-shadow: 0 0 0 3px var(--stamp-soft); }
textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23445060' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin: 8px 0; cursor: pointer; font-size: 14px; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--stamp); flex: none; }
.check small { display: block; color: var(--muted); font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { min-width: 0; }
.grow { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 14px/1 var(--body); padding: 10px 15px; border-radius: var(--r-md); cursor: pointer;
  border: 1px solid var(--rule); background: #fff; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.btn.primary:hover { background: var(--stamp-ink); border-color: var(--stamp-ink); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e3b5b9; }
.btn.danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sheet-2); }
.btn.sm { padding: 7px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.big-btn { padding: 14px 22px; font-size: 15px; }

/* uyarılar */
.flash { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: #134d31; }
.flash.error { background: var(--bad-soft); color: #7d1820; }
.flash.info { background: var(--stamp-soft); color: var(--stamp-ink); }
.flash.warn { background: var(--signal-soft); color: #6d4200; }
.note { padding: 12px 14px; border-radius: var(--r-md); background: var(--sheet-2); border: 1px solid var(--rule-soft); font-size: 13.5px; color: var(--ink-2); }

/* filtre şeridi */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--rule-soft); }
.filters input[type=search] { width: 240px; }
.filters select { width: auto; min-width: 140px; }
.seg { display: inline-flex; background: var(--sheet-2); border: 1px solid var(--rule-soft); border-radius: var(--r-md); padding: 3px; }
.seg a { padding: 6px 11px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-size: 13.5px; font-weight: 550; }
.seg a[aria-current="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(22,32,42,.08); }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--rule-soft); font-size: 14px; color: var(--ink-2); }

.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty h3 { margin-bottom: 6px; color: var(--ink); }

/* ---------- grafikler ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--rule-soft); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font: 11px var(--body); }
.chart .val-text { fill: var(--ink-2); font: 600 11px var(--body); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hover-band { fill: var(--ink); opacity: .05; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend i.c1 { background: var(--stamp); }
.legend i.c2 { background: var(--signal); }
.legend i.c3 { background: var(--bad); }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 6px;
  font-size: 12.5px; line-height: 1.45; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: 5; display: none;
}
.tip b { font-weight: 600; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.bars-h { display: flex; flex-direction: column; gap: 9px; }
.bars-h .bh { display: grid; grid-template-columns: minmax(80px, 150px) minmax(0,1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bars-h .bh .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-h .track { height: 10px; background: var(--sheet-2); border-radius: 3px; overflow: hidden; }
.bars-h .fill { height: 100%; background: var(--stamp); border-radius: 0 3px 3px 0; width: 0; }

/* ---------- ilerleme ---------- */
.prog { height: 12px; background: var(--sheet-2); border-radius: 99px; overflow: hidden; display: flex; border: 1px solid var(--rule-soft); }
.prog > span { height: 100%; width: 0; transition: width .6s ease; }
.prog .p-sent { background: var(--stamp); }
.prog .p-blocked { background: var(--bad); margin-left: 2px; }
.prog .p-failed { background: var(--signal); margin-left: 2px; }
.prog.thin { height: 6px; border: 0; }

/* ---------- mesaj editörü ---------- */
.composer textarea { min-height: 200px; border-top-left-radius: 0; border-top-right-radius: 0; }
.toolbar { display: flex; gap: 2px; flex-wrap: wrap; padding: 5px; background: var(--sheet-2); border: 1px solid var(--rule); border-bottom: 0; border-radius: var(--r-md) var(--r-md) 0 0; }
.toolbar button { background: none; border: 0; padding: 6px 9px; border-radius: 5px; cursor: pointer; font: 600 13.5px/1 var(--body); color: var(--ink-2); min-width: 32px; }
.toolbar button:hover { background: #fff; color: var(--ink); }
.toolbar .sep { width: 1px; background: var(--rule); margin: 4px 4px; }
.toolbar .ph { font-weight: 500; font-size: 12.5px; }
.counter { font-size: 12.5px; color: var(--muted); text-align: right; margin-top: 5px; }
.counter.over { color: var(--bad); font-weight: 600; }
.img-drop { border: 1.5px dashed var(--rule); border-radius: var(--r-md); padding: 18px; text-align: center; color: var(--ink-2); cursor: pointer; background: #fff; font-size: 14px; }
.img-drop:hover, .img-drop.drag { border-color: var(--stamp); background: var(--stamp-soft); }
.img-drop input { display: none; }
.img-chosen { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--rule); border-radius: var(--r-md); background: #fff; }
.img-chosen img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.img-chosen .grow { font-size: 13.5px; color: var(--ink-2); }
.btn-rows { display: flex; flex-direction: column; gap: 8px; }
.btn-row { display: flex; gap: 6px; align-items: flex-start; padding: 8px; background: var(--sheet-2); border: 1px solid var(--rule-soft); border-radius: var(--r-md); }
.btn-row .cells { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.btn-cell { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) auto; gap: 6px; }
.btn-cell input { padding: 7px 9px; font-size: 13.5px; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 6px; cursor: pointer; color: var(--muted); line-height: 0; }
.icon-btn:hover { color: var(--bad); background: #fff; border-color: var(--rule-soft); }
.icon-btn svg { width: 16px; height: 16px; }

/* Telegram önizleme */
.phone {
  position: sticky; top: 20px;
  border-radius: 26px; padding: 10px; background: #1d252d;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 18px 40px -18px rgba(22,32,42,.45);
}
.phone-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; color: #fff; }
.phone-bar .av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #5c6bd8, #2E3FC4); display: grid; place-items: center; font: 700 14px var(--display); }
.phone-bar b { display: block; font-size: 14.5px; line-height: 1.2; }
.phone-bar small { color: #8fa0b2; font-size: 12px; }
.phone-screen {
  border-radius: 18px; min-height: 440px; padding: 16px 12px 18px;
  background-color: #a8c6a0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.18) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.14) 0 2px, transparent 3px),
    linear-gradient(160deg, #b9d3a5 0%, #8fb79a 55%, #7aa596 100%);
  background-size: 46px 46px, 62px 62px, 100% 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.tg-msg { max-width: 92%; }
.tg-bubble { background: #fff; border-radius: 14px 14px 14px 4px; overflow: hidden; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.tg-bubble img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.tg-text { padding: 7px 10px 6px; font: 14.5px/1.38 -apple-system, "Segoe UI", Roboto, sans-serif; color: #000; white-space: pre-wrap; word-wrap: break-word; }
.tg-text:empty { display: none; }
.tg-text a { color: #2481cc; text-decoration: none; }
.tg-text code, .tg-text pre { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: #f1f3f5; border: 0; border-radius: 4px; padding: 0 3px; }
.tg-text pre { display: block; padding: 6px 8px; margin: 2px 0; white-space: pre-wrap; }
.tg-text blockquote { margin: 3px 0; padding: 2px 0 2px 9px; border-left: 3px solid #2481cc; background: #eef5fc; border-radius: 3px; }
.tg-text .spoiler { background: #c9cfd6; color: transparent; border-radius: 3px; }
.tg-time { text-align: right; font-size: 11px; color: #9aa6b0; padding: 0 9px 5px; margin-top: -4px; }
.tg-kb { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.tg-kb .r { display: flex; gap: 4px; }
.tg-kb span { flex: 1; text-align: center; padding: 8px 6px; border-radius: 8px; background: rgba(46, 70, 66, .38); color: #fff; font: 600 13.5px/1.2 -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(4px); }
.tg-start { align-self: flex-end; background: #e1fec6; border-radius: 14px 14px 4px 14px; padding: 6px 10px; font: 14.5px -apple-system, "Segoe UI", sans-serif; margin-bottom: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.preview-note { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 10px; }

/* bot seçimi */
.pick { display: flex; flex-direction: column; gap: 6px; }
.pick label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r-md); background: #fff; cursor: pointer; }
.pick label:has(input:checked) { border-color: var(--stamp); background: #f4f5fe; box-shadow: 0 0 0 1px var(--stamp) inset; }
.pick input { accent-color: var(--stamp); width: 17px; height: 17px; }
.pick .nm { font-weight: 550; }
.pick .cnt { margin-left: auto; color: var(--ink-2); font-size: 13.5px; }
.audience-total { font: 650 22px/1.2 var(--display); letter-spacing: -0.02em; }

/* adımlar (yalnızca gerçekten sıralı olan bot ekleme) */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 34px; font-size: 14px; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; background: var(--stamp-soft); color: var(--stamp-ink); font: 700 12px/22px var(--display); text-align: center; }

/* bot kartı listesi */
.lines-list { display: flex; flex-direction: column; }
.line-item { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(80px, .6fr)) auto; gap: 16px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--rule-soft); }
.line-item:first-child { border-top: 0; }
.line-item .id { display: flex; gap: 12px; align-items: center; min-width: 0; }
.line-item .ava { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 17px var(--display); flex: none; }
.line-item .ava.off { background: var(--muted); }
.line-item .k { font-size: 12.5px; color: var(--muted); }
.line-item .v { font: 650 18px/1.2 var(--display); }

.kv { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 8px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--muted); font-size: 13px; }

.copy-field { display: flex; gap: 6px; }
.copy-field input { font-size: 13.5px; background: var(--sheet-2); }

details.danger-zone { border-top: 1px solid var(--rule-soft); padding: 14px 20px; }
details.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 550; font-size: 14px; }

/* ---------- giriş ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); }
.login-art { background: var(--rail); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .tape { position: absolute; inset: auto -40px 90px -40px; height: 210px; opacity: .9; }
.login-art h1 { font-size: 46px; max-width: 12ch; line-height: 1.02; letter-spacing: -0.035em; font-variation-settings: "opsz" 96, "wdth" 88; position: relative; }
.login-art p { color: var(--rail-text); max-width: 40ch; position: relative; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px 44px; background: var(--sheet); }
.login-form h2 { font-size: 26px; margin-bottom: 6px; }
.login-form .sub { color: var(--ink-2); margin-bottom: 26px; }
.login-form .btn { width: 100%; padding: 13px; font-size: 15px; margin-top: 6px; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; font: 500 13px var(--body); padding: 6px; }

.err-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.err-page .code { font: 700 96px/1 var(--display); color: var(--rule); letter-spacing: -0.05em; }

/* ---------- mobil ---------- */
@media (max-width: 1180px) {
  .g-compose { grid-template-columns: minmax(0, 1fr); }
  .phone { position: static; max-width: 400px; margin: 0 auto; }
  .line-item { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(70px, auto)) auto; }
  .line-item .hide-md { display: none; }
}
@media (max-width: 960px) {
  .g-main, .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .today { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .today-side { border-left: 0; border-top: 1px solid var(--rule-soft); padding-top: 14px; }
  .today-side > div:first-child { padding-left: 0; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .rail { transform: none; }
  body.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(22,32,42,.45); z-index: 25; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--rail); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 14px; }
  .topbar b { font: 700 18px var(--display); }
  .main { padding: 20px 16px 48px; }
  h1 { font-size: 26px; }
  .big { font-size: 56px; }
  .today-side { grid-template-columns: minmax(0, 1fr); }
  .today-side > div { border-right: 0; border-bottom: 1px solid var(--rule-soft); padding: 10px 0; }
  .today-side > div:last-child { border-bottom: 0; }
  .figures > div { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .filters input[type=search] { width: 100%; }
  .line-item { grid-template-columns: minmax(0, 1fr) auto; }
  .line-item .stat { display: none; }
  .login-page { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .login-form { padding: 32px 20px; }
  .btn-cell { grid-template-columns: minmax(0, 1fr) auto; }
  .btn-cell input:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.brand-word { font: 700 22px var(--display); letter-spacing: -0.03em; }
.err-title { margin: 10px 0 8px; }
.mt { margin-top: 18px; }
.mt-s { margin-top: 10px; }
.mb-0 { margin-bottom: 0; }
.run-item { display: block; padding: 12px 0; border-top: 1px solid var(--rule-soft); color: inherit; text-decoration: none; }
.run-item:first-child { border-top: 0; padding-top: 0; }
.run-item:hover b { color: var(--stamp); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.plain-list li:first-child { border-top: 0; padding-top: 0; }
.plain-list .who { color: inherit; text-decoration: none; }
.plain-list .who > span { min-width: 0; display: block; }
.plain-list .who .nm, .plain-list .who .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plain-list a.who:hover .nm { color: var(--stamp); }
[hidden] { display: none !important; }
.avatar-lg { width: 64px !important; height: 64px !important; }
.page-head .who { gap: 16px; align-items: flex-end; }
.seg-radio .check { margin: 6px 0; }
.date-in { width: auto !important; }
details.daily-table { border-top: 1px solid var(--rule-soft); }
details.daily-table summary { padding: 12px 20px; cursor: pointer; font-weight: 550; font-size: 14px; color: var(--stamp-ink); }
details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu .menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 260px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 28px -12px rgba(22,32,42,.3); }
details.menu .menu-body form + form { border-top: 1px solid var(--rule-soft); padding-top: 10px; }
.err-text { color: var(--bad); }
.grid > .sheet, .grid > div > .sheet:first-child { margin-top: 0; }
.g-main, .g-2 { align-items: start; }
@media (min-width: 821px) { .shell { background: linear-gradient(to right, var(--rail) 236px, transparent 236px); } }
.bars-h .track, .bars-h .fill { display: block; }
.img-drop { display: block; }
.img-drop svg { width: 26px; height: 26px; color: var(--muted); margin-bottom: 4px; }
.note select { width: auto; min-width: 180px; }
.tg-empty { color: #7d8a95; font-style: italic; }
.login-art .tape { position: static; display: block; width: calc(100% + 96px); max-width: none; height: 210px; margin: 0 -48px; opacity: .9; }
.login-art h1 { margin-bottom: 14px; }
.bars-h .fill.fill-bad { background: var(--bad); }
.bars-h .fill.fill-muted { background: var(--muted); }
/* start öncesi ekran önizlemesi */
.intro-screen { justify-content: center; align-items: center; min-height: 360px; }
.intro-card { width: 82%; background: rgba(0, 0, 0, .28); color: #fff; border-radius: 14px; padding: 10px 12px 14px; text-align: center; font: 14px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; }
.intro-card b { display: block; margin: 8px 0 4px; }
.intro-card p { margin: 0; white-space: pre-wrap; word-wrap: break-word; text-align: left; }
.intro-card p.tg-empty { text-align: center; color: rgba(255,255,255,.7); }
.intro-pic { aspect-ratio: 16 / 9; border-radius: 8px; border: 1px dashed rgba(255,255,255,.45); display: grid; place-items: center; font-size: 11.5px; color: rgba(255,255,255,.75); padding: 8px; }
.intro-start { margin: 10px 2px 2px; text-align: center; padding: 11px; border-radius: 12px; background: #2a3440; color: #6fb1f2; font: 600 14px -apple-system, "Segoe UI", sans-serif; letter-spacing: .02em; }
.profile-grid { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.pp-col { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 140px; }
.pp-img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; background: var(--sheet-2); border: 1px solid var(--rule-soft); }
.pp-col form { width: 100%; display: flex; justify-content: center; }
.pp-col label.btn { cursor: pointer; }
.line-item img.ava { object-fit: cover; border-radius: 50%; }
.line-item img.ava.off { filter: grayscale(1); opacity: .6; }
.row > input.grow { width: auto; flex: 1 1 200px; }
/* profil fotoğrafı kırpma */
.crop-dlg { border: 0; border-radius: var(--r-lg); padding: 20px; width: min(420px, calc(100vw - 32px)); background: var(--sheet); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(22,32,42,.5); }
.crop-dlg::backdrop { background: rgba(22,32,42,.55); }
.crop-dlg h3 { font-size: 19px; margin-bottom: 4px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; margin: 14px 0 12px; border-radius: var(--r-md); overflow: hidden; background: #fff; touch-action: none; }
.crop-stage canvas { display: block; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(22,32,42,.55); outline: 2px solid rgba(255,255,255,.9); outline-offset: -2px; pointer-events: none; }
.crop-tools { display: flex; align-items: center; gap: 10px; }
.crop-tools input[type=range] { flex: 1; accent-color: var(--stamp); }
.crop-actions { justify-content: flex-end; margin-top: 12px; }
.warn-text { color: #8a5300 !important; }
