/* ==========================================================================
   TINYSTRIDES — ADVANCED TEMPORAL CHRONOLOGY & MONTHLY NAVIGATION
   ========================================================================== */
.analytics-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 860px) {
  .analytics-section {
    grid-template-columns: 1fr;
  }
}

/* Month Navigation Header */
.ledger-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  margin-bottom: 12px;
}

.ledger-nav-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.ledger-nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  color: var(--accent-primary);
}

.ledger-month-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 31-Day Ledger Grid */
.ledger-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.ledger-day-tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition-fast);
  cursor: default;
}

.ledger-day-tile:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  z-index: 2;
}

.ledger-day-tile.today {
  border: 2px solid var(--accent-primary);
  font-weight: 800;
  color: var(--accent-primary);
}

.ledger-day-tile.completed-full {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.4));
  border-color: rgba(16, 185, 129, 0.6);
  color: #10b981;
  font-weight: 700;
}

.ledger-day-tile.completed-partial {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

.ledger-day-tile .day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-top: 2px;
  background: transparent;
}

.ledger-day-tile.completed-full .day-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.ledger-day-tile.completed-partial .day-dot {
  background: #818cf8;
}

/* Trend Bar Chart */
.trend-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 160px;
  padding: 16px 8px 8px;
  margin-top: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.trend-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
  position: relative;
}

.trend-bar-track {
  width: 100%;
  max-width: 24px;
  height: 100%;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
}

.trend-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-secondary), var(--accent-primary));
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 2px;
}

.trend-bar-fill.high {
  background: linear-gradient(180deg, #34d399, #10b981);
}

.trend-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.trend-tooltip {
  position: absolute;
  top: -24px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
}

.trend-bar-col:hover .trend-tooltip {
  opacity: 1;
}

/* Utilities Tray */
.utilities-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.util-btn-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-partner {
  background: linear-gradient(135deg, var(--accent-partner), #7c3aed);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

.btn-partner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.45);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast-message {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-accent);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(20px);
  opacity: 0;
  animation: toastIn 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

@keyframes toastIn {
  to { transform: translateY(0); opacity: 1; }
}
