/* ============================================================
   Layout — App shell (topbar + sidebar + main), page header, filters
   ============================================================ */

/* App grid (shell) */
.app {
  display: grid;
  grid-template-columns: 188px 1fr 0px;
  grid-template-rows: 48px 1fr;
  grid-template-areas:
    "sidebar topbar  drawer"
    "sidebar main    drawer";
  height: 100vh;
  transition: grid-template-columns .24s cubic-bezier(.4,0,.2,1);
}
.app.drawer-open {
  grid-template-columns: 188px 1fr 540px;
}
/* Slide prompt away when drawer opens */
.ai-prompt {
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
.app.drawer-open ~ .ai-prompt {
  transform: translateY(160%);
  opacity: 0;
  pointer-events: none;
}
body.modal-open .ai-prompt {
  transform: translateY(160%);
  opacity: 0;
  pointer-events: none;
}

/* ───────── Window tab strip (moved into topbar) ───────── */
.tabbar { display: none; }
.tabbar .traffic {
  display: flex;
  gap: 6px;
  padding: 0 10px 9px 4px;
  align-items: center;
  -webkit-app-region: no-drag;
}
.tabbar .traffic .dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #e0e2e8;
  border: 1px solid #d2d5dc;
}
.tabbar .traffic .dot.r { background: #ed6a5e; border-color: #d65a4f; }
.tabbar .traffic .dot.y { background: #f5bd4f; border-color: #d9a23e; }
.tabbar .traffic .dot.g { background: #62c554; border-color: #4fad44; }

.tabs-strip {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-app-region: no-drag;
}
.tabs-strip::-webkit-scrollbar { display: none; }

.tabs-spacer { flex: 1; -webkit-app-region: drag; align-self: stretch; }

.wtab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px;
  min-width: 168px;
  max-width: 240px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  position: relative;
  flex-shrink: 0;
}
.wtab:hover { background: var(--hover); color: var(--fg-2); }
.wtab.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--fg);
  font-weight: 600;
  margin-bottom: -1px;
  padding-bottom: 1px;
}
.wtab.active::after {
  content: '';
  position: absolute;
  left: -1px; right: -1px; bottom: -1px;
  height: 1px;
  background: var(--surface);
}
.wtab .ico {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--muted-2);
  display: grid; place-items: center;
}
.wtab.active .ico { color: var(--accent); }
.wtab .ico svg { width: 100%; height: 100%; display: block; }
.wtab .label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.wtab .x {
  width: 18px; height: 18px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--muted-2);
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
  flex-shrink: 0;
}
.wtab:hover .x, .wtab.active .x { opacity: 1; }
.wtab .x:hover { background: var(--border); color: var(--fg); }
.wtab .x svg { width: 11px; height: 11px; }

.tab-add {
  width: 32px; height: 32px;
  margin: 0 0 2px 4px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .12s, color .12s;
  -webkit-app-region: no-drag;
  flex-shrink: 0;
}
.tab-add:hover { background: var(--hover); color: var(--fg); }
.tab-add svg { width: 15px; height: 15px; }

/* Add-tab popover */
.add-pop {
  position: fixed;
  top: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-modal);
  padding: 6px;
  min-width: 220px;
  z-index: 200;
  display: none;
}
.add-pop.open { display: block; }
.add-pop .ap-label {
  padding: 6px 10px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.add-pop .ap-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--fg-2);
  cursor: pointer;
  text-align: left;
}
.add-pop .ap-item:hover { background: var(--hover); color: var(--fg); }
.add-pop .ap-item .ico { width: 14px; height: 14px; color: var(--muted); }

/* ───────── Top bar ───────── */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  padding: 0 12px 0 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar .spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

/* ── Topbar favori proje tab'ları ── */
.topbar-proj-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
}
.topbar-proj-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.topbar-proj-tab:hover {
  border-color: var(--border);
  color: var(--fg-2);
}
.topbar-proj-tab.active {
  border-color: var(--accent);
  color: var(--fg);
  font-weight: 600;
}
.tpt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tpt-name { white-space: nowrap; }
.tpt-close {
  font-size: 15px;
  line-height: 1;
  color: var(--muted-2);
  margin-left: 2px;
  padding: 0 1px;
  border-radius: 3px;
  transition: color .1s, background .1s;
}
.topbar-proj-tab:hover .tpt-close { color: var(--fg-2); }
.tpt-close:hover { background: var(--hover); color: var(--fg) !important; }
.tpt-add {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.tpt-add:hover { border-color: var(--fg-2); color: var(--fg); background: var(--hover); }

/* AI star button */
.ai-star-btn {
  color: var(--accent);
  background: var(--accent-2);
  border-color: var(--accent) !important;
  transition: background .12s, color .12s, border-color .12s;
}
.ai-star-btn:hover,
.ai-star-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
}

/* ── Timer widget (compact, in topbar) ── */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px 0 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-variant-numeric: tabular-nums;
}
.timer:hover { background: var(--hover); }
.timer .play {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
  transition: background .12s;
}
.timer .play svg { width: 8px; height: 8px; }
.timer .lbl {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.timer .clock {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.timer .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-done);
  flex-shrink: 0;
  animation: t-pulse 1.6s ease-in-out infinite;
}
@keyframes t-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}
.timer.running { background: #f0fbf4; border-color: #cfe9d8; }
.timer.running .play {
  background: var(--status-done);
}
.timer.running:hover { background: #e6f6ec; }

/* Timer dropdown popover */
.timer-pop {
  position: fixed;
  top: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-modal);
  padding: 16px;
  width: 360px;
  z-index: 180;
  display: none;
}
.timer-pop.open { display: block; }
.timer-pop .tp-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.timer-pop .tp-title { font-size: 13px; font-weight: 600; flex: 1; }
.timer-pop .tp-status-chip {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.timer-pop .tp-status-chip.running {
  color: var(--status-done);
  border-color: #cfe9d8;
  background: #f0fbf4;
}

.timer-pop .tp-clock {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.timer-pop .tp-clock-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.timer-pop .tp-task {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 10px;
  background: var(--surface-2);
}
.timer-pop .tp-task .id {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}
.timer-pop .tp-task .swap {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--accent);
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.timer-pop .tp-actions { display: flex; gap: 6px; margin-bottom: 14px; }
.timer-pop .tp-actions .btn { flex: 1; justify-content: center; height: 32px; }

/* Today summary */
.tp-summary {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-bottom: 12px;
}
.tp-summary-row {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 8px;
}
.tp-summary-row .lbl {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.tp-summary-row .val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.tp-summary-row .target {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.tp-week-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border-2);
  overflow: hidden;
  margin-bottom: 14px;
}
.tp-week-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.tp-projects {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.tp-proj {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
}
.tp-proj .name {
  font-size: 11px;
  color: var(--muted);
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 3px;
}
.tp-proj .name .dot { width: 6px; height: 6px; border-radius: 2px; }
.tp-proj .dur {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* Recent (today) entries */
.timer-pop .tp-recent {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.timer-pop .tp-recent-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
  display: flex; align-items: center;
}
.timer-pop .tp-recent-label .all {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
  font-size: 11.5px;
}
.timer-pop .tp-recent-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  padding: 6px 0;
  color: var(--fg-2);
  border-top: 1px solid var(--border-2);
}
.timer-pop .tp-recent-row:first-of-type { border-top: none; }
.timer-pop .tp-recent-row .id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  min-width: 60px;
}
.timer-pop .tp-recent-row .ttl {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timer-pop .tp-recent-row .pdot {
  width: 6px; height: 6px;
  border-radius: 2px;
  flex-shrink: 0;
}
.timer-pop .tp-recent-row .dur {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Calendar widget (compact, in topbar) ── */
.cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  transition: background .12s;
}
.cal-btn:hover { background: var(--hover); }
.cal-btn .day {
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cal-btn .events-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-2);
  padding: 1px 6px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

/* Calendar popover (mini-cal + today's events) */
.cal-pop {
  position: fixed;
  top: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-modal);
  padding: 14px;
  width: 380px;
  max-height: 640px;
  overflow-y: auto;
  z-index: 180;
  display: none;
}
.cal-pop.open { display: block; }
.cal-pop .cp-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.cal-pop .cp-month {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
}
.cal-pop .cp-today-link {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 5px;
}
.cal-pop .cp-today-link:hover { background: var(--accent-2); }
.cal-pop .nav-arrow {
  width: 22px; height: 22px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.cal-pop .nav-arrow:hover { background: var(--hover); color: var(--fg); }
.cal-pop .nav-arrow svg { width: 12px; height: 12px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 12px;
}
.cal-grid .dow {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 0;
}
.cal-grid .day-cell {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 12px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: background .12s, color .12s;
}
.cal-grid .day-cell:hover { background: var(--hover); }
.cal-grid .day-cell.muted { color: var(--muted-2); opacity: .6; }
.cal-grid .day-cell.today {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.cal-grid .day-cell.today:hover { background: var(--accent); }
.cal-grid .day-cell.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-grid .day-cell.today.has-event::after { background: #fff; }

.cal-events {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.cal-events-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 8px 0 8px;
  display: flex; align-items: center;
}
.cal-events-label .count {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
}
.cal-event {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 8px;
  margin: 0 -6px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s;
}
.cal-event:hover { background: var(--surface-2); }
.cal-event .ev-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  min-width: 64px;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.cal-event .ev-time small { display: block; color: var(--muted-2); font-size: 10px; }
.cal-event .ev-stripe {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}
.cal-event.warn .ev-stripe { background: var(--status-prog); }
.cal-event.crit .ev-stripe { background: var(--status-blocked); }
.cal-event.muted .ev-stripe { background: var(--muted-2); }
.cal-event .ev-text {
  flex: 1;
  color: var(--fg-2);
  line-height: 1.4;
  min-width: 0;
}
.cal-event .ev-title {
  font-weight: 500;
  color: var(--fg);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event .ev-meta {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.4;
}
.cal-event .ev-attendees {
  display: inline-flex;
  margin-top: 4px;
}
.cal-event .ev-attendees .av {
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 8.5px;
  font-weight: 600;
  color: #fff;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
  margin-left: -6px;
}
.cal-event .ev-attendees .av:first-child { margin-left: 0; }
.cal-event .ev-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--accent);
  font-family: var(--font-mono);
}
.cal-event .ev-link svg { width: 10px; height: 10px; }
.cal-event .ev-status {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 4px;
}
.cal-event .ev-status.now {
  color: var(--status-done);
  font-weight: 600;
}

.cal-cta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
}
.cal-cta .btn {
  flex: 1;
  height: 30px;
  justify-content: center;
  font-size: 12px;
}
.cal-cta .btn .ico {
  width: 12px; height: 12px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-2);
  font-weight: 500;
}
.crumb-sep { color: var(--muted-2); margin: 0 4px; font-weight: 400; }
.crumb-muted { color: var(--muted); font-weight: 400; }

/* ───────── Sidebar (Linear-style) ───────── */
.sidebar {
  grid-area: sidebar;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Workspace switcher — top of sidebar */
.ws-block {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.ws-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 30px;
  padding: 0 8px 0 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  flex: 1;
  min-width: 0;
  transition: background .12s, border-color .12s;
}
.ws-switch:hover { background: var(--hover); }
.ws-switch.open { background: var(--hover); border-color: var(--border); }
.ws-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 6px; }
.ws-logo {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: #e4e4e4;
  display: grid; place-items: center;
  color: #333;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.ws-caret {
  width: 13px;
  height: 13px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 4px;
  transition: transform .15s;
}
.ws-switch.open .ws-caret { transform: rotate(180deg); }
.ws-switch .caret { color: var(--muted-2); margin-left: auto; }
.ws-block .icon-btn { width: 28px; height: 28px; flex-shrink: 0; }

/* Org dropdown */
.org-dropdown {
  position: fixed;
  width: 252px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.07);
  padding: 4px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.org-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.org-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
  user-select: none;
  margin-bottom: 1px;
}
.org-dropdown-item:hover { background: var(--hover); }
.org-dropdown-item.active { background: var(--hover); }
.org-item-logo {
  width: 20px; height: 20px;
  border-radius: 5px;
  display: grid; place-items: center;
  color: #333;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.org-item-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
}
.org-check {
  color: var(--primary, #5b4fd9);
  flex-shrink: 0;
  opacity: 0;
}
.org-dropdown-item.active .org-check { opacity: 1; }

/* Compact search */
.sb-search-wrap {
  padding: 8px 8px 4px;
}
.sb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  width: 100%;
  border: none;
  transition: background .12s;
}
.sb-search:hover { background: var(--hover); }
.sb-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.sb-search .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: -0.02em;
}

/* Nav sections */
.sb-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 12px;
}
.nav-section { padding: 10px 8px 6px; }
.nav-section__label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.nav-section__label .add-btn {
  margin-left: auto;
  width: 18px; height: 18px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--muted-2);
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
}
.nav-section:hover .add-btn { opacity: 1; }
.nav-section__label .add-btn:hover { background: var(--hover); color: var(--fg); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  margin-bottom: 1px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
  text-align: left;
}
.nav-item:hover { background: var(--hover); color: var(--fg); }
.nav-item.active {
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border);
}
.nav-item .ico {
  width: 17px; height: 17px;
  flex-shrink: 0;
  color: var(--muted);
}
.nav-item.active .ico { color: var(--accent); }
.nav-item:hover .ico { color: var(--fg-2); }
.nav-item .ico svg { width: 100%; height: 100%; display: block; }
.nav-item .count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  background: var(--hover);
  border-radius: 4px;
}
.nav-item.active .count { background: var(--accent-2); color: var(--accent); }

/* Favorite item with star + dot */
.nav-item .fav-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Favori Markalar (collapsible) ── */
.fav-brands-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}
.fav-brands-toggle span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  flex: 1;
}
.fav-brands-toggle:hover span { color: var(--muted); }
.fav-caret {
  color: var(--muted-2);
  flex-shrink: 0;
  transition: transform .18s ease;
}
.fav-brands-section.open .fav-caret {
  transform: rotate(90deg);
}

.fav-brands-list {
  display: none;
  padding-bottom: 4px;
}
.fav-brands-list.open { display: block; }

.fav-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* Sidebar footer */
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* ───────── Main ───────── */
.main {
  grid-area: main;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* iframe host (shell uses this for the content area) */
.main-frame {
  grid-area: main;
  border: none;
  width: 100%;
  height: 100%;
  background: var(--surface);
}
.main-frame.modal-host {
  position: relative;
  z-index: 501;
}

/* ───────── Page header ───────── */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 20px;
  border-bottom: 1px solid var(--border);
}
.page-title-row { display: flex; align-items: baseline; gap: 12px; }
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-count {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.page-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ───────── Filter row ───────── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  border-bottom: 1px solid var(--border);
}
.filter-row .spacer { flex: 1; }

/* ───────── Empty state (placeholder pages) ───────── */
.empty-state {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 60px 40px;
}
.empty-card {
  max-width: 460px;
  text-align: center;
}
.empty-card .ico {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--muted);
}
.empty-card .ico svg { width: 24px; height: 24px; }
.empty-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.empty-card p {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}
