/* Tuğralı CRM — siyah + varak altın, varsayılan koyu tema, ◐ ile açık tema */
:root {
  --brand: #c9a227; --brand-2: #a8841c; --brand-3: #6e5310; --brand-soft: #f5ecd0;
  --on-brand: #171103;
  --gold-leaf: linear-gradient(135deg, #7a5c0f 0%, #b8902a 18%, #f3dc8a 42%, #d4af37 58%, #a07d1c 80%, #6e5310 100%);
  --bg: #0a0a09; --bg-2: #0f0e0c; --card: #151411; --card-2: #1c1a16; --line: #2a261e; --line-2: #3a3428;
  --text: #f3eee2; --muted: #a39b88; --data: #e3c15b;
  --red: #f87171; --red-bg: rgba(248,113,113,.12); --amber: #fbbf24; --amber-bg: rgba(251,191,36,.12);
  --green: #34d399; --green-bg: rgba(52,211,153,.12); --blue: #60a5fa;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --r: 12px; --side: 232px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f7f4ec; --bg-2: #f0ebdf; --card: #ffffff; --card-2: #fbf8f1; --line: #e8e0cd; --line-2: #d9cdb2;
  --text: #1a1609; --muted: #6f6650; --data: #8a6a12;
  --red: #dc2626; --red-bg: #fde8e8; --amber: #b45309; --amber-bg: #fef3c7;
  --green: #047857; --green-bg: #e6f3ee; --blue: #2563eb;
  --shadow: 0 1px 2px rgba(40,30,8,.06), 0 6px 20px rgba(40,30,8,.07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 19px; margin-bottom: 14px; }
h3 { font-size: 15px; margin-bottom: 12px; }
small { font-size: 12px; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.r { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.red { color: var(--red); } .green { color: var(--green); } .amber { color: var(--amber); }
.grow { flex: 1; }

/* Yerleşim */
.app { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 16px 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; padding: 4px 8px 18px; }
.brand b { background: var(--gold-leaf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--gold-leaf); color: var(--on-brand); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 3px rgba(0,0,0,.4); display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.side nav a:hover { background: var(--card); color: var(--text); }
.side nav a.on { background: var(--gold-leaf); color: var(--on-brand); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.side nav a span { flex: 1; }
.badge { font-style: normal; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
.side nav a.on .badge { background: var(--on-brand); color: #f3dc8a; }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 6px; }
.me { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 4px; border-radius: 9px; }
.me:hover { background: var(--card); }
.me span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me b, .me small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); }
.side-tools { display: flex; }
.side-tools form { margin: 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); z-index: 5; flex-wrap: wrap; }
.top h1 { font-size: 21px; flex: 1; min-width: 0; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { padding: 24px 28px 60px; display: flex; flex-direction: column; gap: 18px; }
.mobile-only { display: none; }

/* Düğmeler, formlar */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); padding: 8px 14px; border-radius: 9px; font: 500 13.5px Inter, sans-serif; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--gold-leaf); border-color: var(--brand-2); color: var(--on-brand); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.btn.primary:hover { background: var(--gold-leaf); filter: brightness(1.08); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; justify-content: center; padding: 11px; }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { background: none; border: 0; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.link { background: none; border: 0; color: var(--data); cursor: pointer; font: inherit; padding: 0; display: inline-flex; align-items: center; gap: 5px; }
.link.danger { color: var(--red); }
.link .ic { width: 15px; height: 15px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
label small { font-weight: 400; }
input, select, textarea { font: 14px Inter, sans-serif; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 0; border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 400; font-size: 13.5px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.span2 { grid-column: span 2; }
.row-end { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.sel-sm { width: auto; padding: 7px 10px; font-size: 13px; }
.search input { width: 190px; padding: 7px 11px; font-size: 13px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg a, .seg label span { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: 13px; cursor: pointer; display: block; }
.seg a.on, .seg input:checked + span { background: var(--gold-leaf); color: var(--on-brand); }
.seg label { flex-direction: row; color: inherit; }
.seg input { display: none; }
.seg.big { display: flex; }
.seg.big label { flex: 1; }
.seg.big span { text-align: center; padding: 9px; font-size: 14px; }
.colors { display: flex; gap: 6px; flex-direction: row; }
.colors label { flex-direction: row; }
.colors input { display: none; }
.colors i { width: 24px; height: 24px; border-radius: 50%; display: block; cursor: pointer; border: 2px solid transparent; }
.colors input:checked + i { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }

/* Kartlar, KPI */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card:not(.flush) > .card-h { padding: 0 0 12px; border: 0; }
.card-h h3 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow); }
.kpi small { color: var(--muted); font-weight: 500; }
.kpi b { font-size: 23px; font-weight: 700; color: var(--data); letter-spacing: -.02em; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi.bad b { color: var(--red); } .kpi.warn b { color: var(--amber); }
.kpi.hero { background: var(--gold-leaf); border-color: transparent; }
.kpi.hero small, .kpi.hero span { color: rgba(23,17,3,.72); }
.kpi.hero b { color: var(--on-brand); }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.split > div { display: flex; flex-direction: column; gap: 18px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav b { min-width: 120px; text-align: center; font-size: 16px; }
.crumbs { margin-bottom: -6px; font-size: 13px; color: var(--muted); }
.flash { padding: 11px 14px; border-radius: 10px; background: var(--green-bg); color: var(--green); font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flash.err { background: var(--red-bg); color: var(--red); }
.flash.warn { background: var(--amber-bg); color: var(--amber); }
.flash a { text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px !important; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.green { background: var(--green-bg); color: var(--green); border-color: transparent; }
.pill.red { background: var(--red-bg); color: var(--red); border-color: transparent; }
.pill.amber { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); background: var(--card-2); padding: 1px 7px; border-radius: 6px; }
.tag .ic { width: 12px; height: 12px; }
.tag.red { color: var(--red); background: var(--red-bg); }

/* Tablo */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr[data-href] { cursor: pointer; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl tr.sel td { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); background: var(--card-2); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl form { margin: 0; }
.scroll-x { overflow-x: auto; }
.card.flush > .tbl, .card.flush > .scroll-x { display: block; overflow-x: auto; }
.card.flush > table.tbl { display: table; }

/* Avatar */
.av { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.av.lg { width: 46px; height: 46px; font-size: 16px; }
.av-empty { background: var(--card-2); color: var(--muted); border: 1px dashed var(--line-2); }

/* Görev panosu */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 150px); }
.col header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; }
.col header em { font-style: normal; color: var(--muted); font-weight: 500; margin-left: auto; background: var(--card); padding: 0 8px; border-radius: 10px; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.col-todo .dot { background: #94a3b8; } .col-doing .dot { background: var(--blue); } .col-review .dot { background: var(--amber); } .col-done .dot { background: var(--green); }
.cards { flex: 1; overflow-y: auto; padding: 0 10px 6px; display: flex; flex-direction: column; gap: 8px; min-height: 50px; }
.cards.over { background: color-mix(in srgb, var(--brand) 10%, transparent); border-radius: 10px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 10px; padding: 10px 12px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .12s, box-shadow .12s; }
.tcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.tcard.prio-high { border-left-color: var(--red); }
.tcard.prio-low { opacity: .85; }
.tcard.dragging { opacity: .4; transform: rotate(1.5deg); }
.col-done .tc-title { color: var(--muted); text-decoration: line-through; }
.tc-title { font-weight: 500; margin-bottom: 6px; word-break: break-word; }
.tc-cust { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tc-cust .ic { width: 13px; height: 13px; }
.tc-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.quick { padding: 8px 10px 10px; margin: 0; }
.quick input { background: transparent; border-style: dashed; font-size: 13px; padding: 7px 10px; }
.quick input:focus { background: var(--card); border-style: solid; }

/* Görev penceresi */
.task-detail { display: flex; flex-direction: column; gap: 18px; }
.task-form { display: flex; flex-direction: column; gap: 14px; }
.title-input { font-size: 19px; font-weight: 600; border-color: transparent; background: transparent; padding: 6px 4px; }
.title-input:hover { border-color: var(--line-2); }
.comments { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.comments h3 { margin: 0; }
.cmt { display: flex; gap: 10px; }
.cmt p { margin: 3px 0 0; white-space: pre-wrap; word-break: break-word; }
.cmt-form { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.del-form { margin: 0; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-box { background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; width: 100%; max-width: 680px; padding: 24px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.4); animation: pop .15s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal-x { position: absolute; top: 12px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; }
.modal-x:hover { background: var(--card-2); color: var(--text); }

/* Fatura formu */
.amount-box { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: end; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.amount-box .check { padding-bottom: 10px; }
.calc { grid-column: 1 / -1; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.calc b { color: var(--data); }
[data-for][hidden] { display: none !important; }

/* Bilgi listesi, hesap satırları */
.info { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.info dt { color: var(--muted); font-size: 12.5px; }
.info dd { margin: 0; word-break: break-word; }
.info.wide dd { font-weight: 500; }
.note { background: var(--bg-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 12px 0 0; }
.calc-lines { display: flex; flex-direction: column; margin-bottom: 10px; }
.calc-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.calc-lines small { color: var(--muted); }
.calc-lines .sum { border-bottom: 0; border-top: 2px solid var(--line-2); font-weight: 700; font-size: 16px; }
.calc-lines .sum b { color: var(--data); }
.calc-lines .sum.alt { border-top: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.calc-lines .sum.alt b { color: var(--amber); }
.progress { height: 8px; background: var(--bg-2); border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }

/* Grafikler */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 180px; align-items: end; }
.bar-col { height: 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; gap: 0 2px; align-items: end; padding: 4px 3px 0; border-radius: 8px; }
.bar-col:hover, .bar-col.on { background: var(--card-2); }
.bar { display: block; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.in { background: var(--brand); } .bar.out { background: #e0795b; }
.bar-col small { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 11px; padding: 4px 0; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.legend .in { background: var(--brand); } .legend .out { background: #e0795b; }
.hbar { display: grid; grid-template-columns: 170px 1fr 120px; gap: 12px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar div { background: var(--bg-2); height: 10px; border-radius: 5px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: #e0795b; border-radius: 5px; }
.hbar b { text-align: right; }

/* Özet sayfası */
.mini-task { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 6px; font-size: 13.5px; }
.mini-task:hover { border-color: var(--brand); }
.mini-task.done { color: var(--muted); text-decoration: line-through; }
.mini-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.mini-board a { background: var(--bg-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mini-board b { font-size: 20px; }
.mini-board small { color: var(--muted); }
.feed { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; }
.feed-i { display: flex; gap: 10px; font-size: 13.5px; }
.feed-i small { display: block; color: var(--muted); }
.feed-i a:hover { color: var(--data); }

/* Ekip */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.person { display: flex; flex-direction: column; gap: 14px; }
.person.off { opacity: .55; }
.person-h { display: flex; align-items: center; gap: 12px; position: relative; }
.person-h > div { display: flex; flex-direction: column; gap: 3px; }
.person-h small { color: var(--muted); }
.person-h .online { position: absolute; top: 0; right: 0; }
.person-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.person-stats > * { background: var(--bg-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.person-stats b { font-size: 18px; }
.person-stats small { color: var(--muted); font-size: 11.5px; }
.person-actions { display: flex; gap: 8px; }
.online { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: inline-block; flex: none; }
.online.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }

/* Sohbet */
.chat { display: grid; grid-template-columns: 1fr 240px; gap: 16px; height: calc(100vh - 130px); }
.chat-main { display: flex; flex-direction: column; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.chat-day { text-align: center; font-size: 11.5px; color: var(--muted); margin: 12px 0 6px; }
.msg { display: flex; gap: 10px; padding: 4px 6px; border-radius: 8px; }
.msg:hover { background: var(--card-2); }
.msg .av { margin-top: 2px; }
.msg.cont .av { visibility: hidden; height: 0; }
.msg-h { font-size: 13px; } .msg-h small { color: var(--muted); margin-left: 6px; }
.msg-b { white-space: pre-wrap; word-break: break-word; }
.msg-b a { color: var(--data); text-decoration: underline; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); margin: 0; }
.chat-form textarea { max-height: 160px; }
.chat-side { overflow-y: auto; }
.member { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13.5px; }
.member span { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.member small { color: var(--muted); }

/* Giriş */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 55%), var(--bg); }
.auth { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.brand.big { justify-content: center; font-size: 20px; padding: 0; }
.auth-card { display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.auth-card h2 { margin: 0; }
.auth-card p { margin: 0; }

/* Mobil */
@media (max-width: 1100px) {
  .grid-2col, .split { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .mobile-only { display: inline-grid; }
  .top { padding: 12px 16px; }
  .top h1 { font-size: 18px; }
  .content { padding: 16px 16px 50px; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; max-height: none; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 110px); }
  .chat-side { display: none; }
  .search input { width: 130px; }
  .hbar { grid-template-columns: 110px 1fr 100px; }
  .bars { height: 140px; gap: 2px; }
  .tbl th, .tbl td { padding: 9px 10px; }
}
@media (max-width: 560px) {
  .grid2, .grid3, .amount-box { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 18px; }
  .modal { padding: 0; }
  .modal-box { border-radius: 0; min-height: 100vh; padding: 20px 16px; }
}

/* Düzeltmeler */
.top .icon-btn.mobile-only { display: none; }
@media (max-width: 860px) { .top .icon-btn.mobile-only { display: inline-grid; } }
.seg.big label span { flex: 1; }

/* Görev takvimi */
.av.xs { width: 18px; height: 18px; font-size: 8px; }
.seg a .ic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 3px; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: #94a3b8; }
.st-doing .st-dot, .st-dot.st-doing { background: var(--blue); }
.st-review .st-dot, .st-dot.st-review { background: var(--amber); }
.st-done .st-dot, .st-dot.st-done { background: var(--green); }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--card-2); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 9px 10px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background .1s; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.wkend { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.cal-day.out { opacity: .45; }
.cal-day.over, .cal-side.over { background: color-mix(in srgb, var(--brand) 16%, transparent); outline: 2px dashed var(--brand); outline-offset: -3px; }
.cal-d { display: flex; align-items: center; gap: 6px; }
.cal-n { font-size: 13px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-n { background: var(--gold-leaf); color: var(--on-brand); }
.cal-wd { display: none; color: var(--muted); font-size: 12.5px; }
.cal-add { margin-left: auto; background: none; border: 0; color: var(--muted); width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 17px; line-height: 1; opacity: 0; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--gold-leaf); color: var(--on-brand); }
.cal-list { display: flex; flex-direction: column; gap: 3px; min-height: 8px; overflow-y: auto; max-height: 190px; }
.cal-task { display: flex; align-items: center; gap: 6px; background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid #94a3b8; border-radius: 6px; padding: 3px 6px; font-size: 12px; cursor: grab; min-width: 0; }
.cal-task .ct { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-task:hover { border-color: var(--line-2); background: var(--card); }
.cal-task.st-doing { border-left-color: var(--blue); }
.cal-task.st-review { border-left-color: var(--amber); }
.cal-task.st-done { border-left-color: var(--green); opacity: .6; }
.cal-task.st-done .ct { text-decoration: line-through; }
.cal-task.high .ct { font-weight: 600; }
.cal-task.late { background: var(--red-bg); border-color: transparent; border-left-color: var(--red); }
.cal-task.late .ct { color: var(--red); }
.cal-task.dragging { opacity: .35; }
.cal-task .st-dot { display: none; }
.cal-side { position: sticky; top: 80px; max-height: calc(100vh - 110px); overflow-y: auto; }
.cal-side h3 { margin-bottom: 4px; }
.cal-side .cal-list { max-height: none; gap: 5px; margin-top: 10px; }
.cal-side .cal-task { padding: 6px 8px; font-size: 13px; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } .cal-side { position: static; max-height: none; } }
/* Telefonda takvim → gün gün liste (boş günler gizli, bugün hep görünür) */
@media (max-width: 700px) {
  .cal-head { display: none; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; border-right: 0; padding: 8px 10px; }
  .cal-day.empty:not(.today), .cal-day.out { display: none; }
  .cal-wd { display: inline; }
  .cal-add { opacity: 1; }
  .cal-list { max-height: none; }
  .cal-task { padding: 7px 9px; font-size: 13.5px; }
}

/* Görev ekibi: birden çok kişi */
.avs { display: inline-flex; flex: none; }
.avs .av + .av { margin-left: -7px; box-shadow: 0 0 0 2px var(--card); }
.who-f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.who-f small { font-weight: 400; }
.who { display: flex; flex-wrap: wrap; gap: 6px; }
.who label { flex-direction: row; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: 20px; cursor: pointer; color: var(--text); font-weight: 400; font-size: 13px; background: var(--card-2); user-select: none; }
.who input { position: absolute; opacity: 0; pointer-events: none; }
.who label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, transparent); }
.who label:has(input:checked)::after { content: "✓"; color: var(--brand); font-weight: 700; }
.who label:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Görev linkleri */
.task-links { display: flex; flex-direction: column; gap: 4px; }
.task-links a { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-2); color: var(--brand); font-size: 13px; text-decoration: none; min-width: 0; }
.task-links a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-links a:hover { border-color: var(--brand); }
.task-links .ic { width: 14px; height: 14px; flex: none; }

/* Bildirim izni şeridi */
.push-ask { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.push-ask[hidden], [data-push-on][hidden] { display: none; }

/* Fatura Oku (fotoğraftan) */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 30px 16px; border: 2px dashed var(--line-2); border-radius: var(--r); background: var(--card); cursor: pointer; color: var(--text); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--bg-2); }
.drop .drop-ic { font-size: 34px; line-height: 1; }
.drop b { font-size: 16px; }
.drop small { color: var(--muted); max-width: 460px; }
.scan-progress { display: flex; flex-direction: column; gap: 4px; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.scan-progress .ok { color: var(--green); } .scan-progress .err { color: var(--red); }
.thumb { width: 44px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); background: var(--card-2); }
.scan-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.scan-review > div { display: flex; flex-direction: column; gap: 12px; }
.scan-doc { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.scan-doc img { width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; background: #fff; }
.scan-doc iframe { width: 100%; height: 78vh; border: 0; border-radius: 8px; background: #fff; }
.vat-lines { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.vat-lines b { color: var(--data); }
@media (max-width: 900px) {
  .scan-review { grid-template-columns: 1fr; }
  .scan-doc { position: static; }
  .scan-doc img { max-height: 55vh; }
  .scan-doc iframe { height: 60vh; }
}

/* iPhone (ana ekrandan açılınca saat/çentik alanı): içerik güvenli alanın altına */
@media (max-width: 860px) {
  .top { padding-top: calc(12px + env(safe-area-inset-top)); padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
  .top .icon-btn.mobile-only { width: 44px; height: 44px; margin-left: -6px; }
  .top .icon-btn.mobile-only .ic { width: 24px; height: 24px; }
  .side { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); padding-left: calc(12px + env(safe-area-inset-left)); }
  .content { padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  .modal-box { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .modal-x { top: calc(10px + env(safe-area-inset-top)); }
}
.by-who { display: inline-flex; align-items: center; gap: 7px; line-height: 1.25; white-space: nowrap; }
.mob-by { display: none; }
@media (max-width: 860px) { .mob-by { display: block; margin-top: 2px; } .tbl .col-by { display: none; } }

/* Faturalar: telefonda kart listesi, sola kaydır → sil */
.inv-cards { display: none; }
@media (max-width: 860px) {
  .inv-table:has(+ .inv-cards) { display: none; }
  .inv-cards { display: flex; flex-direction: column; gap: 8px; }
}
.swipe-hint { margin: 0 2px; }
.swipe { position: relative; overflow: hidden; border-radius: var(--r); }
.swipe-del { position: absolute; inset: 0 0 0 auto; width: 92px; display: flex; }
.swipe-del button { flex: 1; border: 0; background: var(--red); color: #fff; font: 600 13px Inter, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.swipe-del .ic { width: 20px; height: 20px; }
.swipe-body { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--text); transition: transform .2s; touch-action: pan-y; }
.swipe-body.drag { transition: none; }
.inv-card .ic-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.inv-card .ic-party { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Entegrasyon (Shopify + Trendyol ortak stok) */
.int-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.int-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.int-filter input[name=s] { max-width: 280px; }
.tbl-wrap { overflow-x: auto; }
.int-tbl td { padding: 8px 10px; }
.int-tbl td:nth-child(2) { min-width: 220px; }
.int-tbl .nowrap { white-space: nowrap; }
.int-tbl tr.off td { opacity: .45; }
.int-img { width: 52px; }
.int-img img { width: 42px; height: 52px; object-fit: cover; border-radius: 6px; display: block; background: var(--card-2); }
.int-stock { width: 72px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.int-stock.zero { color: var(--red); }
.int-pair { display: flex; gap: 6px; }
.int-pair input { width: 84px; font-variant-numeric: tabular-nums; }
.int-pair input + input { color: var(--muted); }
.pill.ch-s { background: rgba(149,191,71,.16); color: #95bf47; margin-right: 4px; }
.pill.ch-t { background: rgba(242,122,26,.16); color: #f27a1a; }
.int-merge summary { cursor: pointer; color: var(--data); margin-top: 4px; }
.int-merge-box { display: flex; gap: 6px; margin-top: 6px; }
.int-merge-box select { max-width: 320px; }
.int-save { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
@media (max-width: 860px) {
  .int-save { flex-direction: column; align-items: stretch; }
  .int-pair input { width: 78px; }
}
.int-match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.int-match-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.int-match-head input { max-width: 230px; }
.int-list { max-height: 60vh; overflow-y: auto; }
.int-opt { display: flex; flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 13px; font-weight: 400; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.int-opt:hover { background: var(--card-2); }
.int-opt:has(input:checked) { background: color-mix(in srgb, var(--brand) 16%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
.int-opt input { accent-color: var(--brand); width: auto; flex: none; margin: 0; }
.int-opt span { min-width: 0; }
.int-opt img { width: 34px; height: 42px; object-fit: cover; border-radius: 5px; flex: none; }
.int-opt small { color: var(--muted); }
.int-match-bar { grid-column: 1 / -1; position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 10px 0; background: var(--bg); }
.int-done-h { margin: 22px 0 10px; }
.hidden-form { display: none; }
@media (max-width: 860px) { .int-match { grid-template-columns: 1fr; } .int-list { max-height: 40vh; } }
.int-grp { border-bottom: 1px solid var(--line); }
.int-grp > summary { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; list-style: none; font-size: 13px; }
.int-grp > summary::-webkit-details-marker { display: none; }
.int-grp > summary:hover { background: var(--card-2); }
.int-grp > summary input { width: auto; flex: none; margin: 0; accent-color: var(--brand); }
.int-grp > summary img { width: 34px; height: 42px; object-fit: cover; border-radius: 5px; flex: none; }
.int-grp > summary span { flex: 1; min-width: 0; }
.int-grp > summary small { color: var(--muted); }
.int-grp:has(> summary input:checked) > summary { background: color-mix(in srgb, var(--brand) 16%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
.int-chev { font-style: normal; color: var(--muted); transition: transform .15s; }
.int-grp[open] .int-chev { transform: rotate(180deg); }
.int-color { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--data); font-size: 11.5px; font-weight: 600; margin-left: 4px; }
.int-opt.sub { padding-left: 58px; border-bottom: 0; border-top: 1px dashed var(--line); }
.int-tbl tr.grp { cursor: pointer; }
.int-tbl tr.grp:hover td { background: var(--card-2); }
.int-tbl tr.grp.open td { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.int-tbl tr.grp.open .int-chev { transform: rotate(180deg); }
.int-tbl tr.sub td { background: var(--bg-2); padding-top: 5px; padding-bottom: 5px; }
.int-tbl .int-subname { padding-left: 22px; }
.int-tbl tr.int-sec td { background: var(--card-2); font-weight: 700; font-size: 13.5px; padding: 12px 14px; border-top: 2px solid var(--line-2); position: sticky; top: 0; z-index: 1; }
