:root {
  --bg: #0b0b0c;
  --surface: #121214;
  --surface-2: #18181b;
  --surface-3: #202024;
  --border: #26262b;
  --border-strong: #34343a;
  --text: #ececee;
  --text-2: #a6a6ad;
  --muted: #6f6f78;
  --red: #e5242f;
  --red-hover: #ff3a45;
  --red-soft: rgba(229, 36, 47, 0.12);
  --red-line: rgba(229, 36, 47, 0.45);
  --amber: #f0a020;
  --amber-soft: rgba(240, 160, 32, 0.12);
  --green: #3ecf8e;
  --radius: 8px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--red); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a2f; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.ti { font-size: 16px; line-height: 1; }

/* ---------- Form elemanları ---------- */
.input, .select, .textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--red); background: var(--surface-3); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b92' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.select option { background: var(--surface-2); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong);
  background: transparent;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn-ghost { border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { color: #ff6b73; border-color: transparent; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  border: none; background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Giriş ekranı ---------- */
.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(ellipse at top, rgba(229,36,47,.10), transparent 55%), var(--bg);
}
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px 28px; }
.auth-card h1 { font-size: 22px; margin: 18px 0 4px; font-weight: 600; }
.auth-card p { color: var(--text-2); margin: 0 0 24px; }
.auth-card .btn { width: 100%; margin-top: 6px; padding: 10px; }
.form-error { color: #ff6b73; font-size: 13px; min-height: 18px; margin: 4px 0 6px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--red); position: relative; flex: none; }
.brand-mark::after { content: ''; position: absolute; inset: 6px; border-radius: 2px; background: var(--bg); }

/* ---------- Ana yerleşim ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
}
.sidebar-head { padding: 16px 14px 10px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-nav { padding: 4px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border-radius: 6px; border: none; background: transparent;
  color: var(--text-2); text-align: left; font-size: 14px;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--red-soft); color: #ff5a63; }
.nav-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 11px; color: var(--muted); }
.nav-badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; box-shadow: 0 0 0 3px var(--red-soft); }
.side-section { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.project-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.project-list .empty { color: var(--muted); padding: 8px 10px; font-size: 13px; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who small { color: var(--muted); font-size: 12px; }

.main { overflow-y: auto; min-width: 0; }
.mobile-bar { display: none; }

.avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff; background: #3a3a40; letter-spacing: .02em;
}
.avatar.lg { width: 34px; height: 34px; font-size: 12px; }
.avatar.empty { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }

/* ---------- Sayfa başlığı ---------- */
.page { padding: 28px 32px 48px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.page-head .desc { color: var(--text-2); margin: 6px 0 0; max-width: 720px; white-space: pre-wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--text-2); font-size: 12px; }
.progress-bar { width: 220px; height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--red); border-radius: 6px; transition: width .3s; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; padding: 7px 10px; font-size: 13px; }
.toolbar .search { min-width: 220px; }

/* ---------- Pano ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.column { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 160px; transition: border-color .15s, background .15s; }
.column.drag-over { border-color: var(--red-line); background: #160f10; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; font-weight: 500; }
.column-head .count { color: var(--muted); font-weight: 400; font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-todo { background: #6f6f78; }
.status-doing { background: var(--amber); }
.status-done { background: var(--green); }
.column-add { width: 100%; justify-content: flex-start; color: var(--muted); border: none; padding: 8px 6px; margin-top: 2px; }
.column-add:hover { color: var(--red-hover); background: transparent; }

.card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
  position: relative;
}
.card:hover { border-color: var(--border-strong); background: var(--surface-3); }
.card.dragging { opacity: .4; }
.card-title { font-weight: 500; line-height: 1.4; word-break: break-word; }
.card.done .card-title { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--muted); }
.card-project { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.card-meta .spacer { flex: 1; }
.card-meta span { display: inline-flex; align-items: center; gap: 3px; }
.card-tags { display: flex; gap: 6px; margin-bottom: 7px; flex-wrap: wrap; }

.card.urg-critical { border-color: var(--red-line); background: linear-gradient(180deg, rgba(229,36,47,.10), rgba(229,36,47,.03)), var(--surface-2); }
.card.urg-critical::before { content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.card.urg-critical.done { background: var(--surface-2); border-color: var(--border); }
.card.urg-critical.done::before { display: none; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; letter-spacing: .02em; }
.tag-critical { background: var(--red); color: #fff; }
.tag-high { background: var(--amber-soft); color: var(--amber); }
.tag-low { background: var(--surface-3); color: var(--muted); }
.tag-normal { background: var(--surface-3); color: var(--text-2); }
.tag-critical .pulse { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .tag-critical .pulse { animation: none; } }

.due.overdue { color: #ff5a63; font-weight: 500; }
.due.today { color: var(--amber); font-weight: 500; }

/* ---------- Bana atananlar ---------- */
.list-group { margin-bottom: 28px; }
.list-group h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); margin: 0 0 10px; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.list-grid .card { margin-bottom: 0; }

/* ---------- Ekip ---------- */
.team-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 20px; }
.panel h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.member:last-child { border-bottom: none; }
.member .info { flex: 1; min-width: 0; }
.member .info b { font-weight: 500; display: block; }
.member .info small { color: var(--muted); }
.role { font-size: 11px; color: var(--red-hover); background: var(--red-soft); padding: 1px 7px; border-radius: 5px; margin-left: 6px; font-weight: 500; }

/* ---------- Boş durum ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-2); }
.empty-state .ti { font-size: 40px; color: var(--red); }
.empty-state h2 { color: var(--text); font-size: 18px; font-weight: 600; margin: 14px 0 6px; }
.empty-state p { margin: 0 0 20px; }

/* ---------- Modal / panel ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; z-index: 50; animation: fade .15s; }
.overlay.center { align-items: center; justify-content: center; padding: 16px; }
.overlay.right { justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.dialog { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 440px; padding: 22px; }
.dialog h2 { margin: 0 0 16px; font-size: 17px; font-weight: 600; }
.dialog p { color: var(--text-2); margin: 0 0 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.drawer {
  width: min(680px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; animation: slide .18s ease-out;
}
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.drawer-head .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-state { font-size: 12px; color: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 32px 32px; }
.drawer-foot { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; justify-content: flex-end; gap: 8px; }

.title-input {
  width: 100%; background: transparent; border: none; outline: none;
  font-size: 26px; font-weight: 600; letter-spacing: -.02em; padding: 0; margin-bottom: 18px;
}
.title-input::placeholder { color: #45454c; }

.props { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; align-items: center; margin-bottom: 24px; }
.props > .label { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.props .select, .props .input { padding: 6px 10px; background-color: transparent; border-color: transparent; }
.props .select:hover, .props .input:hover { background-color: var(--surface-2); border-color: var(--border); }
.props .select:focus, .props .input:focus { background-color: var(--surface-2); border-color: var(--red); }
.props .static { padding: 6px 10px; color: var(--text-2); }
.deadline-row { display: flex; align-items: center; gap: 4px; }
.deadline-row .input { max-width: 200px; }

.segmented { display: flex; gap: 4px; flex-wrap: wrap; padding: 3px 0; }
.segmented button {
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
}
.segmented button:hover { border-color: var(--border-strong); color: var(--text); }
.segmented button.on[data-value="low"] { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.segmented button.on[data-value="normal"] { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.segmented button.on[data-value="high"] { background: var(--amber-soft); color: var(--amber); border-color: rgba(240,160,32,.4); }
.segmented button.on[data-value="critical"] { background: var(--red); color: #fff; border-color: var(--red); }

.section-label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.desc-input { background: transparent; border: 1px solid transparent; min-height: 120px; padding: 8px 10px; margin-left: -10px; width: calc(100% + 20px); }
.desc-input:hover { background: var(--surface-2); }

.images { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .icon-btn { position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,.65); color: #fff; opacity: 0; transition: opacity .15s; }
.thumb:hover .icon-btn { opacity: 1; }
.thumb.uploading { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; cursor: default; }
.dropzone {
  border: 1px dashed var(--border-strong); border-radius: 10px; padding: 18px; text-align: center;
  color: var(--muted); font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s, color .15s;
  margin-top: 10px;
}
.dropzone:hover, .dropzone.over { border-color: var(--red); color: var(--text); background: var(--red-soft); }
.dropzone .ti { font-size: 20px; display: block; margin: 0 auto 6px; }

.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment .body { flex: 1; min-width: 0; }
.comment .head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment .head b { font-weight: 500; }
.comment .head small { color: var(--muted); }
.comment .head .icon-btn { margin-left: auto; width: 24px; height: 24px; opacity: 0; }
.comment:hover .head .icon-btn { opacity: 1; }
.comment .text { color: var(--text); white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.comment-form { display: flex; gap: 10px; margin-top: 14px; align-items: flex-start; }
.comment-form .textarea { min-height: 42px; height: 42px; }
.muted-note { color: var(--muted); font-size: 13px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- Bildirim paneli ---------- */
.notif-panel {
  position: fixed; left: 258px; top: 56px; width: 360px; max-height: 70vh; z-index: 40;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: fade .12s;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.notif-list { overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: rgba(229,36,47,.06); }
.notif .ti { color: var(--text-2); margin-top: 2px; }
.notif.critical .ti { color: var(--red); }
.notif small { display: block; color: var(--muted); margin-top: 2px; }
.notif-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--surface-3); border: 1px solid var(--border-strong); padding: 10px 16px; border-radius: 8px; font-size: 13px; animation: fade .15s; }
.toast.error { border-color: var(--red-line); color: #ff8a90; }

.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 45; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 5; }
  .page { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 22px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .team-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer-body { padding: 20px 16px 28px; }
  .props { grid-template-columns: 100px minmax(0, 1fr); }
  .notif-panel { left: 16px; right: 16px; width: auto; top: 60px; }
  .toolbar .input, .toolbar .select, .toolbar .search { min-width: 0; flex: 1 1 140px; }
  .progress-bar { width: 140px; }
}
