/* TIMELINE CARD & ITEMS */
.tl-timeline-card {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  margin-top: 16px;
  transition: all 0.2s ease;
}

.tl-timeline-card.hidden {
  display: none;
}

.tl-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tl-timeline-header-actions,
.period-tl-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-timeline-nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Time Logger Horizon Tabs (Today / Week / Month) */
.tl-horizon-tabs {
  display: flex;
  background: var(--bg-card-elevated);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.tl-horizon-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-horizon-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.65);
}

.tl-horizon-tab.active {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(108, 122, 224, 0.30);
}

.tl-period-kpis {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-period-title-display {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 80px;
  text-align: center;
}

.tl-mode-tabs {
  margin: 0;
}

.tl-log-item.is-list-edit-mode {
  background: var(--bg-card);
  border: 1.5px dashed var(--accent-indigo);
  padding: 10px 12px;
}

.tl-inline-edit-grid {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.tl-inline-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tl-inline-field label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tl-inline-field select,
.tl-inline-field input {
  padding: 5px 8px;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  width: auto;
}

.tl-inline-field-dur input {
  width: 68px !important;
}

.tl-inline-field-note {
  flex: 1;
  min-width: 150px;
}

.tl-inline-field-note input {
  width: 100% !important;
}

.tl-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.tl-timeline-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-timeline-date {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.tl-timeline-summary-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-indigo);
  background: var(--accent-indigo-soft);
  padding: 2px 8px;
  border-radius: 12px;
}

.tl-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tl-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-subcard);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-log-item:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.tl-log-quick-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.tl-log-item:hover .tl-log-quick-actions {
  opacity: 1;
}

.btn-saved-flash {
  background: var(--accent-emerald) !important;
  color: #ffffff !important;
  border-color: var(--accent-emerald) !important;
}

.tl-log-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tl-log-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.tl-log-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tl-log-note {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-log-time-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl-log-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tl-log-roi-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.tl-log-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-log-action {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.12s ease;
}

.btn-log-action:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.btn-log-action.del:hover {
  color: var(--accent-rose);
  background: var(--accent-rose-soft);
}

.tl-empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  background: var(--bg-card-elevated);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
}


/* =========================================================================
   7. TIME LOGGER EDIT MODE (+ ADD / × REMOVE) & PERIOD TIME LOGGED ANALYTICS
   ========================================================================= */
.btn-edit-categories {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-edit-categories:hover {
  background: var(--border-subtle);
}

.btn-edit-categories.active {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(108, 122, 224, 0.35);
}

.tl-edit-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-indigo-soft);
  border: 1px dashed var(--accent-indigo);
  color: var(--accent-indigo);
  font-size: 0.76rem;
  box-sizing: border-box;
}

.tl-edit-banner-text {
  flex: 1;
  min-width: 220px;
  line-height: 1.4;
}

.tl-edit-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tl-cat-btn.edit-mode-item {
  border-style: dashed;
  border-color: var(--border-highlight);
  animation: edit-wiggle 2.4s ease-in-out infinite;
}

@keyframes edit-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-0.6deg); }
  75% { transform: rotate(0.6deg); }
}

.tl-cat-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  border: 2px solid #ffffff;
  cursor: pointer;
  z-index: 4;
  transition: transform 0.14s ease, background 0.14s ease;
}

.tl-cat-remove-btn:hover {
  background: #dc2626;
  transform: scale(1.15);
}

/* Hover Tooltip for Category Description (keeps category buttons compact!) */
.tl-cat-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 0;
  transform: translateY(4px);
  background: rgba(25, 30, 38, 0.94);
  color: #ffffff;
  font-size: 0.69rem;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 30;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.tl-cat-btn[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

}

.btn-pool-remove:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.pool-add-new-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--accent-emerald);
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pool-add-new-card-btn:hover {
  background: rgba(47, 158, 119, 0.18);
  transform: translateY(-1px);
}

.tl-cat-btn-add-new {
  border: 2px dashed var(--accent-emerald) !important;
  background: var(--accent-emerald-soft) !important;
}

.tl-cat-btn-add-new:hover {
  background: rgba(47, 158, 119, 0.18) !important;
  transform: translateY(-2px);
}

.tl-cat-plus-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-emerald);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(47, 158, 119, 0.3);
}

