/* sidebar */
.tf-side {
  width: var(--sidebar-w);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: var(--surface);
  border-right: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  z-index: 200;
}

/* Brand */
.tf-brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-5) var(--s-4) var(--s-4);
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
}
.tf-brand-mark {
  width: 30px; height: 30px;
  border-radius: var(--r-2);
  background: var(--accent);
  color: #0c0e11;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .04em;
}
.tf-brand-word {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -.01em;
}
.tf-brand-sub {
  font-family: var(--f-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 9px;
  color: var(--ink-faint);
  line-height: 1;
}

/* Nav */
.tf-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-3) var(--s-2);
}
.tf-nav-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px var(--s-2);
  border-radius: var(--r-1);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-mute);
  transition: background .12s, color .12s;
  position: relative;
  width: 100%;
  text-align: left;
}
.tf-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.tf-nav-item:focus,
.tf-nav-item:focus-visible { outline: none; box-shadow: none; }
.tf-nav-item.is-active {
  color: var(--ink);
}
.tf-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--ink-mute);
}
.tf-nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .6; }
.tf-nav-item.is-active svg { opacity: .9; }
.tf-nav-item > span:first-of-type { flex: 1; }
.tf-nav-key {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0;
}

/* Overview section — must grow to push footer to bottom */
.tf-side-overview {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

/* Stats */
.tf-side-label {
  font-family: var(--f-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 9px;
  color: var(--ink-faint);
  padding: var(--s-4) var(--s-4) var(--s-2);
}
.tf-side-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 var(--s-2);
}
.tf-side-stat {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px var(--s-2);
  border-radius: var(--r-1);
  width: 100%;
  text-align: left;
  transition: background .12s;
  cursor: pointer;
}
.tf-side-stat:hover { background: var(--surface-2); }
.tf-side-stat .dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.tf-side-stat .lbl {
  flex: 1;
  font-size: var(--t-sm);
  color: var(--ink-mute);
}
.tf-side-stat .val {
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  color: var(--ink-2);
  min-width: 20px;
  text-align: right;
}

/* Stat dot colors */
.tf-side-stat.is-overdue .dot   { background: var(--overdue); box-shadow: 0 0 5px var(--overdue); }
.tf-side-stat.is-progress .dot  { background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.tf-side-stat.is-blocked .dot   { background: var(--blocked); box-shadow: 0 0 5px var(--blocked); }
.tf-side-stat.is-done .dot      { background: var(--done); box-shadow: 0 0 5px var(--done); }
.tf-side-stat.is-stale .dot     { background: var(--stale); box-shadow: 0 0 5px var(--stale); }

.tf-side-stat.is-overdue .val   { color: var(--overdue); }
.tf-side-stat.is-done .val      { color: var(--done); }
.tf-side-stat.is-stale .val     { color: var(--stale); }

/* Scheduled section */
.tf-side-label--row {
  display: flex;
  align-items: center;
}
.tf-side-label--row .mono {
  font-size: 10px;
  color: var(--accent);
  margin-left: auto;
}
.tf-side-sched-wrap {
  border-top: 1px solid var(--hair);
  margin-top: var(--s-2);
  padding-bottom: var(--s-2);
}
.tf-sched-list {
  padding: 0 var(--s-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sched-group {
  margin-bottom: var(--s-1);
}
.sched-date {
  font-family: var(--f-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-faint);
  padding: 6px var(--s-2) 3px;
}
.sched-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px var(--s-2);
  border-radius: var(--r-1);
  cursor: pointer;
  transition: background .12s;
}
.sched-item:hover { background: var(--surface-2); }
.sched-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sched-title {
  font-size: var(--t-sm);
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.sched-empty {
  font-size: var(--t-xs);
  color: var(--ink-faint);
  padding: var(--s-2) var(--s-2);
  font-style: italic;
}

/* History section */
.tf-side-hist-wrap {
  border-top: 1px solid var(--hair);
  margin-top: var(--s-2);
  padding-bottom: var(--s-3);
}
.tf-hist-list {
  padding: 0 var(--s-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hist-day {
  margin-bottom: var(--s-1);
}
.hist-day-header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px var(--s-2);
  cursor: pointer;
  border-radius: var(--r-1);
  transition: background .12s;
  user-select: none;
}
.hist-day-header:hover { background: var(--surface-2); }
.hist-day-label {
  font-family: var(--f-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-faint);
  flex: 1;
}
.hist-day-count {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--ink-faint);
}
.hist-day-chevron {
  transition: transform .15s;
  color: var(--ink-faint);
}
.hist-day-chevron.is-collapsed { transform: rotate(-90deg); }
.hist-day-rows { display: flex; flex-direction: column; gap: 1px; }
.hist-day-rows.hidden { display: none; }
.hist-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px var(--s-2);
  border-radius: var(--r-1);
  cursor: pointer;
  transition: background .12s;
}
.hist-item:hover { background: var(--surface-2); }
.hist-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hist-item-title {
  font-size: var(--t-sm);
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.hist-item.is-done .hist-item-title {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
}
.hist-empty {
  font-size: var(--t-xs);
  color: var(--ink-faint);
  padding: var(--s-1) var(--s-2);
  font-style: italic;
}

/* Footer */
.tf-side-foot {
  padding: var(--s-3) var(--s-3);
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}
.who { flex: 1; min-width: 0; }
.who-name {
  display: block;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.who-role {
  display: block;
  font-family: var(--f-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 9px;
  color: var(--ink-faint);
}
