/* ============================================================
   İnşaat Takip Sistemi — Tema
   Şantiye estetiği: kağıt zemin, mürekkep koyu, baret sarısı vurgu.
   İmza öğesi: "ikaz bandı" (hazard stripe) diyagonal şerit.
   ============================================================ */
:root {
  --paper:      #F6F5F1;
  --paper-2:    #FFFFFF;
  --panel:      #FFFFFF;
  --ink:        #171D24;
  --ink-2:      #1C232B;
  --muted:      #5B6472;
  --muted-2:    #8A929E;
  --line:       #E2E0D8;
  --line-2:     #D3D0C6;
  --accent:     #F5B301;  /* baret sarısı */
  --accent-ink: #4A3B00;
  --info:       #2456A6;
  --ok:         #2E7D46;
  --bad:        #C1352B;
  --warn:       #C77A0A;
  --shadow:     0 1px 2px rgba(23,29,36,.06), 0 6px 20px rgba(23,29,36,.06);
  --shadow-lg:  0 12px 40px rgba(23,29,36,.18);
  --radius:     10px;
  --radius-sm:  7px;
  --mono:       ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans:       system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.center { text-align: center; }

/* ---------- ikaz bandı (imza öğe) ---------- */
.hazard-under { position: relative; }
.hazard-under::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 4px;
  background: repeating-linear-gradient(-45deg,
    var(--accent) 0 10px, var(--ink) 10px 20px);
  opacity: .9;
}

/* ---------- açılış ekranı ---------- */
.boot-screen {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; color: var(--muted);
}
.boot-mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--ink);
  position: relative; overflow: hidden;
}
.boot-mark::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, transparent 8px 16px);
  animation: slide 1s linear infinite;
}
@keyframes slide { to { background-position: 22px 0; } }

/* ============================================================
   Uygulama iskeleti
   ============================================================ */
.app-shell { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px; height: 56px; flex: 0 0 56px;
  background: var(--ink); color: #fff;
  position: relative; z-index: 30;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, var(--ink-2) 12px 24px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent);
  display: grid; place-items: center; color: var(--ink); flex: 0 0 26px;
}
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted-2); letter-spacing: 0; }
.topbar-spacer { flex: 1; }
.top-user { text-align: right; line-height: 1.15; }
.top-user strong { font-size: 13px; }
.top-user span { font-size: 11px; color: var(--muted-2); }
.top-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14);
  padding: 7px 11px; border-radius: var(--radius-sm); font-size: 12.5px; transition: background .15s;
}
.top-btn:hover { background: rgba(255,255,255,.16); }
.top-btn.accent { background: var(--accent); color: var(--ink); border-color: transparent; font-weight: 600; }
.top-btn.accent:hover { filter: brightness(1.05); }

.workspace {
  flex: 1; display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  min-height: 0; position: relative;
}
.tree-panel {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: var(--paper-2);
}
.detail-col { min-height: 0; overflow: auto; background: var(--paper); }
.feed-panel {
  display: flex; flex-direction: column; min-height: 0;
  border-left: 1px solid var(--line); background: var(--paper-2);
}
/* mobil çekmece perdesi ve yüzen buton — masaüstünde gizli */
.scrim { display: none; }
.feed-fab { display: none; }

.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.panel-head .icon-btn { margin-left: auto; }

/* ---------- ikonlar / butonlar ---------- */
.ic { display: block; flex: 0 0 auto; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--paper-2); color: var(--ink-2);
  transition: all .13s;
}
.icon-btn:hover { border-color: var(--muted-2); background: #fff; }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 6px; }
.icon-btn.accent { background: var(--accent); border-color: transparent; color: var(--ink); }
.icon-btn.accent:hover { filter: brightness(1.05); }
.icon-btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.ghost:hover { background: rgba(0,0,0,.05); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--paper-2); color: var(--ink);
  font-weight: 550; transition: all .13s;
}
.btn:hover { border-color: var(--muted-2); background: #fff; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.danger:hover { filter: brightness(1.05); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   Ağaç (proje yapısı)
   ============================================================ */
.tree-search-wrap {
  display: flex; align-items: center; gap: 7px;
  margin: 10px 12px 6px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--paper-2); color: var(--muted);
}
.tree-search {
  flex: 1; border: none; background: transparent; outline: none;
  padding: 8px 0; color: var(--ink);
}
.tree-list { flex: 1; overflow: auto; padding: 4px 8px 16px; }

.tree-node { position: relative; }
.tree-row {
  --pad: calc(6px + var(--depth, 0) * 15px);
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px var(--pad);
  border-radius: 7px; position: relative;
  border: 1px solid transparent;
  user-select: none;
}
.tree-row:hover { background: rgba(23,29,36,.045); }
.tree-row.selected { background: rgba(245,179,1,.16); border-color: rgba(245,179,1,.5); }
.tree-row:focus-visible { outline: 2px solid var(--info); outline-offset: -2px; }
.tree-row.dragging { opacity: .4; }
.tree-row.drop-inside { background: rgba(36,86,166,.14); border-color: var(--info); }
.tree-row.drop-before::before,
.tree-row.drop-after::after {
  content: ""; position: absolute; left: var(--pad); right: 8px; height: 2px; background: var(--info);
}
.tree-row.drop-before::before { top: -1px; }
.tree-row.drop-after::after { bottom: -1px; }

.twisty {
  width: 18px; height: 18px; flex: 0 0 18px; border: none; background: transparent;
  color: var(--muted); display: grid; place-items: center; border-radius: 4px;
  transition: transform .13s;
}
.twisty:hover { background: rgba(0,0,0,.06); }
.twisty.open { transform: rotate(90deg); }
.twisty.hidden { visibility: hidden; }
.type-ic { display: inline-grid; place-items: center; flex: 0 0 auto; }
.type-ic.lg { width: 30px; height: 30px; }
.tree-name {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500;
}
.lock { color: var(--muted-2); display: inline-grid; place-items: center; }
.row-actions {
  display: none; gap: 2px; align-items: center;
}
.tree-row:hover .row-actions, .tree-row:focus-within .row-actions { display: flex; }
.root-drop {
  margin: 8px 4px 0; padding: 12px; text-align: center; font-size: 12px; color: var(--muted-2);
  border: 1.5px dashed var(--line-2); border-radius: 8px; transition: all .13s;
}
.root-drop.over { border-color: var(--info); color: var(--info); background: rgba(36,86,166,.06); }

.empty-note { padding: 26px 18px; text-align: center; color: var(--muted); }
.empty-note p { margin: 4px 0; }

/* ============================================================
   Akış (feed)
   ============================================================ */
.live-dot {
  margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(46,125,70,.5); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46,125,70,.45); }
  70% { box-shadow: 0 0 0 7px rgba(46,125,70,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,125,70,0); }
}
.feed-list { flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.post {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; box-shadow: var(--shadow);
}
.post.announcement {
  border-color: rgba(245,179,1,.55); background: linear-gradient(0deg, #fffdf5, #fffbe9);
  position: relative; overflow: hidden; padding-left: 16px;
}
.post.announcement::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 6px, var(--ink) 6px 12px);
}
.post-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.post-head strong { color: var(--ink); font-size: 12.5px; }
.post-head time { margin-left: auto; font-family: var(--mono); font-size: 11px; }
.post.announcement .post-head time { margin-left: 8px; }
.ann-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; color: var(--accent-ink); background: var(--accent);
  padding: 2px 6px; border-radius: 4px;
}
.post-body { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }
.post-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.feed-composer { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 10px 12px; background: var(--paper-2); position: relative; }
.tag-bar { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tag-bar.hidden { display: none; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(36,86,166,.1); color: var(--info); border: 1px solid rgba(36,86,166,.25);
  padding: 2px 7px; border-radius: 20px; font-size: 12px;
}
.tag-chip.clickable { cursor: pointer; }
.tag-chip.clickable:hover { background: rgba(36,86,166,.18); }
.chip-x { border: none; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; }
.composer-row { display: flex; align-items: flex-end; gap: 7px; position: relative; }
.feed-input {
  flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 8px 10px; outline: none; background: #fff; color: var(--ink); min-height: 38px;
}
.feed-input:focus { border-color: var(--info); }
.announce-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); color: var(--muted); position: relative; background: var(--paper-2);
}
.announce-toggle input { position: absolute; opacity: 0; }
.announce-toggle:has(input:checked) { background: var(--accent); border-color: transparent; color: var(--ink); }

.tag-picker {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 40; padding: 8px; max-height: 300px; display: flex; flex-direction: column;
}
.tag-search { border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; outline: none; margin-bottom: 6px; }
.tag-search:focus { border-color: var(--info); }
.tag-results { overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.tag-option {
  display: flex; align-items: center; gap: 8px; text-align: left;
  border: none; background: transparent; padding: 7px 8px; border-radius: 6px; color: var(--ink);
}
.tag-option:hover { background: rgba(36,86,166,.1); }
.tag-option small { margin-left: auto; color: var(--muted-2); font-size: 11px; }

/* ============================================================
   Detay paneli
   ============================================================ */
.detail-head { padding: 20px 24px 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; margin-bottom: 12px; }
.crumb { border: none; background: transparent; color: var(--muted); padding: 2px 4px; border-radius: 4px; }
.crumb:hover { color: var(--info); background: rgba(36,86,166,.08); }
.crumb.current { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--muted-2); }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h1 { font-size: 22px; }
.type-badge {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid; padding: 2px 8px; border-radius: 20px;
}

.tabs { display: flex; gap: 2px; padding: 16px 24px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; color: var(--muted); font-weight: 550;
  padding: 9px 12px; border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab .count {
  font-size: 11px; background: var(--line); color: var(--muted); padding: 1px 6px; border-radius: 10px;
}
.tab.active .count { background: var(--accent); color: var(--ink); }
.tab-body { padding: 16px 24px 40px; }
.tab-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

/* ---------- tablo ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--paper);
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(23,29,36,.02); }
.row-tools { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.row-tools .meta { color: var(--muted-2); font-size: 11px; margin-right: 4px; }
.row-muted { opacity: .55; }
.progress-cell { min-width: 130px; }
.progress-cell .bar { display: inline-block; width: 90px; vertical-align: middle; margin-right: 8px; }
.bar { height: 7px; background: var(--line); border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #ffca3a); border-radius: 20px; transition: width .3s; }
.bar.big { height: 10px; margin: 8px 0; }

/* ---------- durum çipleri ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.chip-ok { background: rgba(46,125,70,.13); color: var(--ok); }
.chip-bad { background: rgba(193,53,43,.12); color: var(--bad); }
.chip-warn { background: rgba(199,122,10,.14); color: var(--warn); }
.chip-info { background: rgba(36,86,166,.12); color: var(--info); }
.chip-muted { background: rgba(91,100,114,.12); color: var(--muted); }

/* ============================================================
   Genel bakış (dashboard)
   ============================================================ */
.dashboard { padding-bottom: 40px; }
.dash-title { font-size: 24px; margin-bottom: 6px; }
.detail-head .hint { max-width: 640px; }
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 20px 24px;
}
.stat-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow);
}
.stat-card strong { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-card.wide { grid-column: span 2; }
.stat-card.alert { border-color: rgba(193,53,43,.4); background: linear-gradient(0deg, #fff8f7, #fff); }

.activity { padding: 4px 24px 0; }
.activity h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity-list li {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.activity-list time { color: var(--muted-2); font-size: 11px; flex: 0 0 auto; min-width: 60px; }
.act-detail { color: var(--muted); }

/* ============================================================
   Modal
   ============================================================ */
.overlay {
  position: fixed; inset: 0; background: rgba(23,29,36,.5);
  display: grid; place-items: center; padding: 20px; z-index: 100;
  animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--paper-2); border-radius: 14px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; animation: pop .18s;
}
.modal-wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper-2);
}
.modal-head h3 { font-size: 16px; }
.modal > div:not(.modal-head), .modal > form { padding: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.confirm-text { margin: 0 0 4px; }

/* ---------- form ---------- */
.gen-form, .field { display: flex; flex-direction: column; gap: 5px; }
.field { margin-bottom: 13px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-label em { color: var(--bad); font-style: normal; }
.field input, .field select, .field textarea,
.gen-form input, .gen-form select, .gen-form textarea {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 11px;
  outline: none; background: #fff; color: var(--ink); width: 100%; transition: border-color .13s;
}
.field input:focus, .field select:focus, .field textarea:focus,
.gen-form input:focus, .gen-form select:focus, .gen-form textarea:focus { border-color: var(--info); }
textarea { resize: vertical; }
.check-line { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.check-line input { width: auto; }
.role-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 13px; background: var(--paper); }
.role-box.hidden { display: none; }
.role-add { display: flex; gap: 8px; margin-bottom: 14px; }
.role-add input { flex: 1; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 11px; outline: none; }
.role-add input:focus { border-color: var(--info); }
.role-list { list-style: none; margin: 0; padding: 0; }
.role-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.role-list li span:first-of-type { flex: 1; }
.admin-body { min-height: 300px; }

/* ---------- giriş / kurulum ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--paper); }
.auth-card {
  width: 100%; max-width: 400px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.auth-head { padding: 26px 28px 22px; position: relative; }
.auth-head.hazard-under { padding-bottom: 24px; }
.auth-logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--ink);
  display: grid; place-items: center; color: var(--accent); margin-bottom: 14px;
}
.auth-head h1 { font-size: 20px; }
.auth-head p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.auth-body { padding: 22px 28px 28px; }
.auth-body .btn.primary { width: 100%; margin-top: 6px; padding: 11px; }
.auth-error {
  background: rgba(193,53,43,.1); color: var(--bad); border: 1px solid rgba(193,53,43,.3);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.remember-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.remember-line input { width: auto; }
.auth-foot { text-align: center; font-size: 12px; color: var(--muted-2); padding: 0 28px 22px; }

/* ============================================================
   Toast
   ============================================================ */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 22px;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; animation: toastin .2s;
  border-left: 4px solid var(--muted);
}
.toast-ok { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--bad); }
.toast-info { border-left-color: var(--info); }
.toast.out { animation: toastout .3s forwards; }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }
@keyframes toastout { to { transform: translateY(12px); opacity: 0; } }

/* ============================================================
   Duyarlı (responsive)
   ============================================================ */
/* Hamburger yalnızca mobilde görünür */
.hamburger { display: none; }

/* --- orta genişlik: akış sütununu biraz daralt --- */
@media (max-width: 1200px) {
  .workspace { grid-template-columns: 300px minmax(0, 1fr) 320px; }
}

/* --- mobil / tablet: tek sütun + çekmece + akış balonu --- */
@media (max-width: 960px) {
  .hamburger { display: inline-grid; place-items: center; }

  /* yatay taşmayı kökten engelle */
  html, body { overflow-x: hidden; }

  /* topbar sıkıştırma */
  .topbar { gap: 6px; padding: 0 8px; flex-wrap: nowrap; min-width: 0; }
  .top-user { display: none; }
  .brand small { display: none; }
  .brand { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .topbar-spacer { display: none; }
  .top-btn { padding: 7px 8px; flex: 0 0 auto; }
  .top-btn .btn-label { display: none; }
  /* eski app.js ile bile çalışsın: buton içi metni tamamen gizle, ikon (sabit px) kalır */
  .top-btn.accent { font-size: 0; gap: 0; }

  /* detay ana içerik olur, tek sütun */
  .workspace { display: block; }
  .detail-col { height: 100%; overflow: auto; }

  /* proje ağacı: soldan açılır çekmece */
  .tree-panel {
    position: fixed; top: 56px; left: 0; bottom: 0; width: min(86vw, 340px);
    z-index: 45; border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .app-shell.tree-open .tree-panel { transform: translateX(0); }

  /* günlük akış: sağ alttan açılan panel (canlı destek tarzı) */
  .feed-panel {
    position: fixed; z-index: 45; border: 1px solid var(--line);
    right: 12px; bottom: 12px; left: 12px; top: 68px;
    max-width: 460px; margin-left: auto;
    border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg);
    transform: translateY(calc(100% + 24px)); opacity: 0;
    transition: transform .28s ease, opacity .2s ease; pointer-events: none;
  }
  .app-shell.feed-open .feed-panel { transform: translateY(0); opacity: 1; pointer-events: auto; }

  /* perde */
  .scrim {
    display: block; position: fixed; inset: 56px 0 0; z-index: 40;
    background: rgba(23,29,36,.4); opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .app-shell.tree-open .scrim,
  .app-shell.feed-open .scrim { opacity: 1; pointer-events: auto; }

  /* yüzen akış butonu */
  .feed-fab {
    display: inline-grid; place-items: center;
    position: fixed; right: 18px; bottom: 18px; z-index: 46;
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--accent); color: var(--ink); border: none;
    box-shadow: 0 6px 20px rgba(23,29,36,.28);
  }
  .app-shell.feed-open .feed-fab { background: var(--ink); color: #fff; }
  .feed-fab:active { transform: scale(.94); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; padding: 14px; }
  .stat-card.wide { grid-column: span 2; }
  .detail-head { padding: 16px 16px 0; }
  .tabs, .tab-body { padding-left: 16px; padding-right: 16px; }
  .feed-panel { left: 8px; right: 8px; bottom: 8px; }
}