/* ═══════════════════════════════════════════════════════════
   DASHBOARD — Minimalistic Developer-Friendly Layout
   Gray-only palette. No pure #fff / #000.
   ═══════════════════════════════════════════════════════════ */

/* ─── Page layout — fluid, edge-to-edge ────────────────── */
.dashboard-page {
  max-width: none;
  margin: 0;
  padding: 0 calc(var(--spacing-lg) * 2.5);
}

/* ─── Greeting header ──────────────────────────────────── */
.dashboard-greeting {
  margin-bottom: var(--spacing-xl);
}
.dashboard-greeting h1 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.15rem;
}
.dashboard-greeting p {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* ─── Stat strip (replaces card-based stats) ───────────── */
.stat-strip {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
  margin-bottom: var(--spacing-xl);
}
.stat-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg) var(--spacing-md);
  gap: 0.2rem;
  border-right: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}
.stat-pill:last-child {
  border-right: none;
}
.stat-pill:hover {
  background: var(--color-surface-light);
}
.stat-pill .stat-value {
  font-family: var(--font-family-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.stat-pill .stat-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  font-weight: 500;
}
/* Highlight "today" pill */
.stat-pill.highlight .stat-value {
  color: var(--color-text-primary);
  font-size: var(--font-size-3xl);
}

@media (max-width: 768px) {
  .stat-strip {
    flex-wrap: wrap;
  }
  .stat-pill {
    flex: 1 1 45%;
    border-bottom: 1px solid var(--color-border-light);
  }
  .stat-pill:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

/* ─── Section headers (replace card headers) ────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--spacing-md) 0 var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-md);
}
.section-header h2 {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin: 0;
}
.section-header .section-action {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}
.section-header .section-action:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
}

/* ─── Today's entries — timeline bars ───────────────────── */
.entries-timeline {
  margin-bottom: var(--spacing-xl);
}
.entry-row {
  display: grid;
  grid-template-columns: 44px 1fr 56px;
  align-items: center;
  gap: var(--spacing-md);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}
.entry-row:last-child {
  border-bottom: none;
}
.entry-row:hover {
  background: var(--color-surface);
}
.entry-time-mono {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: right;
}
.entry-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.entry-bar-track {
  height: 5px;
  border-radius: 3px;
  background: var(--color-border-light);
  width: 100%;
  overflow: hidden;
}
.entry-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--color-text-secondary);
  min-width: 6px;
  transition: width 0.6s ease;
}
/* Alternate project shades (set via inline style or nth-child) */
.entry-row:nth-child(4n+1) .entry-bar-fill { background: #555; }
.entry-row:nth-child(4n+2) .entry-bar-fill { background: #777; }
.entry-row:nth-child(4n+3) .entry-bar-fill { background: #999; }
.entry-row:nth-child(4n+4) .entry-bar-fill { background: #bbb; }

.entry-description {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
}
.entry-project-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}
.entry-task-title {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-hours-mono {
  font-family: var(--font-family-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: right;
  white-space: nowrap;
}
.entries-total-row {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  margin-top: var(--spacing-sm);
}
.entries-total-row .total-value {
  font-family: var(--font-family-mono);
  font-weight: 700;
  color: var(--color-text-secondary);
}

/* ─── Empty state ───────────────────────────────────────── */
.empty-state {
  padding: var(--spacing-xl) 0;
  text-align: center;
}
.empty-state p {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: 0;
}
.empty-state a {
  color: var(--color-text-secondary) !important;
  text-decoration: underline;
}

/* ─── Charts section — two-column grid, fluid ───────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}
@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Chart card (only used for the 2 bottom panels) ──── */
.chart-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
}
.chart-card-header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border-light);
}
.chart-card-header h3 {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin: 0;
}
.chart-card-body {
  padding: var(--spacing-lg);
}

/* ─── Weekly bars (CSS-only) ────────────────────────────── */
.weekly-bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.weekly-row {
  display: grid;
  grid-template-columns: 32px 1fr 48px;
  align-items: center;
  gap: var(--spacing-sm);
}
.weekly-day-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.weekly-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--color-border-light);
  overflow: hidden;
}
.weekly-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--color-text-secondary);
  transition: width 0.8s ease;
}
.weekly-row.is-today .weekly-bar-fill {
  background: var(--color-text-primary);
}
.weekly-row.is-today .weekly-day-label {
  color: var(--color-text-primary);
}
.weekly-hours-label {
  font-family: var(--font-family-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-align: right;
}

/* ─── Month breakdown (project list + mini bars) ────────── */
.month-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.breakdown-row {
  display: grid;
  grid-template-columns: 1fr 56px 44px;
  align-items: center;
  gap: var(--spacing-sm);
}
.breakdown-project {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breakdown-bar-track {
  height: 4px;
  border-radius: 2px;
  background: var(--color-border-light);
  overflow: hidden;
}
.breakdown-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--color-text-muted);
  transition: width 0.8s ease;
}
.breakdown-row:nth-child(4n+1) .breakdown-bar-fill { background: #555; }
.breakdown-row:nth-child(4n+2) .breakdown-bar-fill { background: #777; }
.breakdown-row:nth-child(4n+3) .breakdown-bar-fill { background: #999; }
.breakdown-row:nth-child(4n+4) .breakdown-bar-fill { background: #bbb; }
.breakdown-hours {
  font-family: var(--font-family-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-align: right;
}
.breakdown-total {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  gap: 0.3rem;
}
.breakdown-total .total-value {
  font-family: var(--font-family-mono);
  font-weight: 700;
  color: var(--color-text-secondary);
}

/* ─── Animations (kept from original) ───────────────────── */
.notification {
  animation: slideIn 300ms ease-out;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bar entrance animation */
.entry-bar-fill,
.weekly-bar-fill,
.breakdown-bar-fill {
  animation: barGrow 0.6s ease both;
}
@keyframes barGrow {
  from { width: 0 !important; }
}

/* ─── Stats Inline Card ─────────────────────────────────── */
.stats-inline-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-divider {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* ─── Legacy compat (soft remove) ──────────────────────── */
.card {
  transition: all 200ms ease;
}
.card-menu {
  animation: fadeIn 200ms ease-out;
}
.nav-link {
  transition: all 120ms ease;
}
.menu-item:hover {
  background-color: var(--color-surface-light);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 576px) {
  .dashboard-page {
    padding: 0 var(--spacing-md);
  }
  .stat-pill .stat-value {
    font-size: var(--font-size-xl);
  }
  .stat-pill.highlight .stat-value {
    font-size: var(--font-size-2xl);
  }
  .entry-row {
    grid-template-columns: 36px 1fr 48px;
    gap: var(--spacing-sm);
  }
}

@media (min-width: 577px) and (max-width: 1024px) {
  .dashboard-page {
    padding: 0 var(--spacing-xl);
  }
}

/* ═══════════════════════════════════════════════════════════
   PHASE 3+4 — Interactions, Micro-animations, Polish
   ═══════════════════════════════════════════════════════════ */

/* ─── Status dot (timer running indicator) ──────────────── */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.status-dot.active {
  background: #555;
  animation: statusPulse 2s ease-in-out infinite;
}
.status-dot.idle {
  background: var(--color-text-disabled);
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Keyboard shortcut hints ───────────────────────────── */
.kbd-hint {
  display: inline-block;
  font-family: var(--font-family-mono);
  font-size: 0.6rem;
  padding: 0.1em 0.4em;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  margin-left: 0.4rem;
  vertical-align: middle;
  line-height: 1.4;
}

/* ─── Entry row hover slide highlight ───────────────────── */
.entry-row {
  position: relative;
}
.entry-row::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  border-radius: 2px;
  transition: background var(--transition-fast);
}
.entry-row:hover::before {
  background: var(--color-text-muted);
}

/* ─── Stat pill hover lift ──────────────────────────────── */
.stat-pill {
  position: relative;
  cursor: default;
}
.stat-pill::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-text-muted);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}
.stat-pill:hover::after {
  transform: scaleX(1);
}

/* ─── Chart card subtle hover ───────────────────────────── */
.chart-card {
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.chart-card:hover {
  border-color: var(--color-text-disabled);
  box-shadow: var(--shadow-sm);
}

/* ─── Section action button enhanced ────────────────────── */
.section-header .section-action {
  transition: all var(--transition-fast);
}
.section-header .section-action:hover {
  background: var(--color-text-primary);
  color: var(--color-surface) !important;
  border-color: var(--color-text-primary);
}

/* ─── Relative timestamp styling ────────────────────────── */
.entry-relative-time {
  font-family: var(--font-family-mono);
  font-size: 0.6rem;
  color: var(--color-text-disabled);
  margin-left: 0.3rem;
}

/* ─── Inline quick-add form ─────────────────────────────── */
.quick-add-form {
  display: none;
  padding: var(--spacing-md) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--spacing-sm);
}
.quick-add-form.visible {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  flex-wrap: wrap;
}
.quick-add-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}
.quick-add-form input[type="text"]:focus {
  border-color: var(--color-text-muted);
}
.quick-add-form input[type="text"]::placeholder {
  color: var(--color-text-disabled);
}
.quick-add-form button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-text-primary);
  color: var(--color-surface);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}
.quick-add-form button:hover {
  opacity: 0.85;
}
.quick-add-form .quick-add-cancel {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.quick-add-form .quick-add-cancel:hover {
  color: var(--color-text-primary);
}

/* ─── Dark mode adjustments ─────────────────────────────── */
[data-theme="dark"] .entry-row:hover {
  background: var(--color-surface-light);
}
[data-theme="dark"] .entry-row::before:hover {
  background: var(--color-text-secondary);
}
[data-theme="dark"] .stat-pill::after {
  background: var(--color-text-secondary);
}
[data-theme="dark"] .chart-card:hover {
  border-color: var(--color-text-muted);
}
[data-theme="dark"] .quick-add-form input[type="text"] {
  background: var(--color-surface-light);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}
[data-theme="dark"] .quick-add-form input[type="text"]:focus {
  border-color: var(--color-text-muted);
}
[data-theme="dark"] .status-dot.active {
  background: var(--color-text-secondary);
}
[data-theme="dark"] .kbd-hint {
  background: var(--color-surface-light);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
