:root {
  --bg: #f5f7fa; --card: #fff; --line: #e3e8ef; --text: #1d2733; --muted: #6b7785;
  --primary: #1271c4; --primary-d: #0b4f9c; --danger: #d1242f; --radius: 8px;
  --st-yapilacak: #8c959f; --st-devam: #1f9bd7; --st-beklemede: #d4a72c; --st-kontrol: #8250df;
  --st-yapildi: #2da44e; --st-iptal: #57606a;
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .3rem 0 1rem; font-weight: 600; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; font-weight: 600; }
h3 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.strong { font-weight: 600; }
.right { float: right; }
.inline { display: inline; }

/* üst çubuk */
.top { display: flex; align-items: center; gap: 1rem; padding: .45rem 1.2rem;
  background: #fff; color: var(--text); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px #0b4f9c14; position: sticky; top: 0; z-index: 10; }
.top a { color: #33414f; }
.top nav a:hover { color: var(--primary); text-decoration: none; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: 1.1rem; color: #0b4f9c !important; }
.brand:hover { text-decoration: none; }
.brand-icon { height: 34px; width: auto; }
.brand.big { font-size: 1.4rem; justify-content: center; margin-bottom: 1rem; color: var(--text) !important; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.proj-switch { max-width: 320px; background: #f5f7fa; }
.linkbtn { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font: inherit; }
.top .linkbtn { color: #33414f; }
.top .linkbtn:hover { color: var(--danger); }
.linkbtn.danger { color: var(--danger); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 1.2rem; }
.wrap.wide { max-width: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 1rem; }
.card.flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 520px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + section { margin-top: 1rem; }
.flash { background: #ddf4ff; border: 1px solid #b6e3ff; padding: .6rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.error { background: #ffebe9; border: 1px solid #ffcecb; color: #82071e; padding: .6rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.empty { text-align: center; padding: 2.5rem 1rem; }
.count { display: inline-block; background: #eef1f4; color: var(--muted); border-radius: 10px;
  padding: 0 .5rem; font-size: .8rem; font-weight: 500; margin-left: .3rem; }

/* form */
label { display: block; margin-bottom: .8rem; font-weight: 500; font-size: .92rem; }
label > input, label > select, label > textarea, label > .row { margin-top: .25rem; }
input, select, textarea { font: inherit; width: 100%; padding: .45rem .6rem; border: 1px solid #ccd3db;
  border-radius: 6px; background: #fff; color: var(--text); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3ff; border-color: var(--primary); }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.check input { width: auto; }
.inline-label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.inline-label input { width: auto; }
.row { display: flex; gap: .5rem; align-items: center; }
.row input { flex: 1; }
.stack > * { margin-bottom: .5rem; }
.btn { display: inline-block; padding: .45rem .9rem; border-radius: 6px; border: 1px solid #ccd3db;
  background: #fff; color: var(--text); cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #f3f5f7; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: transparent; }
.btn.sm { padding: .25rem .6rem; font-size: .88rem; }
.btn.full { width: 100%; }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: .6rem; }

/* sayfa başı */
.crumbs { font-size: .9rem; margin-bottom: .2rem; }
.pagehead { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.pagehead h1, .pagehead h2 { margin: 0; flex: 1; }
.tabs { display: flex; gap: .2rem; background: #e9edf2; padding: 3px; border-radius: 7px; }
.tabs a { padding: .3rem .9rem; border-radius: 5px; color: var(--text); }
.tabs a.on { background: #fff; box-shadow: 0 1px 2px #0001; font-weight: 600; }
.tabs a:hover { text-decoration: none; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filters select, .filters input { width: auto; min-width: 160px; }

/* tablo */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); font-weight: 600; padding: .55rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .55rem .7rem; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #f7faff; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.items td:first-child, .w-id { width: 60px; }
tr.closed td { opacity: .6; }
.tree { color: #b0b8c1; margin-right: .3rem; }

/* rozetler */
.badge, .prio { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.badge i, .prio i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #999; }
.st-yapilacak i { background: var(--st-yapilacak); } .st-devam i { background: var(--st-devam); }
.st-beklemede i { background: var(--st-beklemede); } .st-kontrol i { background: var(--st-kontrol); }
.st-yapildi i { background: var(--st-yapildi); } .st-iptal i { background: var(--st-iptal); }
.pr-dusuk i { background: #a0aab4; } .pr-normal i { background: #6cb6f5; }
.pr-yuksek i { background: #f0883e; } .pr-acil i { background: #d1242f; }
.pr-acil { color: #d1242f; font-weight: 600; }
.tag { background: #eef1f4; border-radius: 4px; padding: 0 .4rem; font-size: .8rem; color: #444; }
.person { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.av { width: 26px; height: 26px; border-radius: 50%; background: #2e7d4f; color: #fff; font-size: .72rem;
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.late { color: var(--danger); font-weight: 600; }
.soon { color: #bf8700; font-weight: 600; }

/* ana sayfa */
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; gap: .7rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid #eef1f4; }
.plist li:last-child { border: 0; }
.plist .count { margin-left: auto; }

/* iş detayı ve form */
.detail, .form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.form-grid { gap: 1.5rem; }
.detail .card { margin-bottom: 1rem; }
.fields dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: .5rem 0 0; font-size: .9rem; }
.fields dt { color: var(--muted); }
.fields dd { margin: 0; }
.fields label { margin-bottom: .6rem; }
.md { overflow-wrap: anywhere; }
.md img { max-width: 100%; }
.md pre { background: #f6f8fa; padding: .7rem; border-radius: 6px; overflow-x: auto; }
.md code { background: #f0f2f5; padding: 0 .25rem; border-radius: 4px; font-size: .9em; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; } .md td, .md th { border: 1px solid var(--line); padding: .3rem .5rem; }
.md blockquote { margin: 0; padding-left: .8rem; border-left: 3px solid var(--line); color: var(--muted); }
.md p:first-child { margin-top: 0; } .md p:last-child { margin-bottom: 0; }

.files { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.fwrap { position: relative; }
.fwrap form { position: absolute; top: 2px; right: 2px; }
.file { display: flex; flex-direction: column; width: 150px; border: 1px solid var(--line); border-radius: 6px;
  padding: .4rem; font-size: .8rem; color: var(--text); background: #fafbfc; }
.file:hover { border-color: var(--primary); text-decoration: none; }
.file img { width: 100%; height: 95px; object-fit: cover; border-radius: 4px; margin-bottom: .3rem; background: #eee; }
.ficon { font-size: 2rem; text-align: center; height: 95px; display: flex; align-items: center; justify-content: center; }
.fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x { background: #fff; border: 1px solid var(--line); border-radius: 50%; width: 22px; height: 22px; line-height: 1;
  cursor: pointer; color: var(--muted); padding: 0; }
.x:hover { color: var(--danger); border-color: var(--danger); }

.timeline { list-style: none; padding: 0; margin: 0 0 1rem; }
.timeline .comment { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; margin: .6rem 0; background: #fff; }
.timeline .comment:target { border-color: var(--primary); box-shadow: 0 0 0 3px #1f6feb22; }
.chead { margin-bottom: .4rem; display: flex; align-items: center; gap: .6rem; }
.chead form { margin-left: auto; }
.timeline .act { font-size: .88rem; color: #444; padding: .25rem 0 .25rem .3rem; }
.timeline .act .dot { display: inline-block; width: 7px; height: 7px; background: #c5ccd4; border-radius: 50%; margin-right: .5rem; vertical-align: middle; }
.timeline .act s { color: var(--muted); }
.comment-form textarea { margin-bottom: .5rem; }

.uploader { margin: .3rem 0; }
.uploader.drag { outline: 2px dashed var(--primary); outline-offset: 4px; border-radius: 6px; }
.uploader .muted { margin-left: .5rem; }
.previews { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.pv { position: relative; width: 110px; font-size: .75rem; border: 1px solid var(--line); border-radius: 6px; padding: .3rem; background: #fafbfc; }
.pv img { width: 100%; height: 70px; object-fit: cover; border-radius: 4px; }
.pv .fname { display: block; }
.pv .x { position: absolute; top: -8px; right: -8px; }

.times { list-style: none; margin: 0 0 .8rem; padding: 0; }
.times li { padding: .35rem 0; border-bottom: 1px solid #eef1f4; }
.timeform input { margin-bottom: .4rem; }

/* pano */
.board { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: .8rem; overflow-x: auto; padding-bottom: 1rem; }
.col { background: #ebeef2; border-radius: var(--radius); display: flex; flex-direction: column; min-height: 60vh; }
.col header { display: flex; align-items: center; gap: .4rem; padding: .6rem .7rem; font-weight: 600; }
.col header .add { margin-left: auto; font-size: 1.2rem; color: var(--muted); padding: 0 .3rem; }
.col .cards { flex: 1; padding: 0 .5rem .5rem; display: flex; flex-direction: column; gap: .5rem; border-radius: 6px; }
.col .cards.over { background: #dbe7f7; }
.kcard { background: #fff; border-radius: 6px; padding: .6rem .7rem; box-shadow: 0 1px 2px #0002; cursor: grab; border-left: 3px solid transparent; }
.kcard.dragging { opacity: .4; }
.kcard .ktitle { display: block; color: var(--text); font-weight: 500; margin-bottom: .4rem; }
.kmeta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .8rem; }
.kmeta .spacer { flex: 1; }
.kmeta .av { width: 22px; height: 22px; font-size: .65rem; }
.col.st-yapildi .kcard, .col.st-iptal .kcard { opacity: .75; }

/* giriş */
main.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 380px; padding: 2rem; }

details.pedit { border-bottom: 1px solid #eef1f4; padding: .5rem 0; }
details.pedit summary { cursor: pointer; }
details.pedit form { margin-top: .6rem; }

@media (max-width: 900px) {
  .grid2, .detail, .form-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .proj-switch { display: none; }
}

/* --- Proje araç çubuğu (OpenProject benzeri) --- */
.toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 1rem; }
.toolbar h1 { margin: 0; flex: 1; font-size: 1.75rem; }
.btn.create { background: #35a33f; border-color: #35a33f; color: #fff; padding: .5rem 1rem; }
.btn.create:hover { background: #2c8a35; }
.tfilters { display: flex; gap: .4rem; }
.tfilters select, .tfilters input { width: auto; min-width: 140px; padding: .45rem .6rem; }
.tfilters input[type=search] { min-width: 180px; }

/* --- İş listesi --- */
.wp-table { background: #fff; border-top: 1px solid var(--line); }
.tbl.wp th { font-size: .82rem; color: #333; letter-spacing: .02em; padding: .75rem .6rem; border-bottom: 1px solid #d5dbe2; }
.tbl.wp th a.sort { color: inherit; display: inline-flex; gap: .3rem; align-items: center; }
.tbl.wp th a.sort:hover { text-decoration: none; color: var(--primary); }
.tbl.wp th .arrow { font-size: .65rem; color: var(--primary); }
.tbl.wp td { padding: .6rem .6rem; border-bottom: 1px solid #e6eaef; height: 40px; }
.tbl.wp tbody tr.wp-row { cursor: pointer; }
.tbl.wp tbody tr.wp-row:hover { background: #e8f2fb; }
.tbl.wp tbody tr.wp-row.sel { background: #dcebf8; }
.tbl.wp td.subject .subj { display: flex; align-items: center; gap: .15rem; }
.tbl.wp td.subject a { color: var(--text); }
.tbl.wp td.subject a:hover { color: var(--primary); }
.tbl.wp td.c-id a { color: var(--primary); }
.tbl.wp .c-id { width: 70px; padding-left: 1.4rem; }
.tbl.wp .c-st { width: 150px; } .tbl.wp .c-pr { width: 110px; } .tbl.wp .c-as { width: 190px; }
.tbl.wp .c-cat { width: 160px; } .tbl.wp .c-up { width: 170px; }
.indent { display: inline-block; flex: none; }
.tgl, .tgl-sp { width: 20px; flex: none; }
.tgl { background: none; border: 0; cursor: pointer; font-size: 1rem; color: #333; padding: 0; line-height: 1; transition: transform .15s; }
.tgl.shut { transform: rotate(-90deg); }
.tbl.wp tr.hidden { display: none; }
.tbl.wp tr.closed td { opacity: 1; }
.tbl.wp td.empty { text-align: center; padding: 2rem; }
.nowrap { white-space: nowrap; }
.wp-new { display: inline-block; padding: .7rem 1.4rem; }

/* giriş logosu */
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand img { height: 130px; width: auto; }
.login-title { margin-top: .6rem; font-size: 1.25rem; font-weight: 600; color: #0b4f9c; letter-spacing: .02em; }
