:root {
  --bg: #000;
  --sidebar: #111112;
  --card: #111112;
  --row: #1c1c1c;
  --row-hover: #252527;
  --border: #2c2c2e;
  --field: #48484c;
  --text: #ededed;
  --muted: #8e8e93;
  --faint: #5a5a5e;
  --accent: #0a84ff;
  --danger: #ff6b5e;
  --warn: #ffb340;
  --ok: #32d74b;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; flex: none; }
.attach > svg { color: var(--muted); margin: 0 4px; }

/* ---------------------------------------------------------------- genel kontroller */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--field); background: transparent; border-radius: 8px;
  padding: 7px 12px; white-space: nowrap;
}
.btn:hover { background: var(--row-hover); }
.btn.primary { background: var(--text); color: #000; border-color: var(--text); font-weight: 600; }
.btn.primary:hover { background: #fff; }
.btn.danger { color: var(--danger); border-color: #5a2a26; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  border: 0; background: transparent; color: var(--muted); border-radius: 8px;
  width: 30px; height: 30px; display: inline-grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--row-hover); color: var(--text); }
.icon-btn svg, .btn svg { width: 16px; height: 16px; }

.field {
  width: 100%; background: var(--row); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; outline: none;
}
.field:focus { border-color: var(--field); background: #202022; }
textarea.field { resize: vertical; min-height: 90px; }
select.field { appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238e8e93' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
label.lbl { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }

.section-title {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted);
  text-transform: uppercase; display: flex; align-items: center; gap: 6px;
}
.section-title b { color: var(--text); font-weight: 600; }

.avatar {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #000;
}
.avatar.lg { width: 30px; height: 30px; font-size: 12px; }
.avatar.empty { background: transparent; border: 1px dashed var(--faint); color: var(--faint); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 2px 8px; font-size: 12px; background: rgba(255,255,255,.07); white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip button { border: 0; background: none; color: var(--muted); padding: 0 0 0 2px; line-height: 1; }

/* ---------------------------------------------------------------- giriş ekranları */

.auth {
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(60% 50% at 20% 10%, #1747b8 0%, transparent 70%),
              radial-gradient(50% 40% at 90% 90%, #0b2e73 0%, transparent 70%), #050814;
}
.auth-card {
  width: 100%; max-width: 380px; background: rgba(17,17,18,.92); border: 1px solid var(--border);
  border-radius: 18px; padding: 28px; backdrop-filter: blur(20px);
}
.auth-card h1 { margin: 0 0 4px; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.auth-card h1 img { width: 32px; height: 32px; border-radius: 8px; }
.auth-card p { color: var(--muted); margin: 0 0 8px; }
.auth-card .btn.primary { width: 100%; margin-top: 20px; padding: 10px; }
.error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 1em; }

/* ---------------------------------------------------------------- ana yerleşim */

.layout { display: flex; height: 100vh; height: 100dvh; }
.sidebar {
  width: 260px; flex: none; background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 16px 14px 8px; }
.sidebar-head .who { flex: 1; min-width: 0; }
.sidebar-head .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-head .who span { font-size: 12px; color: var(--muted); }
.nav { flex: 1; overflow-y: auto; padding: 6px 8px 20px; }
.nav-group { margin-top: 18px; }
.nav-group > .section-title { padding: 0 8px 6px; justify-content: space-between; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none;
  padding: 7px 8px; border-radius: 8px; text-align: left; color: var(--text);
}
.nav-item:hover { background: var(--row); }
.nav-item.active { background: var(--row-hover); }
.nav-item.drop-target { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-item .ico { width: 18px; height: 18px; color: var(--muted); flex: none; display: grid; place-items: center; }
.nav-item .ico svg { width: 17px; height: 17px; }
.nav-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; color: var(--muted); }
.nav-item .more { opacity: 0; width: 22px; height: 22px; }
.nav-item:hover .more, .nav-item .more:focus { opacity: 1; }
.nav-item .swatch { width: 10px; height: 10px; border-radius: 50%; }
.nav-item.inactive { opacity: .45; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.topbar h2 { margin: 0; font-size: 20px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; width: 240px; }
.search input { padding-left: 32px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; color: var(--muted); }
.menu-toggle { display: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.live-dot.on { background: var(--ok); }

.board {
  flex: 1; overflow: auto; padding: 20px; display: flex; gap: 16px; align-items: flex-start;
}
.board.single { justify-content: center; }
.board.single .card { width: min(640px, 100%); }
.card {
  width: 320px; flex: none; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column; max-height: 100%;
}
.card-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px; }
.card-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-head .count { font-size: 12px; color: var(--muted); }
.card-body { overflow-y: auto; padding: 4px 8px; min-height: 30px; }
.card-body.drop-target { background: rgba(10,132,255,.07); border-radius: 8px; }
.card-foot { padding: 6px 8px 10px; }
.add-task { display: flex; align-items: center; gap: 8px; padding: 0 8px; border-radius: 8px; }
.add-task:focus-within { background: var(--row); }
.add-task svg { width: 16px; color: var(--muted); flex: none; }
.add-task input { flex: 1; background: none; border: 0; outline: none; padding: 9px 0; }
.add-task input::placeholder { color: var(--muted); }
.empty-board { margin: auto; color: var(--muted); text-align: center; padding: 40px; }

.task {
  display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--row);
  margin-bottom: 6px; cursor: pointer; position: relative; border-left: 3px solid transparent;
}
.task:hover { background: var(--row-hover); }
.task.open { box-shadow: 0 0 0 1px var(--field) inset; }
.task.dragging { opacity: .4; }
.task.drop-before::before {
  content: ''; position: absolute; left: 6px; right: 6px; top: -4px; height: 2px; background: var(--accent); border-radius: 2px;
}
.task .body { flex: 1; min-width: 0; }
.task .title { word-wrap: break-word; overflow-wrap: anywhere; }
.task.done .title { color: var(--muted); text-decoration: line-through; }
.task .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.task .meta:empty { display: none; }
.task .meta span { display: inline-flex; align-items: center; gap: 3px; }
.task .meta svg { width: 12px; height: 12px; }
.task .assignee { align-self: flex-start; }
.overdue { color: var(--danger) !important; }
.today { color: var(--warn) !important; }

.check {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--faint); background: none;
  flex: none; display: grid; place-items: center; padding: 0; margin-top: 1px;
}
.check:hover { border-color: var(--text); }
.check svg { width: 12px; height: 12px; opacity: 0; color: #000; }
.check.on { background: var(--text); border-color: var(--text); }
.check.on svg { opacity: 1; }
.check.sm { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- görev ayrıntısı */

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); z-index: 21;
  background: var(--sidebar); border-left: 1px solid var(--border); display: flex; flex-direction: column;
  box-shadow: -20px 0 40px rgba(0,0,0,.4);
}
.drawer-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 0; }
.drawer-head .crumb { flex: 1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px 30px; }
.title-row { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 4px; }
.title-row .check { margin-top: 6px; }
.title-input {
  flex: 1; background: none; border: 0; outline: none; font-size: 19px; font-weight: 600; resize: none;
  padding: 2px 0; overflow: hidden; line-height: 1.35;
}
.byline { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.props { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; align-items: center; margin: 14px 0 22px; }
.props > .k { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.props > .k svg { width: 14px; }
.props .v { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.props select.field, .props input.field { padding: 6px 10px; }
.quick-dates { display: flex; gap: 4px; flex-wrap: wrap; }
.sect { margin-top: 24px; }
.sect > .section-title { margin-bottom: 8px; }
.subtask { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 8px; }
.subtask:hover { background: var(--row); }
.subtask input { flex: 1; background: none; border: 0; outline: none; padding: 2px 0; min-width: 0; }
.subtask.done input { color: var(--muted); text-decoration: line-through; }
.subtask .icon-btn { width: 24px; height: 24px; opacity: 0; }
.subtask:hover .icon-btn { opacity: 1; }
.subtask.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.subtask .grip { cursor: grab; color: var(--faint); width: 12px; display: grid; }
.attach {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; background: var(--row); margin-bottom: 6px;
}
.attach a { flex: 1; min-width: 0; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach a:hover { text-decoration: underline; }
.attach .size { color: var(--muted); font-size: 12px; }
.attach img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.dropzone {
  border: 1px dashed var(--field); border-radius: 10px; padding: 12px; text-align: center; color: var(--muted);
  font-size: 13px; cursor: pointer;
}
.dropzone.over { border-color: var(--accent); color: var(--text); background: rgba(10,132,255,.08); }
.comment { display: flex; gap: 10px; margin-bottom: 12px; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment .c-head b { color: var(--text); }
.comment .c-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comment .c-head button { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 0; margin-left: auto; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { min-height: 40px; height: 40px; }
.drawer-foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.drawer-foot .spacer { flex: 1; }

/* ---------------------------------------------------------------- açılır menü ve pencereler */

.popover {
  position: fixed; z-index: 50; background: #1c1c1e; border: 1px solid var(--border); border-radius: 10px;
  padding: 5px; min-width: 190px; max-width: 280px; max-height: 60vh; overflow-y: auto;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.popover button.mi {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; text-align: left;
  padding: 7px 9px; border-radius: 6px;
}
.popover button.mi:hover, .popover button.mi:focus { background: var(--row-hover); outline: none; }
.popover button.mi.danger { color: var(--danger); }
.popover button.mi .tick { margin-left: auto; color: var(--text); }
.popover hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.popover .mi-label { font-size: 11px; color: var(--muted); padding: 6px 9px 2px; text-transform: uppercase; letter-spacing: .06em; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal {
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #1c1c1e;
  border: 1px solid var(--border); border-radius: 16px; padding: 22px;
}
.modal.wide { width: min(680px, 100%); }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { color: var(--muted); margin: 6px 0; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; }
.palette button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.palette button.sel { border-color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 10px 0 16px; }
.tabs button { border: 0; background: none; padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.sel { color: var(--text); border-color: var(--text); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.user-row .u { flex: 1; min-width: 0; }
.user-row .u b { display: block; }
.user-row .u span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); }
.badge.admin { background: rgba(10,132,255,.18); color: #64b5ff; }
.linkbox { display: flex; gap: 8px; margin-top: 10px; }
.linkbox input[readonly] { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #2c2c2e; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: .2s; z-index: 100; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: #5a2a26; }

/* ---------------------------------------------------------------- dar ekran */

@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .sidebar {
    position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; transform: translateX(-100%);
    transition: transform .2s; width: min(290px, 85vw);
  }
  .layout.nav-open .sidebar { transform: none; box-shadow: 20px 0 40px rgba(0,0,0,.5); }
  .nav-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,.5); }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .topbar h2 { font-size: 18px; }
  .search { order: 5; width: 100%; }
  .board { flex-direction: column; align-items: stretch; padding: 16px; }
  .card { width: 100%; max-height: none; }
  .nav-item .more { opacity: 1; }
  .props { grid-template-columns: 90px 1fr; }
}
