/* ======================================================
   takip.dulduldiagnostic.com — v2 stiller
   Taban: Takip.duldul tasarımından (aç/koyu tema, tokenlar)
   + Mevcut site için: toast, tablo log, liste modal
====================================================== */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-muted: #667085;
  --text-subtle: #98a2b3;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #3730a3;

  --success: #079455;
  --success-soft: #dcfae6;
  --warning: #dc6803;
  --warning-soft: #fef0c7;
  --danger: #d92d20;
  --danger-soft: #fee4e2;
  --info: #0086c9;
  --info-soft: #e0f2fe;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 2px 4px rgba(16,24,40,.04), 0 4px 12px rgba(16,24,40,.06);
  --shadow-lg: 0 6px 16px rgba(16,24,40,.06), 0 16px 40px rgba(16,24,40,.08);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 60px;

  --density-y: 10px;
  --density-x: 14px;
}

[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #11141b;
  --surface-2: #171a22;
  --border: #242831;
  --border-strong: #343945;
  --text: #e8eaed;
  --text-muted: #9ba3ae;
  --text-subtle: #6b7280;
  --accent-soft: #1e1b4b;
  --accent-text: #a5b4fc;
  --success-soft: #052e1a;
  --warning-soft: #3a1f00;
  --danger-soft: #3a0e0a;
  --info-soft: #082f49;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

[data-density="compact"] { --density-y: 6px; --density-x: 10px; }
[data-density="cozy"]    { --density-y: 14px; --density-x: 18px; }

* { box-sizing: border-box; }
html, body { margin:0; padding: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;
  overflow: hidden;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ============ LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  height: 100vh;
  transition: grid-template-columns .2s;
}
.app[data-sidebar="collapsed"] { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar { grid-area: sidebar; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.topbar  { grid-area: topbar;  background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 16px; z-index: 10; }
.main    { grid-area: main;    overflow: auto; position: relative; }

/* ============ SIDEBAR ============ */
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.logo-text { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.logo-text small { display: block; font-weight: 400; color: var(--text-muted); font-size: 11px; letter-spacing: 0; }

.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-group { margin-bottom: 18px; }
.nav-group-label {
  font-size: 11px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase;
  letter-spacing: 0.06em; padding: 8px 10px 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-group-label button {
  background: none; border: none; color: var(--text-subtle); cursor: pointer;
  padding: 2px 6px; border-radius: 4px; font-size: 14px; line-height: 1;
}
.nav-group-label button:hover { background: var(--surface-2); color: var(--text); }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text-muted); font-weight: 500; font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }
.nav-item .badge { margin-left: auto; background: var(--accent); color: white; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center; }
.nav-item.active .badge { background: var(--accent); }
.nav-item .liste-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-item .liste-edit {
  margin-left: auto; opacity: 0; background: none; border: none;
  color: var(--text-subtle); cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 13px;
}
.nav-item:hover .liste-edit { opacity: 1; }
.nav-item .liste-edit:hover { background: var(--surface); color: var(--text); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; cursor: pointer; }
.user-chip:hover { background: var(--surface-2); }
.user-chip-info { flex: 1; min-width: 0; overflow: hidden; }
.user-chip-info .n { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-info .r { color: var(--text-muted); font-size: 11.5px; }
.user-chip .logout-btn { background: none; border: none; color: var(--text-subtle); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.user-chip .logout-btn:hover { background: var(--danger-soft); color: var(--danger); }

.app[data-sidebar="collapsed"] .logo-text,
.app[data-sidebar="collapsed"] .nav-group-label,
.app[data-sidebar="collapsed"] .nav-item span,
.app[data-sidebar="collapsed"] .nav-item .badge,
.app[data-sidebar="collapsed"] .user-chip-info { display: none; }
.app[data-sidebar="collapsed"] .nav-item { justify-content: center; }
.app[data-sidebar="collapsed"] .logo { justify-content: center; padding: 18px 10px; }

/* ============ TOPBAR ============ */
.topbar-title { font-weight: 600; font-size: 16px; }
.topbar-subtitle { color: var(--text-muted); font-size: 13px; }
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid transparent;
  padding: 7px 12px; border-radius: 8px;
  min-width: 280px;
  color: var(--text-muted);
  cursor: text;
}
.topbar-search:focus-within { border-color: var(--accent); background: var(--surface); }
.topbar-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); }
.topbar-search kbd {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px; color: var(--text-subtle);
}
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--text-muted);
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--surface); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  font-weight: 500; font-size: 13.5px;
  transition: background .15s;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b42318; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ============ PAGE ============ */
.page { padding: 20px 24px 80px; max-width: 100%; }
.page-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
.page-sub { color: var(--text-muted); font-size: 13.5px; margin: 2px 0 0; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-title { font-weight: 600; font-size: 14px; }
.card-body { padding: 16px; }

/* ============ BADGES ============ */
.badge-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  line-height: 18px;
}
.badge-pill.neutral { background: var(--surface-2); color: var(--text-muted); }
.badge-pill.success { background: var(--success-soft); color: var(--success); }
.badge-pill.warn { background: var(--warning-soft); color: var(--warning); }
.badge-pill.danger { background: var(--danger-soft); color: var(--danger); }
.badge-pill.info { background: var(--info-soft); color: var(--info); }
.badge-pill.accent { background: var(--accent-soft); color: var(--accent-text); }

.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.priority-dot.acil   { background: #b42318; }
.priority-dot.yuksek { background: var(--danger); }
.priority-dot.orta,
.priority-dot.normal { background: var(--info); }
.priority-dot.dusuk  { background: var(--text-subtle); }

/* ============ AVATARS ============ */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  color: white; font-size: 11px; font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--surface);
}
.avatar-sm { width: 22px; height: 22px; font-size: 9.5px; border-width: 1.5px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-stack .avatar-sm + .avatar-sm { margin-left: -6px; }

/* ============ FORMS ============ */
.input, .select, .textarea {
  width: 100%; padding: 8px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 80px; resize: vertical; font-family: inherit; }
.label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; display: block; }

/* ============ TABLE ============ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; padding: 10px 12px;
  font-size: 11.5px; font-weight: 600; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0;
}
.tbl td { padding: var(--density-y) var(--density-x); border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl tr.selected td { background: var(--accent-soft); }

/* ============ LIST — desktop / mobile anahtar ============ */
.list-mobile { display: none; }
.list-desktop { display: block; }

.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: rgba(79,70,229,0.08);
}
.list-card:active { border-color: var(--accent); background: var(--surface-2); }
.list-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.list-card-title {
  font-weight: 600; font-size: 14.5px; line-height: 1.35;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  text-wrap: pretty;
}
.list-card-meta-top {
  display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap;
}
.list-card-body {
  display: flex; flex-direction: column; gap: 6px;
  padding-left: 30px;  /* checkbox genişliği kadar iç hizalama */
}
.list-card-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.list-card-row .avatar-sm { border-width: 0; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ============ CHIPS ============ */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500;
  background: var(--surface-2); color: var(--text-muted);
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ============ FILTERS BAR ============ */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
}
.filter-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.filter-chip:hover { border-color: var(--border-strong); }

/* ============ VIEW SWITCHER ============ */
.view-switcher { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; }
.view-switcher button { padding: 5px 10px; border-radius: 6px; font-size: 12.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.view-switcher button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ============ KANBAN ============ */
.kanban { display: flex; gap: 14px; padding-bottom: 12px; overflow-x: auto; min-height: calc(100vh - 240px); }
.kanban-col { flex: 0 0 300px; background: var(--surface-2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; }
.kanban-col-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 0 4px; }
.kanban-col-title { font-weight: 600; font-size: 13px; }
.kanban-col-count { background: var(--surface); color: var(--text-muted); font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.kanban-list { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 50px; }

.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; }
.kanban-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.kanban-card-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; margin-bottom: 6px; text-wrap: pretty; }
.kanban-card-meta { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 11.5px; margin-top: 8px; }
.kanban-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

/* ============ CALENDAR ============ */
.calendar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.cal-head div { padding: 10px 12px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-subtle); border-right: 1px solid var(--border); }
.cal-head div:last-child { border-right: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(110px, 1fr); }
.cal-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-height: 100px; cursor: pointer; transition: background .1s; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.other-month { background: var(--bg); color: var(--text-subtle); }
.cal-cell.today { background: var(--accent-soft); }
.cal-date { font-size: 12.5px; font-weight: 600; }
.cal-cell.today .cal-date { color: var(--accent-text); }
.cal-event { background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 4px; padding: 3px 6px; font-size: 11.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.acil,
.cal-event.yuksek { border-left-color: var(--danger); }
.cal-event.dusuk { border-left-color: var(--text-subtle); }
.cal-event.tamamlandi { opacity: 0.55; text-decoration: line-through; }

/* ============ TIMELINE ============ */
.timeline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tl-days { display: grid; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tl-days > div { padding: 8px; font-size: 11.5px; font-weight: 600; text-align: center; border-right: 1px solid var(--border); color: var(--text-muted); }
.tl-days > div.today { background: var(--accent-soft); color: var(--accent-text); }
.tl-name { padding: 12px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--surface); position: sticky; left: 0; z-index: 1; }
.tl-lane { position: relative; border-bottom: 1px solid var(--border); height: 54px; display: grid; }
.tl-lane > .tl-col { border-right: 1px dashed var(--border); }
.tl-lane > .tl-col.today { background: var(--accent-soft); opacity: 0.35; }
.tl-bar { position: absolute; top: 12px; height: 30px; border-radius: 6px; padding: 5px 8px; font-size: 11.5px; color: white; display: flex; align-items: center; overflow: hidden; cursor: pointer; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }

/* ============ REPORTS ============ */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.metric-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.metric-value { font-size: 24px; font-weight: 650; font-family: var(--font); margin: 4px 0; letter-spacing: -0.02em; }
.metric-trend { font-size: 11.5px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.metric-trend.up { color: var(--success); }
.metric-trend.down { color: var(--danger); }

/* ============ DETAIL DRAWER ============ */
.drawer-overlay { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 520px; max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
  z-index: 101;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-footer { border-top: 1px solid var(--border); padding: 12px 18px; display: flex; gap: 8px; }

/* ============ MODAL ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 200; display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ============ TWEAKS PANEL ============ */
.tweaks {
  position: fixed; bottom: 20px; right: 20px;
  width: 300px; background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
}
.tweaks-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.tweaks-body { padding: 14px 16px; max-height: 60vh; overflow-y: auto; }
.tweak-row { margin-bottom: 14px; }
.tweak-row:last-child { margin-bottom: 0; }
.tweak-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.swatches { display: flex; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; }
.swatch.active { border-color: var(--text); }
.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 7px; gap: 2px; }
.seg button { flex: 1; padding: 5px; font-size: 12px; border-radius: 5px; color: var(--text-muted); }
.seg button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ============ POMODORO BAR ============ */
.pomodoro {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface);
  padding: 10px 16px; border-radius: 999px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 140;
  font-size: 13px;
}
.pomodoro-time { font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.pomodoro button { color: var(--surface); padding: 2px; opacity: 0.8; }
.pomodoro button:hover { opacity: 1; }

/* ============ BOTTOM NAV (mobile) ============ */
.bottom-nav { display: none; }
.sidebar-overlay { display: none; }

/* ============ TOAST (mevcut siteden korunan) ============ */
#toastContainer { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 500;
  color: #fff; background: var(--accent);
  animation: slideIn .25s ease; min-width: 220px;
  box-shadow: var(--shadow-md); pointer-events: auto;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ EMPTY STATE ============ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 10px; opacity: .6; }
.empty-state .txt { font-size: 14px; }

/* ============ MOBILE ============ */
@media (max-width: 900px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr auto; grid-template-areas: "topbar" "main" "bottom"; height: auto; min-height: 100vh; }
  .sidebar { display: none; }
  .sidebar.open-mobile {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 85vw; z-index: 200;
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(16,24,40,.4);
    z-index: 199;
    animation: fadeIn .15s ease;
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .main { overflow: visible; padding-bottom: 84px; }
  .page { padding: 12px 12px 84px; }

  /* Topbar */
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar-search { display: none; }
  .topbar-title { font-size: 16px; font-weight: 650; }
  .topbar .icon-btn { width: 40px; height: 40px; }  /* daha büyük dokunma alanı */
  .topbar .btn.btn-primary {
    padding: 8px 12px; font-size: 13px;
    min-height: 40px;
  }

  /* Bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-top: 1px solid var(--border);
    justify-content: space-around; padding: 6px 4px; z-index: 50;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -4px 16px rgba(16,24,40,0.04);
  }
  .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 10px; color: var(--text-muted); font-size: 10.5px; font-weight: 500;
    min-width: 56px; border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav button:active { background: var(--surface-2); }
  .bottom-nav button.active { color: var(--accent); }
  .bottom-nav button svg { width: 22px; height: 22px; }

  /* Page header / actions */
  .page-header { gap: 10px; margin-bottom: 12px; }
  .page-actions { width: 100%; margin-left: 0; gap: 6px; }
  .page-actions .view-switcher { flex: 1; overflow-x: auto; max-width: 100%; }
  .page-actions .view-switcher button { flex: 1; justify-content: center; min-width: 48px; }

  /* List view toggle */
  .list-desktop { display: none; }
  .list-mobile { display: block; }

  /* Drawer — tam ekran, edge-swipe duyarlı */
  .drawer { width: 100vw; }
  .drawer-body { padding: 14px; }
  .drawer-header { padding: 12px 14px; }
  .drawer-footer {
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
    position: sticky; bottom: 0; background: var(--surface);
  }

  /* Tweaks + pomodoro */
  .tweaks { bottom: 84px; right: 10px; left: 10px; width: auto; }
  .pomodoro { bottom: 84px; padding: 8px 14px; font-size: 12px; }
  .pomodoro-time { font-size: 14px; }

  /* Tablo gizleme (rapor, admin, vs.) */
  .tbl-mobile-hide { display: none !important; }

  /* Rapor metrikleri — 2 sütun */
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric { padding: 12px; }

  /* Filtreler — yatay scroll */
  .filters {
    padding: 8px; gap: 6px;
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .filters > * { flex-shrink: 0; }
  .filter-chip { white-space: nowrap; }

  /* Kanban */
  .kanban { min-height: 400px; padding-bottom: 8px; gap: 10px; }
  .kanban-col { flex: 0 0 82vw; padding: 10px; }
  .kanban-card { padding: 11px; }

  /* Takvim — kompakt */
  .cal-grid { grid-auto-rows: minmax(72px, 1fr); }
  .cal-cell { padding: 4px; font-size: 11px; min-height: 72px; }
  .cal-event { font-size: 10.5px; padding: 2px 4px; }
  .cal-head div { padding: 6px 4px; font-size: 10.5px; }

  /* Timeline — header sticky */
  .tl-name { padding: 8px; min-width: 140px; }

  /* Modaller — alttan slayt */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto; max-height: 90vh; max-width: 100%;
  }
  .modal-footer {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
  }

  /* Form input'ları — iOS zoom kilit */
  .input, .select, .textarea { font-size: 16px; }

  /* Sidebar mobil — logo ve nav items daha ferah */
  .sidebar.open-mobile .nav-item { min-height: 44px; padding: 10px 12px; }
}

@media (max-width: 500px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-value { font-size: 20px; }
  .page-header { gap: 8px; }
  .list-card-body { padding-left: 0; } /* dar ekranda checkbox hizalama iç boşluğunu kaldır */

  /* Detail drawer tablar — scroll edilebilir */
  .drawer-body > .row[style*="border-bottom"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
}

/* utility */
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* Mobil menü açılırken body scroll kilidi */
body.no-scroll { overflow: hidden; }

/* Subtask row */
.altgorev-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 6px;
  transition: background .12s;
}
.altgorev-row:hover { background: var(--surface-2); }
.altgorev-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }
.altgorev-row input[type="text"] {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13.5px; padding: 4px 6px; border-radius: 4px;
}
.altgorev-row input[type="text"]:focus { background: var(--surface-2); }
.altgorev-row .del { background: none; border: none; color: var(--text-subtle); cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.altgorev-row .del:hover { color: var(--danger); background: var(--danger-soft); }
