/* timebar.css — Period-bar timeline block styles.
   Unified renderer for medication, condition, allergy.
   Bar colors are set inline via YAML-driven color dispatch
   (mode: formula | vocab_level) — no hardcoded color classes. */

.timebar-wrapper { position: relative; overflow: hidden; padding: 0.5rem 0 0.5rem 0; }
.timebar-axis {
  position: relative; height: 28px; border-bottom: 2px solid var(--border);
  display: flex; align-items: flex-end; margin-bottom: 0.25rem;
  overflow: visible;
}
.timebar-axis-label {
  position: absolute; bottom: 4px; font-size: 0.7rem; color: var(--text-light);
  transform: translateX(-50%); white-space: nowrap;
}
.timebar-today-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--status-red); z-index: 2; pointer-events: none;
}
.timebar-today-tag {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; color: var(--status-red); font-weight: 600; white-space: nowrap;
}
.timebar-group { margin-bottom: 0.75rem; }
.timebar-group-label {
  font-size: 0.78rem; font-weight: 600; color: var(--text);
  padding: 0.25rem 0; border-bottom: 1px solid var(--bg-hover); margin-bottom: 0.25rem;
}
.timebar-tracks { position: relative; }
.timebar-track {
  position: relative; height: 32px; margin-bottom: 2px;
  display: flex; align-items: center;
}
.timebar-track-label {
  width: 150px; min-width: 150px; font-size: 0.75rem; color: var(--text);
  padding-left: 16px; padding-right: 6px; text-align: left; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.timebar-track-bar-area { position: relative; flex: 1; height: 100%; }
.timebar-bar {
  position: absolute; top: 4px; height: 24px; border-radius: 4px;
  display: flex; align-items: center; padding: 0 8px;
  cursor: pointer; transition: filter 0.15s; overflow: hidden;
  white-space: nowrap; font-size: 0.72rem; color: #fff;
  min-width: 4px;
  border: 1px solid rgba(0,0,0,0.12);
}
.timebar-bar:hover { filter: brightness(1.1); z-index: 3; }
.timebar-bar-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }

.timebar-filter {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.75rem;
}
.timebar-filter-btn {
  background: transparent;
  border: 0;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}
.timebar-filter-btn + .timebar-filter-btn { border-left: 1px solid var(--border-strong); }
.timebar-filter-btn:hover:not(.active) { background: var(--bg-hover); }
.timebar-filter-btn.active {
  background: var(--color-primary);
  color: #fff;
}

@media (max-width: 600px) {
  .timebar-track-label { width: 100px; min-width: 100px; font-size: 0.7rem; }
}

.timebar-menu {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  min-width: 160px;
  z-index: 1000;
  padding: .25em 0;
}
.timebar-menu-item {
  display: block;
  width: 100%;
  padding: .5em 1em;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.timebar-menu-item:hover { background: var(--bg-hover); }
