/* U7 — time tracking: topbar timer chip, task time entries, board chip. */

/* Running-timer chip (topbar + task detail) ------------------------------- */

/* N parallel lanes each get a chip — lay them out as a wrapping row so the
   topbar never blanks when one lane stops (Task #90). */
.running-timer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.timer-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-chip);
  border: 1px solid var(--border-strong);
  white-space: nowrap;
}

.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: timer-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.timer-chip-task {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.timer-chip-clock {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* Multi-timer pill + popover (Task #128) ----------------------------------- */

/* When many fleet lanes run at once, N loose chips wrapped and broke the
   topbar. Collapse them into one compact pill (oldest lane's live clock + a
   count) that opens a popover listing every running timer as its own row. */
.timer-menu { position: relative; }

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-chip);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.timer-pill:hover { background: var(--surface-hover); }

.timer-pill-clock {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.timer-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #0b0d10;
  font-size: var(--text-2xs);
  font-weight: 700;
}

.timer-pill-caret { color: var(--text-muted); flex-shrink: 0; }
.timer-pill[aria-expanded="true"] .timer-pill-caret { transform: rotate(180deg); }

.timer-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 300px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
}

.timer-menu-head {
  padding: 6px 8px 8px;
  border-bottom: 1px solid var(--border-mid);
  margin-bottom: 4px;
}

.timer-menu-title {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.timer-menu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.timer-menu-row:hover { background: var(--surface-hover); }

.timer-menu-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timer-menu-row-task {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-menu-row-task:hover { color: var(--text); }

.timer-menu-row-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--text-xs);
}

.timer-menu-row-clock {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.timer-menu-row-money {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.timer-menu-row-stop { flex-shrink: 0; }

/* Task detail: timer controls + entry list -------------------------------- */

.time-entries-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.time-entries-flagged-notice {
  font-size: var(--text-sm);
  color: #fbbf24;
  margin: 0 0 10px;
}

.time-entries-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.time-entry-row {
  display: grid;
  grid-template-columns: 90px 60px 1fr 100px 90px auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-mid);
}

.time-entry-row:last-child { border-bottom: none; }

.time-entry-row--head {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.time-entry-row--total {
  font-weight: 600;
  background: var(--surface-chip);
}

.time-entry-total-amount { color: var(--accent); }

.time-entry-row--flagged { color: #fbbf24; }

/* The Stockholm clock time the entry was logged — secondary to the date. */
.time-entry-logged { color: var(--text-muted); margin-left: 6px; }

.time-entry-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.time-entry-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.badge-warn {
  background: rgba(251, 191, 36, 0.14);
  border: none;
  color: #fbbf24;
}

.time-entry-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.time-entry-form .input { width: auto; flex: 0 1 150px; }

/* Board card logged-time chip ---------------------------------------------- */

.count-chip--time { color: var(--accent); }
