/* Tüm renkler CSS değişkenleri üzerinden gelir; değerleri themes.js atar.
   Bu sayede tema değiştiğinde tek satır CSS bile düzenlenmez. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;                 /* rail + sayfa yan yana */
}

.app {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  gap: 0;
}
/* Sayfa gizleme: .app'in display:flex'i [hidden]'ı ezmesin diye açık kural */
.app[hidden], .page-contacts[hidden] { display: none; }

/* Tam ekran: takvim pencereyi kenardan kenara doldurur */
.app--fullscreen { padding: 0; }
.app--fullscreen .toolbar { padding: 12px 16px; margin-bottom: 0; }
.app--fullscreen .legend { padding: 0 16px 10px; margin-bottom: 0; }
.app--fullscreen .calendar {
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}
.app--fullscreen .app__main { gap: 0; }
.app--fullscreen .sidebar {
  border: none;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

/* ---- Araç çubuğu ---- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar__nav { display: flex; align-items: center; gap: 8px; }

.toolbar__title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-left: 8px;
  min-width: 180px;
}

/* Seçili zaman diliminin UTC ofseti (ör. "+3") — monthLabel yanında küçük bilgi rozeti */
.toolbar__tz {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.toolbar__tz:hover { background: var(--surface-alt); border-color: var(--accent); }
.toolbar__tz:empty { display: none; }

/* Aranabilir select (input + datalist) — kabı doldurur */
.combo { display: flex; width: 100%; }
.combo .select { width: 100%; cursor: text; }

.toolbar__right { display: flex; align-items: center; gap: 12px; }

/* Görünüm değiştirici — ayrı yuvarlak butonlar (G H A Y) */
.viewswitch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.viewswitch__btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.viewswitch__btn:hover { color: var(--text); border-color: var(--accent); }
.viewswitch__btn--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--accent); }
.btn--icon { padding: 8px 12px; font-size: 1.1rem; line-height: 1; }
.btn--active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:disabled:hover { border-color: var(--border); }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn--primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn--danger { background: transparent; color: #dc2626; border-color: var(--border); }
.btn--danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

.select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  /* Uzun seçenek metinleri (ör. zaman dilimi adları) kabı taşırmasın; taşan ad kırpılır */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Etiket yönetimi (legend) ---- */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: grab;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.legend__item:active { cursor: grabbing; }
.legend__item:hover { background: var(--surface-alt); border-color: var(--accent); }
.legend__item .legend__dot { transition: opacity 0.12s ease; }
/* Filtreyle gizli etiket: soluk + üstü çizili */
.legend__item--off { opacity: 0.45; }
.legend__item--off .legend__dot { opacity: 0.4; }
.legend__item--off span:last-child { text-decoration: line-through; }
.legend__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend__add {
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.legend__add:hover { border-color: var(--accent); background: var(--surface-alt); }
.legend__manage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.legend__manage:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-alt); }

/* ---- Etiket yönetim listesi (⚙ paneli) ---- */
.tagmgr { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.tagmgr__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: border-color 0.12s ease;
}
.tagmgr__item:hover { border-color: var(--accent); }
.tagmgr__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagmgr__edit { color: var(--text-muted); font-size: 0.8rem; }
.tagmgr__empty { color: var(--text-muted); font-size: 0.85rem; padding: 8px 2px; }
/* Renk paleti popover'ı */
.tagpop {
  position: fixed;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.tagpop__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tagpop__sw {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease;
}
.tagpop__sw:hover { transform: scale(1.12); }
.tagpop__sw--on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent); }
.tagpop__custom {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-muted);
}
.tagpop__custom input[type="color"] {
  width: 28px; height: 24px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: transparent; cursor: pointer;
}
.tagmgr__back {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  margin-bottom: 14px;
}
.tagmgr__back:hover { color: var(--accent); }

/* ---- Etiket sürükle-bırak önizleme + yayılma efekti ---- */
/* Hedef hücre/saat önizlemesi (etiketin rengiyle) */
.tag-drop {
  position: absolute;
  pointer-events: none;
  z-index: 6;
  border: 1px solid transparent;
  border-radius: 6px;
}
.tag-drop--slot {
  left: 2px;
  right: 2px;
  border-width: 1px 1px 1px 3px;
  display: flex;
  align-items: flex-start;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  overflow: hidden;
}
.tag-drop--cell {
  inset: 0;
  border-width: 2px;
}
/* Bırakınca rengin hücreye yayıldığı geçici katman (JS clip-path ile animasyonlu) */
.tag-spread {
  position: absolute;
  pointer-events: none;
  z-index: 7;
  border-radius: 6px;
}

/* ---- Etkinlik detayında etiket rozetleri ---- */
.modal__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* ---- Etkinlik formunda etiket seçici (çoklu) ---- */
.tagpicker { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.tagpicker__chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Etiket seçicilerinde (legend + form) yazarak-filtreleme kutusu */
.tagsearch {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  max-width: 220px;
}
.tagsearch:focus { outline: none; border-color: var(--accent); }
.legend__search { max-width: 150px; padding: 5px 9px; }
.tagchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.tagchip__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.tagchip--on { font-weight: 600; }
.tagchip--on .tagchip__dot { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5); }
.tagchip--add { color: var(--accent); border-style: dashed; }
.tagchip--add:hover { border-color: var(--accent); background: var(--surface-alt); }

/* ---- Etiket ayar paneli ---- */
.settings__panel--sm { width: min(360px, 92vw); }
.tagcolor { display: flex; align-items: center; gap: 12px; }
.tagcolor input[type="color"] {
  width: 44px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  cursor: pointer;
  flex-shrink: 0;
}
.tagcolor__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.tagcolor__swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.tagcolor__swatch:hover { transform: scale(1.12); }

/* ---- Takvim ---- */
.calendar {
  flex: 1;                     /* kalan tüm yatay alanı doldur (app__main satırı) */
  min-height: 0;               /* flex çocuğunun taşmasını engelle */
  min-width: 0;                /* kenar çubuğu yanında taşmayı engelle */
  display: flex;
  flex-direction: column;
  user-select: none;           /* sürükleyerek seçimde metin seçilmesin */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/* Hafta numarası açıkken sola dar bir sütun eklenir */
.calendar--weeks .calendar__weekdays,
.calendar--weeks .calendar__grid {
  grid-template-columns: 46px repeat(7, 1fr);
}

.calendar__grid {
  flex: 1;                     /* haftalık başlıktan kalan alanı doldur */
  min-height: 0;
  grid-auto-rows: 1fr;         /* 6 satır eşit yükseklikte esner */
}

/* Son sütunun sağ kenarlığını kaldır (mod'a göre) */
.calendar__grid > *:nth-child(7n) { border-right: none; }
.calendar--weeks .calendar__grid > *:nth-child(7n) { border-right: 1px solid var(--border); }
.calendar--weeks .calendar__grid > *:nth-child(8n) { border-right: none; }

/* ---- Hafta sonu gizli: 5 gün sütunu ---- */
.calendar--noweekend .calendar__weekdays,
.calendar--noweekend .calendar__grid { grid-template-columns: repeat(5, 1fr); }
.calendar--noweekend.calendar--weeks .calendar__weekdays,
.calendar--noweekend.calendar--weeks .calendar__grid { grid-template-columns: 46px repeat(5, 1fr); }

/* Kenarlıkları sıfırla, sonra satır sonundaki sütunda sağ kenarlığı kaldır.
   Hafta numarasız: satırda 5 öğe → 5n; hafta numaralı: 6 öğe → 6n. */
.calendar--noweekend .calendar__grid > * { border-right: 1px solid var(--border); }
.calendar--noweekend .calendar__grid > *:nth-child(5n) { border-right: none; }
.calendar--noweekend.calendar--weeks .calendar__grid > *:nth-child(5n) { border-right: 1px solid var(--border); }
.calendar--noweekend.calendar--weeks .calendar__grid > *:nth-child(6n) { border-right: none; }

/* Hafta numarası hücreleri */
.weekday--wk { color: var(--other-month); }
.week-num {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--other-month);
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.calendar__weekdays {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.weekday {
  padding: 10px 8px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.day {
  position: relative;
  min-height: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  transition: background 0.12s ease;
}
.day:hover { background: var(--surface-alt); }
.day--today:hover { background: var(--today-bg); }

/* Sürükleyerek çoklu hücre seçimi vurgusu (ay + zaman ızgarası) */
.cell--sel { background: color-mix(in srgb, var(--accent) 26%, transparent) !important; }

/* ---- Sürükle-bırak (etkinlik taşıma) ---- */
.draggable { cursor: grab; }
.draggable:active { cursor: grabbing; }
.dragging { opacity: 0.4; }
/* Bırakma hedefi vurgusu */
.cell--dropover,
.tg__alldaycell--dropover {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tg__col--dropover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
/* Bırakma konumu göstergesi: hedef saatte yatay çizgi + saat etiketi */
.tg__dropline {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2px solid var(--accent);
  pointer-events: none;
  z-index: 5;
}
.tg__dropline-label {
  position: absolute;
  top: -9px; left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.day--other .day__num { color: var(--other-month); }
.day--today {
  background: var(--today-bg);
}
.day--today .day__num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.day__num { font-size: 0.85rem; font-weight: 500; align-self: flex-start; }

.event {
  font-size: 0.74rem;
  line-height: 1.25;
  padding: 2px 6px;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid rgba(0,0,0,0.2);
}
.event__time { opacity: 0.85; font-variant-numeric: tabular-nums; margin-right: 4px; }

/* Görevden "etkinliği göster" ile vurgulanan etkinlik kutusu (ay/hafta/gün) */
.event--flash {
  position: relative;
  z-index: 6;
  animation: eventFlash 0.55s ease-in-out 3 alternate;
}
@keyframes eventFlash {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  to   { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent), 0 0 12px 2px color-mix(in srgb, var(--accent) 55%, transparent); }
}

.day__more {
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  padding-left: 4px;
}
.day__more:hover { color: var(--accent); }

/* ============ GÜN / HAFTA GÖRÜNÜMÜ (zaman ızgarası) ============ */
.tg { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Bölünmüş görünüm: takvim adlarını gösteren üst grup başlığı satırı */
.tg__groups {
  display: grid;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.tg__group {
  padding: 6px 8px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  border-right: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg__group:last-child { border-right: none; }

.tg__header {
  display: grid;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.tg__corner {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.tg__cornerwk { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; }
.tg__cornernum { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tg__dayhead {
  padding: 8px 6px;
  text-align: center;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tg__dayhead:last-child { border-right: none; }
.tg__wd { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.tg__date { font-size: 0.95rem; font-weight: 600; }
.tg__dayhead--today .tg__date { color: var(--accent); }

.tg__allday {
  display: grid;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tg__alllabel {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 6px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.tg__alldaycell {
  position: relative;
  padding: 4px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
}
.tg__alldaycell:last-child { border-right: none; }
.tg__allmore {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 1px 6px;
}
.tg__allmore:hover { color: var(--accent); }

.tg__scroll { flex: 1; min-height: 0; overflow-y: auto; }
.tg__body { display: grid; position: relative; }

.tg__gutter { border-right: 1px solid var(--border); }
.tg__hour {
  position: relative;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  padding-right: 6px;
  box-sizing: border-box;
}
.tg__hour::after {                   /* saat çizgisinin sol sütuna uzantısı */
  content: "";
  position: absolute;
  right: 0; top: 0;
  border-top: 1px solid var(--border);
  width: 6px;
}

.tg__col { position: relative; border-right: 1px solid var(--border); }
/* Şu anki zaman çizgisi (bugünün sütunu) */
.tg__now {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 2px solid #ef4444;
  z-index: 5; pointer-events: none;
}
.tg__now::before {
  content: ""; position: absolute; left: -1px; top: -4px;
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
}
/* Bölünmüş görünüm: her takvim grubunun ilk sütununda vurgu ayırıcı */
.tg__col--groupstart { border-left: 2px solid var(--accent); }
.tg__dayhead--groupstart { border-left: 2px solid var(--accent); }
.tg__col:last-child { border-right: none; }
.tg__col--today { background: var(--today-bg); }
.tg__line { border-top: 1px solid var(--border); box-sizing: border-box; transition: background 0.12s ease; }
.tg__line:hover { background: var(--surface-alt); }

/* Yarım saatlik aralıklar: :30 hücresinin üst çizgisi kesik olur (ayar açıkken) */
.tg__line--half { border-top-style: dashed; }

.tg__event {
  position: absolute;
  left: 3px; right: 3px;
  border-radius: 5px;
  color: #fff;
  padding: 2px 6px;
  overflow: hidden;
  cursor: pointer;
  font-size: 0.74rem;
  line-height: 1.2;
  box-shadow: var(--shadow);
}
.tg__event-time { display: block; font-size: 0.68rem; opacity: 0.9; font-variant-numeric: tabular-nums; }
.tg__event-title { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kısa süreli olaylar: saat + başlık tek satırda (dikeyde kesilmeyi önler) */
.tg__event--short { white-space: nowrap; padding-top: 1px; padding-bottom: 1px; }
.tg__event--short .tg__event-time { display: inline; margin-right: 4px; }
.tg__event--short .tg__event-title { display: inline; }

/* Çakışma taşması özeti: "+N daha" */
.tg__more {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.72rem;
  box-shadow: none;
}
.tg__more:hover { border-color: var(--accent); color: var(--accent); }

/* ============ YIL GÖRÜNÜMÜ ============ */
.yeargrid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(150px, 1fr);   /* satırlar pencere yüksekliğini eşit paylaşır */
  gap: 14px;
  padding: 16px;
}
.mini {
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mini__title {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px 8px;
}
.mini__title:hover { color: var(--accent); }
.mini__weekdays,
.mini__days { display: grid; grid-template-columns: repeat(7, 1fr); }
.mini__weekdays { padding: 0 1px; }        /* ızgara kenarlığıyla sütun hizası */
.mini__days {
  flex: 1;                    /* başlık + gün adlarından kalan kart alanını doldur */
  min-height: 0;
  grid-auto-rows: 1fr;        /* gün satırları kartı eşit doldurur */
  gap: 1px;                   /* aralar ızgara çizgisi olur */
  background: var(--border);  /* çizgi rengi (gap'lerden görünür) */
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.mini--weeks .mini__weekdays,
.mini--weeks .mini__days { grid-template-columns: 28px repeat(7, 1fr); }
.mini__wk {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* İçinde bulunulan hafta */
.mini__wk--current {
  background: var(--accent) !important;
  color: #fff;
}
.mini__days .mini__wk { background: var(--surface-alt); }   /* ızgara içindeki hafta sütunu */
.mini__weekdays span {
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-muted);
  padding-bottom: 4px;
}
.mini__day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  background: var(--surface);       /* karo dolgusu; gap'ler çizgi olarak kalır */
}
.mini__day:hover { background: var(--surface-alt); }
.mini__day--empty { cursor: default; background: var(--surface); }
.mini__day--empty:hover { background: var(--surface); }
.mini__day--today { background: var(--accent); color: #fff; }
.mini__day--has::after {
  content: "";
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.mini__day--today.mini__day--has::after { background: #fff; }

@media (max-width: 900px) {
  .yeargrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .yeargrid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal[hidden] { display: none; }
/* Etiket paneli her zaman başka bir formun ÜSTÜNDE açılır (etkinlik/kayıt formundaki "＋ Yeni") */
#tagPanel { z-index: 60; }
/* Onay penceresi her şeyin ÜSTÜNDE: etiket panelinden "Sil" onayı panelin arkasında kalmamalı */
#confirmModal { z-index: 70; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.modal__card {
  position: relative;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: min(420px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal__close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.modal__title { font-size: 1.15rem; margin-bottom: 12px; padding-right: 20px; }
/* Başlık üstü küçük etiket: kaydın ait olduğu tablo adı */
.modal__eyebrow {
  display: block; padding-right: 20px; margin-bottom: 2px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent);
}
.modal__eyebrow:empty { display: none; }
.modal__eyebrow + .modal__title { margin-top: 0; }
.modal__body { display: flex; flex-direction: column; gap: 10px; }
.modal__row { display: flex; gap: 8px; font-size: 0.9rem; }
.modal__row strong { color: var(--text-muted); min-width: 72px; font-weight: 500; }
.modal__row--date { align-items: center; }
.modal__rowbtn {
  flex-shrink: 0; margin-left: auto;
  background: transparent; border: 1px solid var(--border);
  color: var(--accent); border-radius: 7px;
  padding: 3px 9px; font-size: 0.78rem; font-weight: 500; cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.modal__rowbtn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.modal__badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  color: #fff; font-size: 0.78rem; align-self: flex-start;
}
.modal__row--click { cursor: pointer; padding: 4px; border-radius: 6px; align-items: center; }
.modal__row--click:hover { background: var(--surface-alt); }
.modal__actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.modal__card--sm { width: min(360px, 90vw); }
/* Sağdan açılan panel (ayarlar paneli gibi) — merkez kart yerine */
.modal__card--panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 96vw);
  height: 100%;
  max-height: none;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  box-shadow: -8px 0 30px rgba(0,0,0,0.25);
  overflow-y: auto;
  animation: slideIn 0.18s ease;
}
/* Sağdan açılan tüm panellerde aksiyon butonlarını (Sil/İptal/Kaydet vb.) panelin EN ALTINA sabitle
   (içerik kısa olsa da butonlar altta durur; içerik uzunsa doğal akışta panel kayar) */
.modal__card--panel { display: flex; flex-direction: column; }
/* Form tabanlı paneller (etkinlik/kayıt/ilişki/bağlantı): form kalan alanı doldursun ki
   içindeki aksiyonlar en alta itilebilsin */
.modal__card--panel > form.eform { flex: 1 0 auto; display: flex; flex-direction: column; }
#modal .modal__body { flex: 1 1 auto; min-height: 0; }
.modal__card--panel .eform__actions,
.modal__card--panel .view-actions,
#modal .modal__actions { margin-top: auto; }
.confirm__msg { font-size: 0.92rem; color: var(--text-muted); margin: 4px 0 16px; line-height: 1.4; }

/* Toplu veri ekle (Excel/CSV içe aktarma) — geniş sağ panel + adımlar + doğrulama ızgarası */
.modal__card--wide { width: min(920px, 96vw); }

/* ---- Büyük merkezî "pano" modalı (kayıt görüntüle / düzenle / ekle) — Azure board benzeri ----
   SABİT boyut: içerik az/çok olsa da modal büyüyüp küçülmez; gövde kendi içinde kaydırılır. */
.modal__card--board {
  width: min(1080px, 95vw);
  height: min(86vh, 800px);
  max-height: 95vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.board__top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 22px; border-bottom: 1px solid var(--border); flex: none;
}
.board__titlewrap { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.board__titlewrap .modal__title { margin: 0; padding: 0; }
/* Başlık: satır-içi düzenlenebilir input (metin gibi; odakta çerçeve) */
.board__title { min-width: 0; }
/* Başlık satırı: ID rozeti + başlık aynı satırda */
.board__titlerow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.board__titlerow .board__titleinput { flex: 1 1 auto; min-width: 0; }
.board__title-static { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.board__idbadge {
  flex: none; font-size: 0.9rem; font-weight: 700; color: var(--text-muted);
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 9px; white-space: nowrap;
}
.board__titleinput {
  width: 100%; font-size: 1.25rem; font-weight: 700; color: var(--text);
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 4px 8px; margin: -4px -8px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.board__titleinput:hover { border-color: var(--border); }
.board__titleinput:focus { outline: none; border-color: var(--accent); background: var(--surface-alt); }
.board__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.board__tags[hidden] { display: none; }
.board__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.board__close { position: static; top: auto; right: auto; font-size: 1.5rem; }
.board__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.viewbody.board__scroll { padding: 18px 22px; }
.eform.board__scroll { padding: 18px 22px; }
/* İki sütunlu gövde: sol Açıklama (ana), sağ sekmeler (Ayrıntılar / Bağlantılar) */
.board__body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.board__main { min-width: 0; }
.board__side { min-width: 0; display: flex; flex-direction: column; }
.board__section { margin-bottom: 16px; }
.board__sectitle { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 0 0 10px; }
.board__discussion { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.board__footer { padding-top: 16px; margin-top: 18px; border-top: 1px solid var(--border); }
/* Sekmeler */
.board__tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.board__tab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 0.9rem; font-weight: 600;
  padding: 8px 12px; cursor: pointer; margin-bottom: -1px;
}
.board__tab:hover { color: var(--text); }
.board__tab--active { color: var(--accent); border-bottom-color: var(--accent); }
.board__tabpanel[hidden] { display: none; }
/* Sekme panelleri SABİT yükseklik + kendi içinde kaydırma: sekme değişince gövde yüksekliği
   değişmez, altındaki Yorumlar bölümü kaymaz. */
.board__tabpanel { display: flex; flex-direction: column; gap: 12px; height: 320px; overflow-y: auto; padding-right: 4px; }
/* Satır-içi düzenlenebilir alanlar: kontroller sade görünür, odakta belirginleşir */
.inlineedit { display: flex; flex-direction: column; gap: 12px; }
.inlineedit .eform__field { gap: 4px; }
.inlineedit .eform__field > span { font-size: 0.8rem; color: var(--text-muted); }
/* Salt-okunur alan değeri (ör. otomatik ID, Oluşturan) — düzenlenemez olduğu için arka plansız,
   düz metin gibi görünür (dolgu hizası korunur). */
.eform__ro {
  padding: 8px 2px; color: var(--text); font-weight: 600;
}
.inlineedit--main { gap: 0; }
.inlineedit--main textarea { min-height: 220px; }
.inlineedit--main .richtext { min-height: 220px; }
/* Zengin metin (HTML) düzenleyici — HTML etiketlerini render eder, düzenlenebilir */
.richtext {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  padding: 8px 10px; min-height: 88px; overflow-y: auto;
  font: inherit; line-height: 1.5;
  transition: border-color 0.12s ease;
}
.richtext:focus { outline: none; border-color: var(--accent); }
.richtext:empty::before { content: attr(data-placeholder); color: var(--text-muted); }
.richtext p { margin: 0 0 8px; }
.richtext p:last-child { margin-bottom: 0; }
.richtext ul, .richtext ol { margin: 0 0 8px; padding-left: 22px; }
.richtext a { color: var(--accent); text-decoration: underline; }
.richtext img { max-width: 100%; height: auto; }
.richtext h1, .richtext h2, .richtext h3 { margin: 4px 0 8px; line-height: 1.3; }
.richtext table { border-collapse: collapse; }
.richtext td, .richtext th { border: 1px solid var(--border); padding: 4px 8px; }
/* Form alanları: iki sütunlu ızgara; uzun metin/zengin alanlar tam satır */
.eform--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.eform--grid .eform__field--full, .eform--grid .eform__check { grid-column: 1 / -1; }
@media (max-width: 780px) {
  .modal__card--board { height: 92vh; }
  .board__body { grid-template-columns: 1fr; gap: 20px; }
  .eform--grid { grid-template-columns: 1fr; }
}
/* "Toplu veri ekle" sidebar'ın en altında; rounded mor (accent) dolgulu buton (ikonsuz).
   İki-sınıf seçici: `.sidebar__newbtn` (dosyada sonra gelir) stilleri ezmesin. */
.sidebar__newbtn.sidebar__importbtn {
  margin-top: auto;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  padding: 9px 12px;
}
.sidebar__newbtn.sidebar__importbtn:hover { background: var(--accent); filter: brightness(1.08); }
.bulkimport { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; }
.bulkimport__step { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin: 0; }
.bulkimport__hint { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.bulkimport__err { color: #dc2626; font-weight: 600; }
.bulkimport__preview { display: flex; flex-direction: column; gap: 8px; }
.bulkimport__cols { display: flex; flex-wrap: wrap; gap: 8px; }
.bulkimport__col {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 0.82rem;
}
.bulkimport__col--req { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.bulkimport__coltype { color: var(--text-muted); font-size: 0.74rem; }
.bulkimport__req { color: var(--accent); font-size: 0.68rem; font-weight: 700; }
.bulkimport__drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed var(--border); border-radius: 12px; padding: 34px 16px;
  cursor: pointer; text-align: center; transition: border-color 0.12s ease, background 0.12s ease;
}
.bulkimport__drop:hover { border-color: var(--accent); background: var(--surface-alt); }
.bulkimport__dropicon { font-size: 1.8rem; color: var(--accent); }
.bulkimport__droptext { font-size: 0.9rem; color: var(--text); }
.bulkimport__file { font-size: 0.82rem; color: var(--text-muted); }
.bulkimport__summary { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 0.86rem; }
.bulkimport__count { font-weight: 600; color: var(--text); }
.bulkimport__good { color: #16a34a; font-weight: 600; }
.bulkimport__bad { color: #dc2626; font-weight: 600; }
.bulkimport__gridwrap { flex: 1 1 auto; min-height: 120px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.bulkimport__grid { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.bulkimport__grid th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-alt); color: var(--text-muted); font-weight: 600;
  text-align: left; padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.bulkimport__rownum { width: 1%; color: var(--text-muted); text-align: right; padding: 0 8px; user-select: none; }
.bulkimport__grid td { padding: 0; border-bottom: 1px solid var(--border); }
.bulkimport__cell {
  width: 100%; min-width: 120px; box-sizing: border-box;
  border: none; background: transparent; color: var(--text);
  padding: 7px 10px; font-size: 0.82rem; font-family: inherit;
}
.bulkimport__cell:focus { outline: none; background: var(--surface-alt); }
.bulkimport__cell--err { background: color-mix(in srgb, #dc2626 14%, transparent); color: #fca5a5; }
.bulkimport__cell--err:focus { background: color-mix(in srgb, #dc2626 20%, transparent); }

/* ---- Olay formu ---- */
.eform { display: flex; flex-direction: column; gap: 12px; }
.eform__field { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-muted); }
.eform__field input,
.eform__field textarea,
.eform__field select {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
}
.eform__field input:focus,
.eform__field textarea:focus,
.eform__field select:focus { outline: none; border-color: var(--accent); }
.eform__field textarea { resize: vertical; }
/* Label yanında inline bilgi notu */
.eform__hint { font-size: 0.72rem; color: var(--text-muted); }
.eform__hint--inline { margin-left: 6px; font-weight: 400; opacity: 0.85; }
.eform__hint--inline::before { content: "· "; }

/* Select2 tarzı aranabilir açılır seçici */
.s2 { position: relative; }
.s2__control {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}
.s2--open .s2__control { border-color: var(--accent); }
.s2__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s2__value--ph { color: var(--text-muted); }
.s2__arrow { flex-shrink: 0; color: var(--text-muted); font-size: 0.75rem; transition: transform 0.12s ease; }
.s2--open .s2__arrow { transform: rotate(180deg); }
.s2__dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.s2__search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.9rem;
  outline: none;
}
.s2__options { list-style: none; margin: 0; padding: 4px; max-height: 220px; overflow-y: auto; }
.s2__opt {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s2__opt--active { background: var(--surface-alt); }
.s2__opt--sel { color: var(--accent); font-weight: 600; }
/* Renk yuvarlağı (renk atanmış select seçeneği/değeri önünde) */
.s2__dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle; flex-shrink: 0;
}
.s2__empty { padding: 10px; color: var(--text-muted); font-size: 0.85rem; text-align: center; }
.eform__error {
  font-size: 0.82rem;
  color: #fff;
  background: #dc2626;
  border-radius: 8px;
  padding: 8px 10px;
  margin: -4px 0 0;
}
.eform__error[hidden] { display: none; }
.eform__check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.eform__row { display: flex; gap: 12px; }
.eform__row .eform__field { flex: 1; }
.eform__actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.eform__spacer { flex: 1; }
.eform__actions .btn[hidden] { display: none; }

/* ---- Bölünmüş görünüm butonu (toolbar) ---- */
.btn--split {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  line-height: 1;
}
.btn--split.btn--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--split:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn--split:disabled:hover { border-color: var(--border); }

/* ---- Ayarlar paneli ---- */
.btn--settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  width: 36px;
  height: 36px;
}
.btn__gear { font-size: 1.15rem; line-height: 1; }

.settings__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 90vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.18s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.settings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.settings__title { font-size: 1.15rem; }

.settings__body { padding: 8px 20px; overflow-y: auto; }
/* Etiket panelinde (ekle/düzenle) Sil/İptal/Kaydet butonlarını panelin en altına sabitle */
#tagPanelBody { flex: 1 0 auto; display: flex; flex-direction: column; }
#tagPanelBody .eform__actions { margin-top: auto; }

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.setting:last-child { border-bottom: none; }
.setting__info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.setting__label { font-size: 0.95rem; font-weight: 500; }
.setting__desc { font-size: 0.78rem; color: var(--text-muted); }
.setting__control { flex-shrink: 0; max-width: 55%; }

/* Aç/kapa anahtarı */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border); border-radius: 24px;
  transition: background 0.15s ease;
}
.switch__slider::before {
  content: ""; position: absolute;
  height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch__slider { background: var(--accent); }
.switch input:checked + .switch__slider::before { transform: translateX(20px); }

@media (max-width: 640px) {
  .app { padding: 10px 12px; }
  .toolbar__title { min-width: auto; font-size: 1.15rem; }
}

/* ============ BİLDİRİMLER (toast) ============ */
/* Ekranın üst-ortasında belirir; ekleme/düzenleme/silme sonrası kısa süre görünür. */
.toasts {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast--in { opacity: 1; transform: translateY(0); }
.toast--add    { background: #16a34a; }   /* ekleme — yeşil */
.toast--edit   { background: #2563eb; }   /* düzenleme — mavi */
.toast--delete { background: #dc2626; }   /* silme — kırmızı */

/* ============ İKON SIDEBAR (rail) ============ */
.rail {
  flex: 0 0 56px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 40;
}
/* hertakvim logo (CSS ile çizilen katmanlı kareler) */
.rail__logo { margin-bottom: 6px; cursor: pointer; }
.ht-logo {
  --size: 96px;
  --c1: #312E81; --c2: #4F46E5; --c3: #8B83F5; --c4: #E0DDFF;
  --shadow: rgba(15,12,60,.28);
  position: relative; display: inline-block;
  width: var(--size); height: var(--size); font-size: var(--size); flex: none;
}
.ht-logo i {
  position: absolute; display: block; border-radius: 28%;
  transition: transform .35s cubic-bezier(.2,.85,.25,1);
}
.ht-logo i:nth-child(1) { left:0;   top:0;   width:100%; height:100%; background: var(--c1); }
.ht-logo i:nth-child(2) { left:9%;  top:6%;  width:74%;  height:74%;  background: var(--c2); box-shadow: 0 .035em .09em var(--shadow); }
.ht-logo i:nth-child(3) { left:17%; top:11%; width:49%;  height:49%;  background: var(--c3); box-shadow: 0 .03em .075em var(--shadow); }
.ht-logo i:nth-child(4) { left:25%; top:16%; width:25%;  height:25%;  background: var(--c4); box-shadow: 0 .022em .055em var(--shadow); }

@keyframes ht-logo-in { from { opacity:0; scale:.5 } to { opacity:1; scale:1 } }
.ht-logo--animate i { animation: ht-logo-in .6s cubic-bezier(.2,.85,.25,1) both; }
.ht-logo--animate i:nth-child(1) { animation-delay: 0s }
.ht-logo--animate i:nth-child(2) { animation-delay: .10s }
.ht-logo--animate i:nth-child(3) { animation-delay: .20s }
.ht-logo--animate i:nth-child(4) { animation-delay: .30s }

/* imleç takibi */
.ht-logo--track {
  --px: .375; --py: .285;            /* en üst karenin merkezi = sıfır noktası */
  --fx: calc(var(--px) - .375);
  --fy: calc(var(--py) - .285);
}
.ht-logo--track i {
  transform: translate(calc(var(--fx) * var(--k) * 1em), calc(var(--fy) * var(--k) * 1em));
  transition: transform .55s cubic-bezier(.22,.61,.36,1);
}
.ht-logo--track i:nth-child(1) { --k: .08 }
.ht-logo--track i:nth-child(2) { --k: .22 }
.ht-logo--track i:nth-child(3) { --k: .5 }
.ht-logo--track i:nth-child(4) { --k: 1 }   /* imlecin tam ortasına oturur */
.ht-logo--track.is-tracking i { transition: transform .18s cubic-bezier(.2,.8,.3,1); will-change: transform; }

.ht-logo--flat i { box-shadow: none }

.ht-logo--invert { --c1:#4F46E5; --c2:#6E66EE; --c3:#9E97F8; --c4:#E0DDFF; --shadow: rgba(0,0,0,.45) }

@media (prefers-reduced-motion: reduce) {
  .ht-logo--animate i { animation: none }
  .ht-logo i { transition: none }
  .ht-logo--track i { transform: none }
}
.rail__btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.rail__btn svg { width: 22px; height: 22px; }
.rail__btn:hover { background: var(--surface-alt); color: var(--text); }
.rail__btn--active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

/* Çalışma alanları (workspace) — rail'de hesap ikonunun hemen üstünde */
.rail__ws {
  margin-top: auto;            /* kendini + altındaki hesap butonunu rail'in altına yasla */
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding-bottom: 8px; margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.rail__wsbtn {
  width: 34px; height: 34px; flex: none;
  border: none; border-radius: 9px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.rail__wsbtn:hover { transform: scale(1.06); }
.rail__wsbtn--active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.rail__wsadd {
  width: 34px; height: 34px; flex: none;
  border: 1px dashed var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.05rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.rail__wsadd:hover { background: var(--surface-alt); color: var(--accent); border-color: var(--accent); }

/* Pano (dashboard) sayfası */
.dash { max-width: 980px; margin: 0 auto; padding: 40px 28px 60px; display: flex; flex-direction: column; gap: 20px; }
.dash__header { display: flex; flex-direction: column; gap: 4px; }
.dash__title { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.dash__sub { font-size: 0.9rem; color: var(--text-muted); }
.dash__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dash__stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.dash__statnum { font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.dash__statlabel { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.dash__statsub { font-size: 0.75rem; color: var(--text-muted); }
.dash__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dash__card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.dash__cardtitle { font-size: 0.98rem; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.dash__empty { color: var(--text-muted); font-size: 0.85rem; padding: 6px 2px; }

/* Etkinlik satırı (Bugün / Yaklaşan) */
.dash__ev {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 9px 8px; border: none; background: transparent; border-radius: 8px;
  cursor: pointer; text-align: left; color: var(--text);
}
.dash__ev:hover { background: var(--surface-alt); }
.dash__ev + .dash__ev { border-top: 1px solid var(--border); }
.dash__evdot { width: 9px; height: 9px; flex: none; border-radius: 50%; margin-top: 5px; }
.dash__evbody { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.dash__evtitle { font-size: 0.88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash__evmeta { font-size: 0.76rem; color: var(--text-muted); }

/* Görevler kartı */
.dash__taskcounts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dash__taskcount {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.8rem;
}
.dash__tdot { width: 9px; height: 9px; flex: none; border-radius: 50%; }
.dash__tnum { font-weight: 700; color: var(--text); }
.dash__tlabel { color: var(--text-muted); }
.dash__tasklist { display: flex; flex-direction: column; }
.dash__task {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px; border: none; background: transparent; border-radius: 8px;
  cursor: pointer; text-align: left; color: var(--text); font-size: 0.86rem;
}
.dash__task:hover { background: var(--surface-alt); }
.dash__task + .dash__task { border-top: 1px solid var(--border); }
.dash__taskname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Etiket dağılımı */
.dash__tagrow { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.dash__tagbadge {
  flex: 0 0 auto; max-width: 130px; font-size: 0.74rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash__barwrap { flex: 1; height: 8px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.dash__bar { height: 100%; border-radius: 999px; }
.dash__tagn { flex: none; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); min-width: 20px; text-align: right; }

@media (max-width: 720px) {
  .dash__stats { grid-template-columns: repeat(2, 1fr); }
  .dash__grid { grid-template-columns: 1fr; }
}

/* Çalışma alanı ayarları SAYFASI (profil sayfası stillerini paylaşır) */
#wspDetail { display: flex; flex-direction: column; gap: 20px; }
/* Kart başlığı (başlık + açıklama solda, eylem düğmesi sağda) */
.wsp__cardhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wsp__cardhead-text { min-width: 0; }
.wsp__cardhead-text .profile__cardtitle { margin: 0 0 4px; }
.wsp__cardhead-text .wsp__hint { margin: 0; }
.wsp__cardhead .btn { flex: none; }
.wsp__selectorwrap { display: flex; flex-direction: column; gap: 10px; }
.wsp__selector { display: flex; flex-wrap: wrap; gap: 8px; }
.wsp__chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.wsp__chip:hover { border-color: var(--accent); }
.wsp__chip--on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.wsp__chipav {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.68rem; font-weight: 600;
}
.wsp__chipname { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsp__chipbadge {
  font-size: 0.64rem; font-weight: 600; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  padding: 2px 7px; border-radius: 999px;
}
.wsp__chip--add { padding: 8px 14px; color: var(--text-muted); border-style: dashed; }
.wsp__chip--add:hover { color: var(--accent); }

.wsp__field { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.wsp__field + .wsp__field { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
/* Genel kartı: Ad + Renk aynı satırda */
.wsp__row { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.wsp__row .wsp__field { padding: 6px 0; }
.wsp__row .wsp__field + .wsp__field { border-top: none; padding-top: 6px; margin-top: 0; }
.wsp__field--name { flex: 1 1 200px; min-width: 180px; }
.wsp__field--color { flex: 0 0 auto; }
.wsp__label { font-size: 0.82rem; color: var(--text-muted); }
.wsp__input {
  max-width: 320px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 0.9rem;
}
.wsp__input:focus { outline: none; border-color: var(--accent); }
.wsp__swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.wsp__swatch {
  width: 28px; height: 28px; flex: none;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.wsp__swatch--on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
/* Özel renk: yerel renk seçiciyi saran swatch (seçili değilken gökkuşağı) */
.wsp__swatch--custom {
  position: relative; overflow: hidden;
  background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
}
.wsp__swatch--custom input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: 0; padding: 0;
}
/* Logo alanı: önizleme + yükle/kaldır */
.wsp__field--logo { flex: 0 0 auto; }
.wsp__logorow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wsp__logoprev {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.78rem; font-weight: 600;
}
/* Logo gösterilen workspace avatarları (rail, seçici, başlık, önizleme) */
.ws-logo {
  background-color: #fff !important;
  border: 1px solid var(--border) !important;
  box-sizing: border-box; padding: 3px;
}
.profile__avatar.ws-logo { padding: 12px; }
.wsp__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wsp__actions .btn { min-width: 140px; justify-content: center; }
/* Çalışma alanı ayarları: etiket/renk kartları */
.wsp__hint { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0; }
.wsp__addbtn { margin-top: 2px; align-self: flex-start; }
/* Tablo alanları: salt-okunur sütun listesi (ad + tip) */
/* ---- Tablo alanları modalı (solda liste, sağda ayrıntı/düzenleme) ---- */
.modal__card--wide { width: min(760px, 94vw); padding: 0; display: flex; flex-direction: column; }
.fieldsmodal .modal__title { padding: 20px 24px 12px; margin: 0; border-bottom: 1px solid var(--border); }
.fieldsmodal__body { display: flex; min-height: 340px; max-height: 66vh; }
.fieldsmodal__list {
  flex: 0 0 240px; border-right: 1px solid var(--border);
  overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.fieldsmodal__item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 8px 10px; color: var(--text); cursor: pointer; font-size: 0.9rem;
  transition: background 0.12s ease;
}
.fieldsmodal__item:hover { background: var(--surface-alt); }
.fieldsmodal__item--active { background: var(--surface-alt); border-color: var(--accent); }
.fieldsmodal__itemname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fieldsmodal__itemtype { color: var(--text-muted); font-size: 0.76rem; flex: none; }
.fieldsmodal__badge {
  flex: none; font-size: 0.68rem; color: #fff; background: var(--accent);
  border-radius: 999px; padding: 1px 7px;
}
.fieldsmodal__detail { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 24px; }
.fieldsmodal__eyebrow { display: block; font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.fieldsmodal__name { font-size: 1.3rem; margin: 4px 0 2px; }
.fieldsmodal__type { color: var(--text-muted); font-size: 0.86rem; margin-bottom: 16px; }
.fieldsmodal__meta { margin-bottom: 18px; }
.fieldsmodal__metalabel { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.fieldsmodal__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fieldsmodal__chip {
  font-size: 0.8rem; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px; color: var(--text);
}
.fieldsmodal__add { margin-top: 8px; width: 100%; }
.fieldsmodal__actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.fieldsmodal__edit { border-top: 1px solid var(--border); padding-top: 16px; }
.fieldopt { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.fieldopt__color {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer; padding: 0;
  transition: transform 0.1s ease;
}
.fieldopt__color:hover { transform: scale(1.1); }
.fieldopt__badge {
  color: #fff; font-size: 0.82rem; font-weight: 600;
  border-radius: 999px; padding: 3px 12px;
}
@media (max-width: 640px) {
  .fieldsmodal__body { flex-direction: column; max-height: 76vh; }
  .fieldsmodal__list { flex-basis: auto; max-height: 180px; border-right: none; border-bottom: 1px solid var(--border); }
}

/* Kullanıcı butonu (rail'in en altında yuvarlak avatar) */
.rail__user {
  margin-top: 0;               /* workspace bloğu zaten margin-top:auto ile aşağı yaslıyor */
  width: 38px; height: 38px;
  border: none; padding: 0;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.rail__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #8B83F5));
  color: #fff;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.rail__user:hover .rail__avatar { transform: scale(1.06); }
.rail__user--active .rail__avatar,
.rail__user[aria-expanded="true"] .rail__avatar {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}
/* Misafir (giriş yapılmamış): kullanıcı avatarları içi BOŞ — transparent dolgu, renkli kenarlık,
   renkli baş harf. Giriş yapılınca (body[data-account]) varsayılan dolu stil geçerlidir. */
body:not([data-account]) .rail__avatar,
body:not([data-account]) .usermenu__avatar {
  background: none;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}
/* Profil sayfası avatarı da misafirde içi boş (büyük olduğu için daha kalın kenarlık). */
body:not([data-account]) .profile__avatar {
  background: none;
  border: 3px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}

/* Kullanıcı menüsü (rail'in altından açılan küçük panel) */
.usermenu {
  position: fixed;
  left: 62px; bottom: 12px;
  z-index: 60;
  width: 232px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.28);
  padding: 6px;
  animation: usermenu-in 0.14s ease;
}
.usermenu[hidden] { display: none; }
@keyframes usermenu-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.usermenu__head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.usermenu__avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #8B83F5));
  color: #fff; font-weight: 600; font-size: 0.9rem;
}
.usermenu__id { display: flex; flex-direction: column; min-width: 0; }
.usermenu__name { font-weight: 600; font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usermenu__mail { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usermenu__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  border: none; background: transparent; border-radius: 8px;
  font-size: 0.9rem; color: var(--text);
  cursor: pointer; text-align: left;
}
.usermenu__item svg { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.usermenu__item:hover { background: var(--surface-alt); }
.usermenu__item--danger { color: #dc2626; }
.usermenu__item--danger svg { color: #dc2626; }
.usermenu__item--danger:hover { background: color-mix(in srgb, #dc2626 12%, transparent); }

/* ============ KAYIT / GİRİŞ SAYFASI ============ */
/* Odaklı ekran: rail gizli, kart ortalanmış. */
body[data-page="auth"] .rail { display: none; }
.page-auth {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--bg);
}
.authcard {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.authcard__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 10px;
}
.authcard__brand img { display: block; }
.authcard__title { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.authcard__sub { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 8px; }
.authcard__form { gap: 14px; margin-top: 4px; }
.authcard__submit { width: 100%; justify-content: center; padding: 11px; font-size: 0.95rem; margin-top: 2px; }
.authcard__switch { font-size: 0.9rem; color: var(--text-muted); margin-top: 14px; text-align: center; }
.authcard__switch a { color: var(--accent); font-weight: 600; text-decoration: none; }
.authcard__switch a:hover { text-decoration: underline; }
.authcard__guest { text-align: center; margin-top: 4px; }
.authcard__guest a { color: var(--text-muted); font-size: 0.85rem; text-decoration: none; }
.authcard__guest a:hover { color: var(--text); }

/* ============ PROFİL SAYFASI ============ */
.page-profile { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; background: var(--bg); }
.profile { max-width: 760px; margin: 0 auto; padding: 40px 28px 60px; display: flex; flex-direction: column; gap: 20px; }
.profile__header { display: flex; align-items: center; gap: 20px; }
.profile__avatar {
  width: 84px; height: 84px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #8B83F5));
  color: #fff; font-size: 2rem; font-weight: 600;
  box-shadow: var(--shadow);
}
.profile__ident { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile__name { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.profile__mail { color: var(--text-muted); font-size: 0.92rem; }
.profile__role {
  align-self: flex-start; margin-top: 4px;
  padding: 2px 10px; border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); font-size: 0.78rem; font-weight: 600;
}
.profile__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.profile__stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; text-align: center;
}
.profile__statnum { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.profile__statlabel { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.profile__card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.profile__cardtitle { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.profile__rows { display: flex; flex-direction: column; }
.profile__row {
  display: flex; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border); font-size: 0.92rem;
}
.profile__row:last-child { border-bottom: none; }
.profile__rowlabel { flex: 0 0 40%; color: var(--text-muted); }
.profile__rowval { flex: 1; min-width: 0; color: var(--text); word-break: break-word; }
/* Dil seçici (SVG bayraklı özel açılır menü) */
.lang { position: relative; display: inline-block; }
.lang__toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 150px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 0.9rem;
  cursor: pointer;
}
.lang__toggle:hover { border-color: var(--accent); }
.lang__toggle[aria-expanded="true"] { border-color: var(--accent); }
.lang__flag {
  display: inline-block; flex: none;
  width: 20px; height: 14px;
  border-radius: 3px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}
.lang__flag svg { display: block; width: 100%; height: 100%; }
.lang__name { flex: 1; text-align: left; }
.lang__chev { width: 14px; height: 14px; flex: none; color: var(--text-muted); }
.lang__menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 4px;
  z-index: 50;
  display: flex; flex-direction: column; gap: 2px;
}
.lang__menu[hidden] { display: none; }
.lang__opt {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  border: none; background: transparent;
  color: var(--text); font: inherit; font-size: 0.9rem;
  border-radius: 6px; cursor: pointer; text-align: left;
  white-space: nowrap;
}
.lang__opt:hover { background: var(--surface-alt); }
.lang__opt--on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.profile__promo-lead { font-size: 0.83rem; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; }
.profile__perks { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.profile__perks li {
  position: relative; padding-left: 26px;
  font-size: 0.85rem; color: var(--text); line-height: 1.45;
}
.profile__perks li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent); font-size: 0.72rem; font-weight: 700;
}
.profile__auth {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.profile__auth .btn { flex: 1; min-width: 120px; justify-content: center; }
.profile__hint[hidden] { display: none; }   /* giriş yapılınca gizlenir (display:flex, [hidden]'ı ezmesin) */
.profile__hint {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.profile__hint-icon { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 1px; }
.profile__hint-body { min-width: 0; }
.profile__hint-body strong { display: block; font-size: 0.9rem; color: var(--text); margin-bottom: 4px; }
.profile__hint-body p { font-size: 0.83rem; line-height: 1.5; color: var(--text-muted); }
@media (max-width: 620px) { .profile__stats { grid-template-columns: repeat(2, 1fr); } }

/* ============ EKİBİM (takımlar) — kart tabanlı ============ */
.page-team { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; background: var(--bg); }
.team { display: flex; gap: 24px; max-width: 1120px; margin: 0 auto; padding: 32px 28px 60px; align-items: flex-start; }
.team__side { flex: 0 0 288px; display: flex; flex-direction: column; gap: 14px; }
.team__sidehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.team__sidetitles { min-width: 0; }
.team__sidetitle { font-size: 1.1rem; }
.team__wsname { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.team__newbtn { flex: none; }
.team__adminbadge {
  flex: none; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #8B83F5));
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.team__sharebadge {
  flex: none; font-size: 0.66rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #16a34a, #4ade80);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
/* Paylaşım kartı + toggle */
.team-share { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.team-share__info { min-width: 0; }
.team-share .team-card__title { margin: 0 0 4px; }
.team-share .team-card__hint { margin: 0; }
.team-toggle {
  flex: none; width: 46px; height: 26px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--border); position: relative; transition: background 0.15s ease;
}
.team-toggle--on { background: #16a34a; }
.team-toggle__knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left 0.15s ease;
}
.team-toggle--on .team-toggle__knob { left: 23px; }
/* Rail: paylaşılan çalışma alanları grubu */
.rail__wssep { width: 22px; height: 1px; background: var(--border); margin: 4px auto; }
.rail__wsbtn--shared { box-shadow: 0 0 0 2px color-mix(in srgb, #16a34a 55%, transparent); }
/* Sol liste — ekip kartları */
.team__list { display: flex; flex-direction: column; gap: 8px; }
.team__item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.06s ease;
}
.team__item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 3px 14px rgba(0,0,0,0.12); }
.team__item--active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.team__item:active { transform: translateY(1px); }
.team__itembody { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.team__itemnamerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team__itemname { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team__itemmeta { font-size: 0.78rem; color: var(--text-muted); }
.team__detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.team__empty { color: var(--text-muted); font-size: 0.9rem; padding: 16px; text-align: center; }
/* Kahraman (üst) kart */
.team-hero {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface));
  border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px;
}
.team-hero__info { flex: 1; min-width: 0; }
.team-hero__namerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-hero__name { font-size: 1.5rem; margin: 0; }
.team-hero__meta { font-size: 0.86rem; color: var(--text-muted); margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; }
/* Genel kart (Üyeler / Davetler) */
.team-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px 22px; }
.team-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.team-card__title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 0 0 14px; }
.team-card__head .team-card__title { margin: 0; }
.team-card__hint { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 14px; }
/* Üye satırları */
.team-members { display: flex; flex-direction: column; }
.team-member { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.team-member:first-child { border-top: none; }
.team-member__avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #8B83F5));
  color: #fff; font-size: 0.8rem; font-weight: 600;
}
.team-member__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.team-member__idrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team-member__email { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-member__sub { font-size: 0.76rem; color: var(--text-muted); }
.team-table__you, .team-member__you { flex: none; font-size: 0.66rem; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 7px; }
.team-member__role {
  flex: none; font-size: 0.74rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}
.team-member__role--owner { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.team-member__remove {
  flex: none; width: 30px; height: 30px; border: none; background: transparent; color: var(--text-muted);
  border-radius: 8px; cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.team-member__remove:hover { color: var(--danger, #dc2626); background: var(--surface-alt); }
/* Davet linkleri */
.team-invites { display: flex; flex-direction: column; gap: 12px; }
.team-inv { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-alt); }
.team-inv--expired { opacity: 0.6; }
.team-inv__top { display: flex; align-items: center; gap: 8px; }
.team-inv__link {
  flex: 1; min-width: 0; font-size: 0.82rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.team-inv__copy { flex: none; }
.team-inv__revoke {
  flex: none; width: 30px; height: 30px; border: none; background: transparent; color: var(--text-muted);
  border-radius: 6px; cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.team-inv__revoke:hover { color: var(--danger, #dc2626); background: var(--surface); }
.team-inv__remain { display: inline-block; margin-top: 10px; font-size: 0.78rem; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 999px; padding: 3px 10px; }
.team-inv--expired .team-inv__remain { color: var(--danger, #dc2626); background: color-mix(in srgb, #dc2626 12%, transparent); }
.team-inv__uses { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.team-inv__useslabel { font-size: 0.78rem; color: var(--text-muted); }
.team-inv__use { font-size: 0.78rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
/* Katılım sayfası kalan süre */
.join__remain { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
@media (max-width: 760px) {
  .team { flex-direction: column; }
  .team__side { flex-basis: auto; width: 100%; }
}

/* ============ KİŞİLER SAYFASI (datatable) ============ */
.page-contacts {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  gap: 0;                /* boşluğu sürüklenebilir ayırıcı (sidebar-resizer) sağlar */
  padding: 16px 20px;
}
/* align-items: flex-start → tablo kartı (dtable-wrap) DİKEYDE içeriğe göre boyutlanır (sayfa
   sonuna kadar esnemez); yüksekliği en fazla kullanılabilir alan kadardır (dtable-wrap max-height). */
.tables-main { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: flex-start; }
/* Tablolar sidebar öğeleri (isim butonu + sil) */
.tables-sidebar .sb__item { gap: 2px; }
.sb__table {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.sb__table:hover { background: var(--surface-alt); }
.sb__table--active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-weight: 600;
}
/* ---- Yeni Tablo penceresi (sol: toggle grupları, sağ: mockup önizleme) ---- */
.modal__card--tables { width: min(920px, 96vw); }
.tcnew {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  margin-top: 4px;
}
.tcnew__pane { min-width: 0; display: flex; flex-direction: column; }
.tcnew__pane--picker { gap: 18px; max-height: 56vh; overflow-y: auto; padding-right: 4px; }
.tcnew__pane--preview {
  padding-left: 20px;
  border-left: 1px solid var(--border);
}
.tcnew__cats { display: flex; flex-direction: column; gap: 18px; }
.tcnew__group { display: flex; flex-direction: column; }
.tcnew__heading { font-size: 0.9rem; font-weight: 600; margin: 0 0 8px; }

/* Toggle grupları: tablo / çalışma alanı seçim düğmeleri */
.tcnew__toggles { display: flex; flex-direction: column; gap: 6px; }
.tcnew__toggle {
  display: flex; align-items: center; gap: 8px;
  text-align: left; width: 100%;
  background: var(--surface-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.tcnew__toggle:hover { border-color: var(--accent); }
.tcnew__toggle--active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tcnew__toggle-icon { font-size: 1rem; line-height: 1; }
.tcnew__toggle-name { font-size: 0.88rem; font-weight: 600; flex: 1; min-width: 0; }
.tcnew__toggle-count {
  font-size: 0.72rem; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 1px 8px;
}

/* Sağ sütun: mockup önizleme */
.tcnew__preview { display: flex; flex-direction: column; min-height: 280px; }
.tcnew__preview-empty {
  margin: auto; text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 0.85rem; max-width: 220px;
}
.tcnew__preview-empticon { font-size: 1.8rem; }
.tcnew__preview-head { display: flex; align-items: center; gap: 8px; }
.tcnew__preview-icon { font-size: 1.2rem; line-height: 1; }
.tcnew__preview-title { font-size: 1rem; font-weight: 600; margin: 0; }
.tcnew__preview-sub { font-size: 0.78rem; color: var(--text-muted); margin: 2px 0 0; }
.tcnew__preview-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 12px;
  max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.tcnew__preview-tbl { display: flex; flex-direction: column; gap: 5px; }
.tcnew__preview-tblname { font-size: 0.8rem; font-weight: 600; color: var(--text); }

/* Mockup tablo (önizleme iskeleti) */
.tcmock {
  margin-top: 12px;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface);
}
.tcnew__preview-tbl .tcmock { margin-top: 0; }
.tcmock__row {
  display: grid; grid-auto-columns: 1fr; grid-auto-flow: column;
  border-top: 1px solid var(--border);
}
.tcmock__row:first-child { border-top: none; }
.tcmock__row--head { background: var(--surface-alt); }
.tcmock__cell {
  padding: 7px 10px; font-size: 0.72rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-left: 1px solid var(--border);
}
.tcmock__cell:first-child { border-left: none; }
.tcmock__row--head .tcmock__cell { font-weight: 600; color: var(--text); }
.tcmock__ghost {
  display: block; height: 8px; width: 70%; border-radius: 4px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

/* Alt bölüm: seçili şablon adı + Oluştur */
.tcnew__foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.tcnew__namefield { max-width: 320px; }

@media (max-width: 640px) {
  .tcnew { grid-template-columns: 1fr; gap: 16px; }
  .tcnew__pane--preview { padding-left: 0; border-left: none; padding-top: 16px; border-top: 1px solid var(--border); }
  .tcnew__pane--picker { max-height: none; }
  .tcnew__preview-stack { max-height: none; }
}
.dtable-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  /* Kolon: başlık/araç çubuğu sabit kalır, tablo alanı (dtable-scroll) kalan yüksekliği doldurup
     KENDİ İÇİNDE hem dikey hem YATAY kaydırılır (böylece çok sütun olduğunda sağa kaydırılabilir). */
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* Kart içeriğe göre boyutlanır; yalnızca içerik kullanılabilir alanı aşarsa 100%'e dayanıp
     dtable-scroll KENDİ İÇİNDE kaydırılır. Böylece kısa tabloda kart tablo bitince biter. */
  max-height: 100%;
}
.dtable-header { flex: 0 0 auto; }
/* Tablonun kaydırılabilir görüntü alanı: yatay (çok sütun) + dikey (çok satır) kaydırma burada. */
.dtable-scroll { flex: 1; min-height: 0; overflow: auto; }
.dtable-scroll[hidden] { display: none; }
/* Başlık: araç çubuğu (dtable-bar) ile toplu-seçim çubuğu (dtable-bulk) AYNI hücrede yığılır.
   Böylece toplu seçim çubuğu göründüğünde araç çubuğunu ÜZERİNE biner (tabloyu aşağı itmez). */
.dtable-header { display: grid; }
.dtable-header > .dtable-bar,
.dtable-header > .dtable-bulk { grid-area: 1 / 1; }
.dtable-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.dtable-bar__left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.dtable-bar__right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dtable-bar__left .select { flex-shrink: 0; }
.dtable-bar__left .dtable-search { margin: 0; }
.dtable-search {
  width: 100%;
  max-width: 320px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
}
.dtable-search:focus { outline: none; border-color: var(--accent); }
/* Toplu seçim çubuğu (birden çok kayıt seçilince görünür) */
.dtable-bulk[hidden] { display: none; }   /* seçim yokken gizle (display:flex, [hidden]'ı ezmesin) */
.dtable-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  z-index: 2;   /* araç çubuğunun ÜZERİNDE (aynı grid hücresi) */
}
.dtable-bulk__count { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.dtable-bulk__actions { display: flex; align-items: center; gap: 8px; }

/* Toplu düzenleme paneli satırları: [değiştir kutusu] [alan kontrolü] */
.bulkedit__row { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; }
.bulkedit__toggle { width: 16px; height: 16px; margin-top: 10px; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }
.bulkedit__row > .eform__field, .bulkedit__row > .eform__check { flex: 1; min-width: 0; margin: 0; }
.bulkedit__row--off > .eform__field, .bulkedit__row--off > .eform__check { opacity: 0.45; }
.bulkedit__tags { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.bulkedit__seclabel { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }

/* Seçim onay kutusu sütunu */
.dtable__th--check, .dtable__td--check { width: 1%; text-align: center; padding-right: 6px; padding-left: 16px; }
.dtable__th--check { cursor: default; }
.dtable__check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); vertical-align: middle; }
.dtable__row--selected .dtable__td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* table-layout: fixed + width:100% → sütunlar konteynere SIĞAR (yatay kaydırma yok); genişlikler
   JS'te (layoutHeaderColumns) th'lere yazılır. Bir sütun büyürse komşusu daralır, toplam sabit.
   İçerik sütuna sığmazsa hücrede "…" ile kesilir; başlıklar (min genişlik) kesilmez. */
.dtable {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  /* Yoğunluk (Ayarlar → Tablo boyutu): font + hücre padding CSS değişkenlerinden. Varsayılan = Orta. */
  font-size: var(--dtable-fs, 0.9rem);
}
.dtable[data-size="sm"] { --dtable-fs: 0.8rem;  --dtable-pad-th: 7px 12px;  --dtable-pad-td: 5px 12px; }
.dtable[data-size="lg"] { --dtable-fs: 1rem;    --dtable-pad-th: 15px 18px; --dtable-pad-td: 14px 18px; }
.dtable__th {
  text-align: left;
  padding: var(--dtable-pad-th, 12px 16px);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* sticky: başlık satırı dikey kaydırmada üstte sabit kalır; ayrıca resize tutamacı için
     konumlanma bağlamı oluşturur (absolute child) */
  position: sticky; top: 0; z-index: 3;
  background: var(--surface);
}
.dtable__th:hover { color: var(--text); }
.dtable__th--sorted { color: var(--accent); }
.dtable__arrow { margin-left: 6px; font-size: 0.68rem; }
/* Sütun yeniden boyutlandırma tutamacı: başlığın sağ kenarında ince, sürüklenebilir şerit */
.dtable__resize {
  position: absolute; top: 0; right: 0; width: 8px; height: 100%;
  cursor: col-resize; user-select: none;
  z-index: 4;
}
.dtable__resize::after {
  content: ""; position: absolute; top: 25%; right: 3px; width: 2px; height: 50%;
  background: var(--border); border-radius: 2px;
}
.dtable__resize:hover::after, .dtable__resize--active::after { background: var(--accent); }
.dtable__td {
  padding: var(--dtable-pad-td, 11px 16px);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dtable tbody tr:last-child .dtable__td { border-bottom: none; }
.dtable tbody tr:hover { background: var(--surface-alt); }
/* Seçim (onay kutusu) sütunu: dar sabit hücre; içeriğine "…" ELLİPSİS EKLENMEZ, taşma kırpılmaz.
   Yatay padding sıfır + ortalama → onay kutusu 46px'e tam sığar (base .dtable__td/th'ı ezmek için
   bu kural base kurallardan SONRA gelir). */
.dtable__th--check, .dtable__td--check {
  overflow: visible;
  text-overflow: clip;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}
/* Etkinlik tablosunda etiket rozetleri */
.dtable__tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 0.75rem; line-height: 1.4; margin-right: 4px;
}
.dtable__row { cursor: pointer; }
/* Tıkla-seç satır: tekli/çoklu(Ctrl)/aralık(Shift); çift tık = detay. Metin seçimini engelle. */
.dtable__row--sel { cursor: pointer; user-select: none; }
/* Parent-child ağaç: ilk hücrede girinti + aç/kapa üçgeni */
.dtable__tree { display: inline-flex; align-items: center; vertical-align: middle; margin-right: 4px; }
.dtable__chev {
  width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text-muted); font-size: 0.7rem; line-height: 1; border-radius: 4px;
}
.dtable__chev:hover { color: var(--accent); background: var(--surface-alt); }
.dtable__chev--spacer { cursor: default; }
.dtable__chev--spacer:hover { background: none; }
/* Başlık metni (ağaç girintisiyle hizalı) — satır tıklaması seçer, çift tık detay açar */
.dtable__titletext { vertical-align: middle; }
/* Başlık metni: tıklayınca kaydı görüntüle (satır seçiminden ayrı) */
.dtable__titletext--link { cursor: pointer; }
.dtable__titletext--link:hover { text-decoration: underline; text-underline-offset: 2px; color: var(--accent); }
/* Bağlantı kartındaki parent/child rozeti (Üst/Alt) */
.relsec__rel {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 20px;
  font-size: 0.68rem; font-weight: 600; color: #fff; background: var(--accent);
}
/* Toplam satırı (tfoot): sayısal sütunların toplamı */
.dtable__row--total { cursor: default; }
.dtable tfoot .dtable__td {
  border-top: 2px solid var(--border);
  border-bottom: none;
  font-weight: 600;
  background: var(--surface-alt);
}
.dtable__td--totallabel { color: var(--text-muted); font-weight: 600; }
.dtable__td--totalval { color: var(--text); }
.dtable-empty { text-align: center; color: var(--text-muted); padding: 24px; }

/* Görünüm geçişi (Tablo / Zaman Çizelgesi) — segment kontrolü */
.view-toggle[hidden] { display: none; }
.view-toggle {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  flex-shrink: 0;
}
.view-toggle__btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.view-toggle__btn:hover:not(:disabled) { color: var(--text); }
.view-toggle__btn--active { background: var(--accent); color: #fff; }
.view-toggle__btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Zaman çizelgesi (Gantt) — tam yıl, haftalık ızgara */
.timeline[hidden] { display: none; }
.timeline { flex: 1; min-height: 0; overflow: auto; }
.timeline__empty { text-align: center; color: var(--text-muted); padding: 32px 16px; }
.timeline__inner { --tl-label: 190px; min-width: calc(var(--tl-label) + var(--tl-track)); }
.timeline__row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.timeline__row:last-child { border-bottom: none; }

/* Yıl gezinme araç çubuğu (satır tam genişlikte; iç kapsayıcı sola sabit) */
.timeline__toolbar {
  border-bottom: 1px solid var(--border);
}
.timeline__toolinner {
  position: sticky;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  width: max-content;
}
.timeline__navbtn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 7px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.timeline__navbtn:hover { border-color: var(--accent); color: var(--accent); }
.timeline__year { font-size: 0.95rem; font-weight: 700; color: var(--text); min-width: 52px; text-align: center; }
.timeline__todaybtn {
  margin-left: 6px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}
.timeline__todaybtn:hover { border-color: var(--accent); color: var(--accent); }

.timeline__label {
  width: var(--tl-label);
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.timeline__label--head { color: var(--text-muted); font-weight: 600; z-index: 4; }

/* Eksen (ay/hafta başlıkları ve satır izi ortak koordinat alanı) */
.timeline__axis {
  position: relative;
  flex-shrink: 0;
  width: var(--tl-track);
  height: 30px;
}
.timeline__month {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
  border-left: 1px solid var(--border);
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
}
.timeline__row--weeks .timeline__axis { height: 24px; }
.timeline__week {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  box-sizing: border-box;
  overflow: hidden;
}
/* Ay modu: gün başlık hücreleri (haftanın günü + gün numarası) */
.timeline__axis--days { height: 40px; }
.timeline__day {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-left: 1px solid var(--border);
  box-sizing: border-box;
  overflow: hidden;
}
.timeline__daywd { font-size: 0.58rem; color: var(--text-muted); text-transform: none; }
.timeline__daynum { font-size: 0.78rem; font-weight: 700; color: var(--text); }
.timeline__day--wknd { background: color-mix(in srgb, var(--text-muted) 12%, transparent); }
.timeline__day--today .timeline__daynum {
  background: var(--accent); color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Ölçek geçişi (Yıl / Ay) — küçük segment kontrolü */
.timeline__scale {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  margin-right: 4px;
}
.timeline__scalebtn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
}
.timeline__scalebtn:hover { color: var(--text); }
.timeline__scalebtn--active { background: var(--accent); color: #fff; }
.timeline__notecell { padding: 14px; color: var(--text-muted); font-size: 0.85rem; }
.timeline__track {
  position: relative;
  flex-shrink: 0;
  width: var(--tl-track);
  height: 40px;
  /* haftalık dikey ızgara çizgileri (Pazartesi hizalı) */
  background-image: repeating-linear-gradient(
    to right,
    var(--border) 0, var(--border) 1px,
    transparent 1px, transparent var(--tl-week)
  );
}
.timeline__bar {
  position: absolute;
  top: 8px;
  height: 24px;
  background: var(--accent);
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow);
  transition: filter 0.12s ease;
}
.timeline__bar:hover { filter: brightness(1.08); }
.timeline__bar--prog { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.timeline__bar--prog .timeline__cap { color: var(--text); }
.timeline__bar--done { background: #16a34a; }
.timeline__bar--done.timeline__bar--prog { background: color-mix(in srgb, #16a34a 30%, transparent); }
.timeline__fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 6px 0 0 6px;
}
.timeline__bar--done .timeline__fill { background: #16a34a; }
.timeline__cap {
  position: relative;
  z-index: 1;
  padding: 0 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.timeline__today {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: #dc2626;
  z-index: 1;
  pointer-events: none;
}

/* Oluşturma şeridi: hover edilebilen hafta hücreleri + sürükleyerek çoklu seçim */
.timeline__row--new { border-top: 1px solid var(--border); }
/* "Yeni kayıt" satırı son satır olsa da alt kenarlığı korunur */
.timeline__row--new:last-child { border-bottom: 1px solid var(--border); }
.timeline__label--new { color: var(--accent); font-weight: 600; }
.timeline__track--new { height: 34px; cursor: cell; }
.timeline__wcell {
  position: absolute;
  top: 0; bottom: 0;
  box-sizing: border-box;
  border-left: 1px solid var(--border);
}
.timeline__wcell:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.timeline__wcell--sel { background: color-mix(in srgb, var(--accent) 34%, transparent); }

/* Zaman çizelgesi tooltip'i (çubuğun tam adı) */
.timeline__tip {
  position: fixed;
  z-index: 9999;
  max-width: 320px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  pointer-events: none;
}
.timeline__tip[hidden] { display: none; }
.timeline__tiptitle { font-weight: 700; white-space: normal; }
.timeline__tipsub { color: var(--text-muted); font-size: 0.76rem; margin-top: 2px; }

/* Satır aksiyonları (Görüntüle / Düzenle / Sil) — HER ZAMAN sağda SABİT (sticky-right).
   Yatay kaydırmada sütunlar bunun ALTINDAN kayar; butonlar hep görünür kalır. Genişliği
   sabittir (JS'te tutamaç eklenmez). Opak arka plan, altından kayan içeriği gizler. */
.dtable__td--actions {
  white-space: nowrap; text-align: right;
  position: sticky; right: 0; z-index: 2;
  background: var(--surface);
}
/* Başlıktaki işlemler hücresi: hem üstte (sticky top, .dtable__th'ten) hem sağda sabit */
.dtable__th--actions {
  right: 0; z-index: 5;
  cursor: default;
}
/* Sticky hücre kendi opak zeminini boyadığı için satır hover/seçim renklerini AYRICA uygula */
.dtable tbody tr:hover .dtable__td--actions { background: var(--surface-alt); }
.dtable__row--selected .dtable__td--actions { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.dtable tfoot .dtable__td--actions { background: var(--surface-alt); }
.dtable__act {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.dtable__act + .dtable__act { margin-left: 6px; }
.dtable__act:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.dtable__act--danger:hover { border-color: #dc2626; color: #dc2626; }
/* Satır işlem menüsü düğmesi (⋮) — kenarlıksız, ortalanmış */
.dtable__kebab {
  border: none; background: none; padding: 2px 6px;
  font-size: 1.05rem; line-height: 1; color: var(--text-muted); border-radius: 6px;
}
.dtable__kebab:hover { background: var(--surface-alt); color: var(--text); }
/* Açılır işlem menüsü (fixed, body'ye eklenir → tablo overflow'undan etkilenmez) */
.kebab {
  position: fixed; z-index: 1000; min-width: 130px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28); padding: 4px; display: flex; flex-direction: column;
}
.kebab__item {
  text-align: left; background: none; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 7px; font-size: 0.88rem; color: var(--text);
}
.kebab__item:hover { background: var(--surface-alt); }
.kebab__item--danger { color: #dc2626; }
.kebab__item--danger:hover { background: color-mix(in srgb, #dc2626 12%, transparent); }

/* Kişi formundaki ilişki bölümleri (ör. Randevular) */
.relsec { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.relsec__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.relsec__title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.relsec__list { display: flex; flex-direction: column; gap: 6px; }
.relsec__item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.relsec__itembtn {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.relsec__itembtn:hover { color: var(--accent); }
.relsec__del {
  flex-shrink: 0;
  width: 30px;
  align-self: stretch;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}
.relsec__del:hover { color: #dc2626; }
.relsec__empty { color: var(--text-muted); font-size: 0.82rem; padding: 4px 2px; }
/* Bağlantı öğesi metni (tablo etiketi + kayıt adı) */
.relsec__text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.relsec__tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 4px;
  padding: 1px 6px;
}
.relsec__item--ro { opacity: 0.85; }

/* Kayıt görüntüleme (salt-okunur detay) paneli */
.viewbody { padding: 4px 0 8px; }
.view-actions { padding: 12px 0 20px; }
.viewfields { display: flex; flex-direction: column; }
.viewrow {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.viewrow:last-child { border-bottom: none; }
.viewrow__label { flex: 0 0 40%; color: var(--text-muted); }
.viewrow__val { flex: 1; min-width: 0; color: var(--text); word-break: break-word; }
/* HTML (zengin metin) alanı: etiket üstte, render'lı içerik altında tam genişlikte */
.viewrow--html { flex-direction: column; gap: 6px; }
.viewrow__val--html { flex: none; line-height: 1.5; }
.viewrow__val--html img { max-width: 100%; height: auto; border-radius: 6px; }
.viewrow__val--html table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.viewrow__val--html td, .viewrow__val--html th { border: 1px solid var(--border); padding: 4px 8px; }
.viewrow__val--html a { color: var(--accent); }
.viewrow__val--html p, .viewrow__val--html div, .viewrow__val--html ul, .viewrow__val--html ol { margin: 0 0 6px; }
.viewrow__val--html :last-child { margin-bottom: 0; }
/* Tarih satırındaki "Takvime ekle" düğmesi / "Takvimde" göstergesi */
.viewrow__cal {
  flex-shrink: 0; align-self: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--accent); border-radius: 7px;
  padding: 3px 9px; font-size: 0.78rem; font-weight: 500; cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.viewrow__cal:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.viewrow__cal--done { color: #16a34a; border-color: color-mix(in srgb, #16a34a 45%, var(--border)); cursor: default; }
.viewempty { color: var(--text-muted); font-size: 0.85rem; padding: 6px 0; }
/* Bölümler (Bağlantılar vb.) sol boşluğunu korur; içerik yine de eski yerinde kalır */
.viewsec { margin-top: 14px; padding-top: 12px; padding-left: 24px; }
.viewsec__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.viewsec__title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.viewsec__head .viewsec__title { margin-bottom: 0; }
/* Başlık başına küçük nokta simgesi */
.viewsec__title::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}
/* Yorumlar (detay panellerinde) */
.commentsec__list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.comment {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px 6px;
}
.comment__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment__avatar {
  width: 24px; height: 24px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #8B83F5));
  color: #fff; font-weight: 600; font-size: 0.68rem;
}
.comment__who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.comment__author { font-weight: 600; font-size: 0.8rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment__time { font-size: 0.72rem; color: var(--text-muted); }
.comment__body {
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment__del {
  flex: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 1px 6px;
  border-radius: 5px;
  opacity: 0;
}
.comment:hover .comment__del { opacity: 1; }
.comment__del:hover { color: #dc2626; background: color-mix(in srgb, #dc2626 12%, transparent); }
.commentsec__form { display: flex; align-items: flex-end; gap: 8px; }
.commentsec__input {
  flex: 1;
  min-width: 0;
  resize: vertical;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.commentsec__input:focus { outline: none; border-color: var(--accent); }
.commentsec__add { flex-shrink: 0; }

.viewcard__headrow { display: flex; align-items: center; gap: 4px; }
.viewcard__headrow .viewcard__head { flex: 1; min-width: 0; }
.viewcard__headrow .relsec__del { align-self: center; border-left: none; }
.viewline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 2px;
  font-size: 0.85rem;
  color: var(--text);
}
.viewline--btn { width: 100%; background: transparent; border: none; text-align: left; cursor: pointer; border-radius: 6px; }
.viewline--btn:hover { background: var(--surface-alt); }
/* Bağlı kaydın detay kartı */
.viewcard {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 12px 10px;
  margin-bottom: 10px;
}
.viewcard__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 0 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.viewcard__head:hover { color: var(--accent); }
/* Katlanabilir bağlantı kartı: ok + başlık metni + detay */
.viewcard__chev {
  flex: 0 0 auto; font-size: 0.7rem; color: var(--text-muted);
  transition: color 0.15s ease;
}
.viewcard__head:hover .viewcard__chev { color: var(--accent); }
.viewcard__headtext { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.viewcard__details { padding-bottom: 4px; }
.viewcard:not(.viewcard--open) { padding-bottom: 4px; }
.viewcard__open {
  margin-top: 8px; background: transparent; border: none; padding: 0;
  color: var(--accent); font: inherit; font-size: 0.8rem; cursor: pointer;
}
.viewcard__open:hover { text-decoration: underline; }
.viewcard .viewrow { border-bottom-color: color-mix(in srgb, var(--border) 60%, transparent); }

/* Ayarlar paneli (Tablo + Sütunlar bölümleri) */
.setpanel__section { border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 6px; }
.setpanel__section:last-child { border-bottom: none; }
.setpanel__head {
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin: 0; padding: 4px 20px 8px;
}
.setpanel__body { padding: 0 20px 8px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setrow__label { font-size: 0.9rem; color: var(--text); }
/* Segment kontrolü (Küçük / Orta / Büyük) */
.seg { display: inline-flex; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg__btn {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 0.82rem; font-weight: 600; padding: 5px 12px; border-radius: 6px; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.seg__btn:hover { color: var(--text); }
.seg__btn--active { background: var(--accent); color: #fff; }

/* Sütun seçimi paneli */
.colhint { color: var(--text-muted); font-size: 0.82rem; padding: 0 20px 4px; }
.colopts { display: flex; flex-direction: column; padding: 4px 12px 20px; }
.colopt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--surface);
}
.colopt:hover { background: var(--surface-alt); }
.colopt--dragging { opacity: 0.5; background: var(--surface-alt); }
.colopt__grip { cursor: grab; color: var(--text-muted); font-size: 1rem; line-height: 1; user-select: none; }
.colopt__grip:active { cursor: grabbing; }
.colopt__label { display: flex; align-items: center; gap: 8px; flex: 1; }
.colopt__tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ============ TOOLTIP (Bootstrap benzeri, hover anında) ============ */
/* [data-tooltip] taşıyan öğe hover edildiği anda altında balon + ok gösterir. */
[data-tooltip] { position: relative; }
[data-tooltip]::after {                     /* balon */
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #21252b;
  color: #fff;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 1100;
}
[data-tooltip]::before {                    /* yukarı bakan ok */
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #21252b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 1100;
}
[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::after,
[data-tooltip]:focus-visible::before {
  opacity: 1;
}

/* Rail tooltip'leri: aşağı yerine sağa doğru açılır */
.rail [data-tooltip]::after {
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
}
.rail [data-tooltip]::before {
  top: 50%;
  left: calc(100% + 4px);
  transform: translateY(-50%);
  border-color: transparent;
  border-right-color: #21252b;
}

/* ============ KENAR ÇUBUĞU (çoklu takvim) ============ */
.app__main { flex: 1; min-height: 0; display: flex; gap: 0; }

/* Sidebar ile takvim arasındaki sürüklenebilir ayırıcı (gap yerine geçer) */
.sidebar-resizer {
  flex: 0 0 12px;
  align-self: stretch;
  cursor: col-resize;
  position: relative;
  touch-action: none;
}
.sidebar-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 44px;
  max-height: 60%;
  border-radius: 3px;
  background: var(--border);
  transition: background 0.15s, height 0.15s;
}
.sidebar-resizer:hover::before,
.sidebar-resizer.resizing::before { background: var(--accent); height: 72px; }
.sidebar-resizer:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
body.resizing-sidebar { cursor: col-resize; user-select: none; }

/* Görev bırakınca hedef takvim seçici (imleç yanında açılan menü) */
.calpicker {
  position: fixed;
  z-index: 200;
  min-width: 190px;
  max-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: calpickerIn 0.12s ease-out;
}
@keyframes calpickerIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.calpicker__head {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 4px 8px 6px;
}
.calpicker__item {
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.86rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calpicker__item:hover,
.calpicker__item:focus-visible { background: var(--surface-alt); color: var(--accent); outline: none; }
.calpicker__cancel {
  margin-top: 2px;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  cursor: pointer;
  padding: 7px 10px 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: left;
  border-radius: 0 0 6px 6px;
}
.calpicker__cancel:hover { color: var(--text); }

.sidebar {
  width: 172px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
  overflow-y: auto;
}
.sidebar__head {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 2px 4px 8px;
}
/* İkinci grup başlığı (Tablolar), Takvimler listesinden sonra biraz boşluklu */
.sidebar__head--sub { margin-top: 14px; }
.sidebar__list { display: flex; flex-direction: column; gap: 1px; }
.sb__empty { color: var(--text-muted); font-size: 0.82rem; padding: 2px 4px; }
.sb__item { display: flex; align-items: center; border-radius: 6px; }
.sb__item:hover { background: var(--surface-alt); }
/* Sürükle-bırak ile yeniden sıralama */
.sb__item--drag { cursor: grab; }
.sb__item--drag:active { cursor: grabbing; }
.sb__item--dragging { opacity: 0.5; background: var(--surface-alt); cursor: grabbing; }
/* Zorunlu tabloları (Etkinlikler / Görevler) sürüklenebilir tablolardan ayıran çizgi */
.sb__sep { height: 1px; background: var(--border); margin: 6px 4px; }
.sb__cal {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 4px;
  overflow: hidden;
}
.sb__check { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.sb__name { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 5px;
  opacity: 0;
  flex-shrink: 0;
}
.sb__item:hover .sb__del { opacity: 1; }
.sb__del:hover { color: #dc2626; background: color-mix(in srgb, #dc2626 12%, transparent); }
/* Kilitli (yerleşik, silinemez) tablo göstergesi — tek renk (currentColor) */
.sb__lock {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  color: var(--text-muted);
  opacity: 0.7;
  cursor: default;
  user-select: none;
}
.sb__lock svg { display: block; }
.sidebar__newbtn {
  margin-top: 6px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  padding: 7px 4px;
  border-radius: 6px;
}
.sidebar__newbtn:hover { background: var(--surface-alt); }
.sidebar__form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sidebar__form[hidden] { display: none; }   /* [hidden]'ı display:flex ezmesin */
.sidebar__input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
}
.sidebar__input:focus { outline: none; border-color: var(--accent); }
.sidebar__add { padding: 6px 10px; font-size: 0.82rem; }
.sidebar__formbtns { display: flex; gap: 6px; }
.sidebar__formbtns .sidebar__add { flex: 1; }
.sidebar__cancel { flex: 1; padding: 6px 10px; font-size: 0.82rem; }

/* Kenar çubuğu sekmeleri (Takvimler / Görevler) */
.sidebar__tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  margin-bottom: 8px;
  background: var(--surface-alt);
  border-radius: 8px;
}
.sidebar__tab {
  flex: 1;
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}
.sidebar__tab:hover { color: var(--text); }
.sidebar__tab--active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.sidebar__panel { display: flex; flex-direction: column; gap: 1px; }
.sidebar__panel[hidden] { display: none; }
.sidebar__hint {
  margin-top: 8px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
  padding: 0 4px;
}

/* Görev öğesi (kenar çubuğunda; sürüklenebilir) */
.task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 6px;
  cursor: grab;
  user-select: none;
}
.task-item:hover { background: var(--surface-alt); }
.task-item:active { cursor: grabbing; }
.task-item--dragging { opacity: 0.5; }
/* Etkinliği oluşturulmuş görev: sürüklenemez (tekrar etkinlik yaratılamaz) */
.task-item--scheduled { cursor: pointer; }
.task-item--scheduled:active { cursor: pointer; }
.task-item__check {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.task-item__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-item__name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-item--done .task-item__name {
  text-decoration: line-through;
  color: var(--text-muted);
}
.task-item__sched {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  padding: 3px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 0;
}
.task-item__sched svg { width: 14px; height: 14px; display: block; }
.task-item__sched:hover { color: var(--accent); background: var(--surface); }
.task-item__sched:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.task-item__edit {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 2px 6px;
}
.task-item__edit:focus { outline: none; }

/* ============ DEFTER SAYFASI (not sayfaları + metin editörü) ============ */
.page-notebook {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  gap: 0;                /* boşluğu sürüklenebilir ayırıcı (sidebar-resizer) sağlar */
  padding: 16px 20px;
}
.page-notebook[hidden] { display: none; }
.notebook-sidebar { width: 210px; }
.notebook-sidebar .sb__item { gap: 2px; }
.notebook-main { flex: 1; min-width: 0; min-height: 0; display: flex; }

.nb-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.nb-wrap[hidden] { display: none; }

/* Araç çubuğu */
.nb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.nb-group { display: flex; align-items: center; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--border); }
.nb-group:last-child { border-right: none; }
.nb-btn {
  position: relative;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: Georgia, "Times New Roman", serif;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.nb-btn:hover { background: var(--surface-alt); }
.nb-btn--on { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.nb-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nb-btn:focus-visible, .nb-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nb-select {
  height: 30px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}
/* Renk seçiciler: yerel <input type=color> görünmez, düğme + renk şeridi gösterilir */
.nb-color { flex-direction: column; gap: 1px; padding-top: 3px; }
.nb-color__a { font-weight: 700; line-height: 1; font-family: Georgia, "Times New Roman", serif; }
.nb-color svg { width: 15px; height: 15px; }
.nb-color__bar { width: 16px; height: 3px; border-radius: 2px; }
.nb-color input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: none; padding: 0; }

/* Kâğıt alanı: gri zemin üzerinde A4 genişliğinde sayfa */
.nb-canvas {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: color-mix(in srgb, var(--surface-alt) 70%, var(--bg));
  padding: 28px 24px 48px;
}
.nb-sheet {
  width: 100%;
  max-width: 794px;          /* A4 (210 mm) ≈ 794 px */
  min-height: 1000px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  padding: 64px 76px 96px;
  cursor: text;
}
.nb-title {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.nb-title::placeholder { color: var(--text-muted); opacity: 0.6; }

.nb-editor {
  position: relative;        /* placeholder (::before) editöre göre konumlanır → kaydırmayla birlikte hareket eder */
  outline: none;
  min-height: 720px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.nb-editor--empty::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 0;
  left: 0;
  color: var(--text-muted);
  opacity: 0.6;
  pointer-events: none;
}
.nb-editor > :first-child { margin-top: 0; }
.nb-editor p, .nb-editor div { margin: 0 0 0.55em; }
.nb-editor h1 { font-size: 1.7rem; line-height: 1.3; margin: 1.1em 0 0.45em; }
.nb-editor h2 { font-size: 1.35rem; line-height: 1.35; margin: 1em 0 0.4em; }
.nb-editor h3 { font-size: 1.12rem; line-height: 1.4; margin: 0.9em 0 0.35em; }
.nb-editor ul, .nb-editor ol { margin: 0 0 0.6em; padding-left: 1.6em; }
.nb-editor li { margin: 0.15em 0; }
.nb-editor blockquote {
  margin: 0.4em 0 0.8em;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}
.nb-editor pre {
  margin: 0.4em 0 0.8em;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.nb-editor code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.nb-editor a { color: var(--accent); text-decoration: underline; cursor: text; }
.nb-editor hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }
/* Yapılacaklar listesi: madde işareti yerine tıklanabilir kutu */
.nb-editor ul[data-checklist] { list-style: none; padding-left: 0.2em; }
.nb-editor ul[data-checklist] > li { position: relative; padding-left: 28px; }
.nb-editor ul[data-checklist] > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.38em;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}
.nb-editor ul[data-checklist] > li[data-checked="true"]::before {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-color: var(--accent);
}
.nb-editor ul[data-checklist] > li[data-checked="true"] { color: var(--text-muted); text-decoration: line-through; }

.nb-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.nb-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.nb-empty[hidden] { display: none; }

@media (max-width: 760px) {
  .page-notebook { flex-direction: column; height: auto; min-height: 100vh; padding: 12px; gap: 12px; }
  .page-notebook .sidebar-resizer { display: none; }
  .notebook-sidebar { width: 100% !important; max-height: 180px; }
  .nb-canvas { padding: 12px 8px 24px; }
  .nb-sheet { padding: 28px 22px 48px; min-height: 0; }
  .nb-editor { min-height: 360px; }
}
