:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --line: #e3e6eb;
  --text: #1b1d22;
  --muted: #5f6470;
  --faint: #8b909b;
  --accent: #4f5fe8;
  --accent-soft: #e9ebfd;
  --accent-text: #ffffff;
  --ok: #1f9d6b;
  --ok-soft: #e3f5ed;
  --warn: #b7791f;
  --warn-soft: #fbf1df;
  --danger: #d23f3f;
  --danger-soft: #fbe6e6;
  --shadow: 0 1px 2px rgba(16, 18, 27, .06), 0 4px 16px rgba(16, 18, 27, .06);
  --radius: 10px;
  --nav-w: 252px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161a;
    --surface: #1c1d22;
    --surface-2: #24262d;
    --line: #2f323a;
    --text: #eceef2;
    --muted: #a3a7b2;
    --faint: #7a7f8b;
    --accent: #7c9cff;
    --accent-soft: #283152;
    --accent-text: #14151a;
    --ok: #5fc99a;
    --ok-soft: #1d3a2e;
    --warn: #e8b44f;
    --warn-soft: #3d3220;
    --danger: #ff8080;
    --danger-soft: #422424;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; margin-bottom: 8px; }
p { margin: 8px 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }
.rel { position: relative; }
.warn-text { color: var(--warn); }
.faded { opacity: .55; }
.only-sm { display: none !important; }

.boot { height: 100%; display: grid; place-items: center; }
.boot img { opacity: .5; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .15; } }
.loading { display: flex; gap: 6px; justify-content: center; padding: 30px; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); animation: pulse 1s ease-in-out infinite; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }

/* ---------- dugmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; white-space: nowrap;
  font-weight: 500; color: var(--text); text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }
.dot-badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); outline: none; width: 100%;
}
.input.sm { height: 30px; font-size: 13px; padding: 0 8px; width: auto; }
textarea.input { height: auto; min-height: 64px; padding: 8px 11px; resize: vertical; }
textarea.input.big { font-size: 16px; font-weight: 600; min-height: 48px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.search { width: 200px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg > button, .seg > a, .seg > label { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.seg > * + * { border-left: 1px solid var(--line) !important; }
.seg > .on, .seg > label:has(input:checked) { background: var(--accent-soft); color: var(--text); }
.seg > label input { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.form-grid.tight { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.error { color: var(--danger); }
.info { color: var(--accent); }
.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- giris ---------- */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand img { width: 40px; height: 40px; }
.auth-brand b { font-size: 18px; }

/* ---------- iskelet ---------- */
#app { height: 100%; }
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; grid-template-rows: 56px minmax(0, 1fr); height: 100%; height: 100dvh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.org-name { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--line); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.sync-dot.ok { background: var(--ok); }
.sync-dot.busy { background: var(--accent); }
.sync-dot.err { background: var(--danger); }
.me { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.me .who { text-align: right; line-height: 1.2; }
.me .who b { display: block; font-weight: 600; }

.nav { background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; padding: 10px 10px 30px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-weight: 500; min-height: 36px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.nav .count.warn { color: var(--warn); }
.nav .count.accent { color: var(--accent); }
.nav .section { margin: 16px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); display: flex; gap: 8px; align-items: center; }
.nav .section .link { text-transform: none; letter-spacing: 0; font-weight: 500; }
.nav .ico { width: 20px; display: grid; place-items: center; color: var(--muted); }
.sub-links a { padding: 5px 10px 5px 14px; min-height: 32px; font-size: 13px; }
.nav-bg { display: none; }
.bottom-nav { display: none; }

.main { overflow-y: auto; padding: 22px 28px 60px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.card.pad { padding: 18px; }
.card.flat { padding: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-head.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + * { margin-top: 16px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- ikon/avatar/rozet ---------- */
.pic { width: 36px; height: 36px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; overflow: hidden; background: var(--faint); font-size: 15px; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.pic.sm { width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
.pic.xs { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; }
.pic.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 24px; }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; color: #14151a; vertical-align: middle; }
.av.sm { width: 24px; height: 24px; font-size: 11px; }
.av.xs { width: 20px; height: 20px; font-size: 10px; }
.av.lg { width: 48px; height: 48px; font-size: 20px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip[style*="--chip"] { background: color-mix(in srgb, var(--chip) 18%, transparent); color: var(--text); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip svg { width: 12px; height: 12px; }
.count { font-size: 12px; font-weight: 600; color: var(--muted); }
.count.accent { color: var(--accent); }
.count.warn { color: var(--warn); }
.stage-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.flow-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; color: #fff; }
.flow-ico.lg { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); }
.empty-ico { color: var(--faint); margin-bottom: 8px; }
.empty-ico svg { width: 32px; height: 32px; }

/* ---------- ozet kutulari ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats.mini { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); display: block; }
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat b { display: block; font-size: 24px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.warn b { color: var(--warn); }
.stat.accent b { color: var(--accent); }
.alert-card { border-color: var(--warn); }

/* ---------- satirlar ---------- */
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--text); cursor: pointer; min-height: 48px; }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--surface-2); text-decoration: none; }
.row-item.unread .task-text { font-weight: 700; }
.row-item.is-closed { opacity: .65; }
.task-text { word-break: break-word; }
.task-text.closed { text-decoration: line-through; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 3px; }
.meta svg { width: 12px; height: 12px; vertical-align: -1px; }
.status-btn { width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--faint); background: none; cursor: pointer; display: grid; place-items: center; padding: 0; flex: none; font-size: 11px; line-height: 1; color: var(--text); }
.status-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.status-btn.pending { border-color: var(--warn); color: var(--warn); }
.status-btn.closed { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.status-btn:disabled { opacity: .4; cursor: default; }
.list-tabs { display: flex; gap: 6px; overflow-x: auto; align-items: center; max-width: 100%; }
.list-tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 5px 12px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.list-tabs button.on { background: var(--accent-soft); border-color: transparent; color: var(--text); }
.list-tabs .n { margin-left: 6px; opacity: .7; }
.add-row { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.add-row .input { flex: 1; min-width: 180px; }
.add-row select.input { flex: 0 0 170px; }
.filters { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.filters button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 13px; }
.filters button.on { background: var(--surface-2); color: var(--text); font-weight: 600; }

/* ---------- proje/akis kartlari ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.proj-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--text); display: block; }
.proj-card:not(.static):hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.stage-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; margin: 10px 0 6px; background: var(--surface-2); }
.stage-bar i { display: block; }

/* ---------- pano ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: 300px; }
.col { flex: 0 0 280px; background: var(--surface-2); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.col header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.col header i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.col-body { flex: 1; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 40px; border-radius: 8px; }
.col-body.drop-here { background: var(--accent-soft); }
.col-add { padding: 0 8px 8px; }
.col-add .input { background: transparent; border-style: dashed; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.kcard:hover { border-color: var(--accent); }
.kcard.pending { border-left: 3px solid var(--warn); }
.kcard.dragging { opacity: .45; }
.kcard-img { width: calc(100% + 20px); margin: -10px -10px 8px; height: 120px; object-fit: cover; border-radius: 10px 10px 0 0; display: block; }
.kcard-title { font-weight: 600; word-break: break-word; }
.kcard-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.gcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; }
.gcard:hover { border-color: var(--accent); }
.gcard img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--surface-2); }
.gcard-body { padding: 10px; }

/* ---------- tablolar ---------- */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid th.click { cursor: pointer; user-select: none; }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid.compact td, table.grid.compact th { padding: 6px 10px; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: var(--surface-2); }
table.grid tr.low td { background: var(--danger-soft); }
table.grid .num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-bar { display: inline-block; width: 80px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: var(--accent); }

/* ---------- takvim ---------- */
.month-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.month-head h2 { margin-left: 8px; text-transform: capitalize; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dow { background: var(--surface-2); padding: 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.day { background: var(--surface); min-height: 96px; padding: 4px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.day.other { background: var(--surface-2); opacity: .7; }
.day.today .dnum { background: var(--accent); color: var(--accent-text); border-radius: 50%; }
.dnum { width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.ev { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--c) 22%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev.done { opacity: .5; text-decoration: line-through; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend.col { flex-direction: column; gap: 4px; }
.legend.inline { margin: -6px 0 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.agenda-day { margin-bottom: 10px; }
.agenda-date { font-weight: 600; padding: 6px 4px; text-transform: capitalize; }

/* ---------- rutinler ---------- */
.occ { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.occ-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.occ-item.today { border-color: var(--warn); background: var(--warn-soft); }
.occ-item.late { border-color: var(--danger); background: var(--danger-soft); }
.occ-item.done { opacity: .65; }
.occ-item.skipped { opacity: .5; }

/* ---------- mesajlar ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bubble { display: flex; gap: 8px; max-width: 720px; }
.bubble > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.bubble.mine { align-self: flex-end; }
.bubble.mine > div { background: var(--accent-soft); border-color: transparent; }
.bubble .meta { margin: 0 0 2px; }
.bubble .txt { white-space: pre-wrap; word-break: break-word; }
.reply { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.reply .input { flex: 1; }

/* ---------- organizasyon ---------- */
.org-top { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.org-tree { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.org-box { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; background: var(--surface); }
.org-box .org-box { margin: 8px 0 0; }
.org-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.org-body { padding: 0 12px 12px 34px; }
.tree-tog { width: 22px; height: 22px; border: 0; background: none; cursor: pointer; color: var(--muted); flex: none; padding: 0; }
.tree-node { margin-left: calc(var(--d) * 18px); }
.tree-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 8px; }
.tree-row:hover { background: var(--surface-2); }
.tree-row > .grow { cursor: pointer; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.person { display: flex; gap: 8px; align-items: center; }

/* ---------- tasarimci ---------- */
.design-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.design-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--surface); }
.design-row > .input { flex: 1; min-width: 140px; }
.design-row .drag-h { color: var(--faint); }
.block-row .block-cfg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1 1 100%; }
.block-row .block-cfg textarea { flex: 1; min-height: 50px; }
.mini-img { height: 40px; border-radius: 6px; }

/* ---------- sayfalar ---------- */
.blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.block { min-width: 0; }
.block.w1 { grid-column: span 1; }
.block.w2 { grid-column: span 2; }
.block.w3 { grid-column: span 3; }
.block > .card { height: 100%; margin-bottom: 0; }
.block > .card.flat > .block-title { padding: 12px 16px 0; }
.block-title { font-weight: 600; margin-bottom: 10px; }
.rich p { margin: 0 0 8px; }
.rich ul { margin: 0 0 8px; padding-left: 20px; }

/* ---------- sablonlar ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.tpl { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; color: var(--text); }
.tpl:not(.static):hover { border-color: var(--accent); }
.tpl.static { cursor: default; }

/* ---------- cekmece ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(10, 12, 18, .3); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); z-index: 21; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.drawer .label, .label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.time-form .btn { margin-top: 8px; }
.note { background: var(--surface-2); border-radius: 8px; padding: 9px 11px; display: flex; gap: 9px; }
.note .meta { font-size: 12px; color: var(--faint); margin: 0; }
.note .txt { white-space: pre-wrap; word-break: break-word; }
.note-pick { flex: none; width: 18px; height: 18px; margin: 2px 0 0; cursor: pointer; accent-color: var(--accent); }
.follow-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 8px; padding: 8px 10px;
  border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.note .del { margin-left: auto; visibility: hidden; }
.note:hover .del { visibility: visible; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.img-thumb { position: relative; display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); z-index: 60; display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }
.stars { display: flex; gap: 6px; }
.star { display: flex; flex-direction: column; align-items: center; cursor: pointer; color: var(--faint); }
.star input { display: none; }
.star svg { width: 28px; height: 28px; }
.star:has(input:checked), .star:hover { color: var(--warn); }
.star:has(input:checked) svg { fill: currentColor; }

/* ---------- @ anma ---------- */
.mention-host { position: relative; }
.mention-pop { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.mention-list { max-height: 240px; overflow-y: auto; }
.mention-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 7px; cursor: pointer; text-align: left; }
.mention-row:hover, .mention-row.on { background: var(--accent-soft); }
.mention-more { padding: 6px 8px; }
.mention-search { margin: 4px 0 0; width: 100%; height: 32px; }
.mention { color: var(--accent); font-weight: 600; }

/* ---------- renk paleti ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 7px; background: var(--c); cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { outline: 2px solid var(--text); outline-offset: 2px; }
.swatch.custom { background: conic-gradient(from 0deg, #f28c6b, #e8c14f, #5fc99a, #5cc4d8, #7c9cff, #e07bd0, #f28c6b); }
.swatch.custom::after { content: ''; position: absolute; inset: 6px; border-radius: 4px; background: var(--c); }
.swatches .hex { width: 96px; height: 28px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* ---------- pencere ---------- */
#modal .modal-bg { position: fixed; inset: 0; background: rgba(10, 12, 18, .45); z-index: 40; }
.modal { position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; position: sticky; bottom: -16px; background: var(--surface); padding-bottom: 2px; }

/* ---------- indirmeler ---------- */
.dl-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.dl-card + .dl-card { margin-top: 10px; }
.dl-card.primary { border-color: var(--accent); background: var(--accent-soft); }
.dl-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.dl-steps { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }

/* ---------- grafikler ---------- */
.chart { overflow-x: auto; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10px; }
.donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-center { fill: var(--text); font-size: 18px; font-weight: 600; }

/* ---------- raporlar ---------- */
.report-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.report-controls .input { width: auto; }
.report-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.report-header { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.rh-top { display: flex; align-items: center; gap: 12px; }
.rh-top img { width: 40px; height: 40px; }
.rh-org { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.rh-date { text-align: right; display: flex; flex-direction: column; font-size: 13px; }
.rh-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 18px; margin: 14px 0 0; }
.rh-meta div { display: flex; flex-direction: column; }
.rh-meta dt { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.rh-meta dd { margin: 0; font-weight: 500; }
.share { max-width: 1100px; margin: 0 auto; padding: 20px; display: block; height: auto; }
.share-foot { text-align: center; margin: 20px 0; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 70; width: max-content; max-width: min(560px, 90vw); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); color: #fff; }
.link-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-zone { border-color: var(--danger-soft); }

/* ---------- telefon / dar ekran ---------- */
@media (max-width: 860px) {
  .only-sm { display: inline-flex !important; }
  .hide-sm { display: none !important; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 52px minmax(0, 1fr) auto; }
  .bottom-nav { min-height: 60px; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 8px; gap: 8px; }
  .brand span { display: none; }
  .nav { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 31; transform: translateX(-102%); transition: transform .2s; padding-top: 16px; }
  body.nav-open .nav { transform: none; box-shadow: var(--shadow); }
  body.nav-open .nav-bg { display: block; position: fixed; inset: 0; background: rgba(10, 12, 18, .35); z-index: 30; }
  .main { padding: 14px 12px 24px; grid-row: 2; }
  .bottom-nav { display: flex; grid-row: 3; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav > * { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); border: 0; background: none; position: relative; text-decoration: none !important; }
  .bottom-nav > .on { color: var(--accent); }
  .bottom-nav i { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--accent); color: var(--accent-text); font-style: normal; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
  h1 { font-size: 20px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .input.search { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .blocks { grid-template-columns: 1fr; }
  .block.w1, .block.w2, .block.w3 { grid-column: span 1; }
  .col { flex-basis: 84vw; max-height: none; }
  .board { scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .day { min-height: 64px; }
  .ev { font-size: 10px; padding: 0 3px; }
  .dl-card { flex-wrap: wrap; }
  .dl-card .btn { width: 100%; }
  .modal { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal.wide { width: 100%; }
  .drawer { width: 100%; }
  .row-item { padding: 12px; }
  .add-row select.input, .add-row .input { flex: 1 1 100%; }
  .rh-top { flex-wrap: wrap; }
}

/* ---------- yazdir / PDF ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f4f6; --line: #d7dae0; --text: #111; --muted: #444; --faint: #777; color-scheme: light; }
  body { background: #fff; font-size: 11px; }
  .topbar, .nav, .bottom-nav, .no-print, .tabs, .drawer, .drawer-bg, #toast, .page-head .actions { display: none !important; }
  html, body, #app { height: auto; }
  .shell { display: block; height: auto; }
  .main { overflow: visible; padding: 0; }
  .card, .report-header, .stat { box-shadow: none; break-inside: avoid; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .print-keep .card { break-inside: avoid; }
  .chart { overflow: visible; }
  .chart svg { min-width: 0 !important; }
  table.grid { font-size: 10px; }
  a { color: inherit; }
}

/* ---------- personel: liste + kisi profili ---------- */
.danger-text { color: var(--danger); font-weight: 600; }
.ok-text { color: var(--ok); }
.pers-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pers-strip > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.pers-strip b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pers-strip span { font-size: 12.5px; color: var(--muted); }
.pers-strip .warn b { color: var(--warn); }
.pers-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.pers-filters input[type=search] { flex: 1 1 220px; min-width: 0; }
.pers-filters select { width: auto; max-width: 100%; }
.pers-table td { vertical-align: middle; }
.pers-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pers-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.pers-sort:hover, .pers-sort.on { color: var(--text); }
.pers-row { cursor: pointer; }
.pers-row:hover td { background: var(--surface-2); }
.pers-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pers-unit { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.pers-unit::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--faint)); flex: none; }
.pers-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--faint); }
.pers-dot.ok { background: var(--ok); }
.pers-dot.warn { background: var(--warn); }
.pers-dot.danger { background: var(--danger); }
.pers-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 8px 0 12px; }
.pers-hero-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; flex: 1 1 320px; }
.pers-hero-main h1 { margin: 0 0 2px; font-size: 24px; }
.pers-hero-main > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pers-hero .av.lg { width: 64px; height: 64px; font-size: 26px; }
.pers-hero .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pers-flags { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pers-flags h3 { margin: 0; font-size: 14px; }
.pers-range { align-items: center; gap: 10px; margin-bottom: 12px; }
.pers-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.pers-cols > .card { margin: 0; min-width: 0; }
.pers-cols .rows { max-height: 330px; overflow: auto; }
.pad-sm { padding: 10px 12px 12px; overflow-x: auto; }
.pers-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pers-work { gap: 10px; }
.pers-work.click { cursor: pointer; }
.pers-kind { width: 20px; flex: none; text-align: center; color: var(--muted); }
.pers-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pers-requests { margin-bottom: 12px; }
.pers-notice { margin-bottom: 12px; border-left: 4px solid var(--warn); }
.pers-notice.danger { border-left-color: var(--danger); }
.pers-big-ico { font-size: 26px; line-height: 1; }
@media (max-width: 860px) {
  .pers-cols { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
.notice-banner { border-color: var(--warn) !important; background: var(--warn-soft) !important; }
.timer-row { align-items: center; gap: 8px 12px; }
.timer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: timerPulse 1.6s ease-out infinite; }
@keyframes timerPulse { to { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .timer-dot { animation: none; } }
.next-opt { border: 1px dashed var(--line); border-radius: var(--radius); padding: 8px 12px; }
.next-opt > summary { cursor: pointer; }
.chain-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13.5px; }
