/**
 * Pace Planner - Components & UI Elements
 * Buttons, cards, modals, task items, calendar, pomodoro timer, charts, toasts.
 */

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid transparent;
  user-select: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--secondary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--text-dim);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
}

.btn-danger {
  background-color: var(--danger-subtle);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.btn-danger:hover {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-icon {
  padding: 0.55rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

/* ==========================================================================
   Badges & Tags
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.2;
  white-space: nowrap;
}

.badge-neutral {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
}

.badge-success {
  background: var(--success-subtle);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-subtle);
  color: var(--danger);
}

/* Priorities */
.badge-priority-urgent {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-priority-high {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-priority-medium {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-priority-low {
  background: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Categories */
.badge-category-work { background: rgba(99, 102, 241, 0.16); color: #818cf8; }
.badge-category-personal { background: rgba(236, 72, 153, 0.16); color: #f472b6; }
.badge-category-study { background: rgba(168, 85, 247, 0.16); color: #c084fc; }
.badge-category-health { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.badge-category-finance { background: rgba(20, 184, 166, 0.16); color: #2dd4bf; }
.badge-category-other { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }

.task-tag {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg-surface-elevated);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 85px;
}

/* Custom Checkbox */
.task-checkbox-container {
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.task-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-dim);
  border-radius: 6px;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.task-checkbox-container:hover .custom-checkbox {
  border-color: var(--primary);
}

.task-checkbox-container input:checked ~ .custom-checkbox {
  background-color: var(--success);
  border-color: var(--success);
}

.custom-checkbox::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  margin-top: -2px;
  transition: transform 120ms ease;
}

.task-checkbox-container input:checked ~ .custom-checkbox::after {
  transform: rotate(45deg) scale(1);
}

/* ==========================================================================
   Cards & Layout Panels
   ========================================================================== */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

/* ==========================================================================
   Dashboard Widgets
   ========================================================================== */
.dash-hero-banner {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-elevated) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.dash-hero-banner::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

.dash-greeting h2 {
  font-size: 1.85rem;
  margin-bottom: 0.35rem;
}

.dash-greeting-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.dash-workspace-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  opacity: 0.85;
}

.dash-hero-right {
  text-align: right;
  flex-shrink: 0;
}

#dash-live-time {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 1.1;
}

#dash-live-date {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon-today { background: var(--primary-subtle); color: var(--primary); }
.stat-icon-pending { background: var(--warning-subtle); color: var(--warning); }
.stat-icon-completed { background: var(--success-subtle); color: var(--success); }
.stat-icon-rate { background: rgba(139, 92, 246, 0.15); color: var(--secondary); }

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.1;
  margin-top: 0.15rem;
}

/* Dashboard Two-Column Grid */
.dash-columns-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

.dash-schedule-list, .dash-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-schedule-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast);
}

.dash-schedule-item:hover {
  transform: translateX(4px);
}

.schedule-time-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.schedule-content {
  flex: 1;
  overflow: hidden;
}

.schedule-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.dash-upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.dash-upcoming-item:hover {
  background-color: var(--bg-surface-hover);
}

.dash-upcoming-title {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
}

.dash-upcoming-due {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Quick Pomodoro Card */
.dash-pomo-quick {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-elevated) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.dash-pomo-time {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  color: var(--primary);
  margin: 0.5rem 0 1rem;
}

/* Dashboard Holiday Item */
.dash-holiday-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-holiday-item:last-child {
  border-bottom: none;
}

.dash-holiday-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--secondary);
}

.dash-holiday-name {
  font-size: 0.88rem;
  font-weight: 600;
  display: block;
}

.dash-holiday-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Tasks Section
   ========================================================================== */
.tasks-toolbar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
}

.tab-btn.active {
  background-color: var(--primary-subtle);
  color: var(--primary);
}

.tab-count {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
}

.tab-btn.active .tab-count {
  background: var(--primary);
  color: #ffffff;
}

.badge-danger-glow {
  background-color: var(--danger) !important;
  color: #ffffff !important;
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.tasks-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.search-box-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box-wrap .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-box-wrap input {
  padding-left: 2.4rem;
  padding-right: 2rem;
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.filter-group select {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  width: auto;
}

.sort-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Task Cards */
.tasks-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.task-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  transition: all var(--transition-fast);
  position: relative;
}

.task-card:hover {
  border-color: var(--text-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.task-card.is-completed {
  opacity: 0.65;
  background-color: var(--bg-surface-elevated);
}

.task-card.is-overdue {
  border-left: 4px solid var(--danger);
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.task-title-group {
  flex: 1;
  cursor: pointer;
}

.task-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
  transition: color var(--transition-fast);
}

.task-title.strikethrough {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-desc-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.task-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
}

.task-meta-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.task-meta-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.task-due-info {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   Calendar View
   ========================================================================== */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

.cal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}

.cal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.cal-nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-day-cell {
  aspect-ratio: 1;
  min-height: 52px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cal-day-cell:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--primary);
  transform: scale(1.03);
}

.cal-day-cell.other-month {
  opacity: 0.35;
}

.cal-day-cell.is-today {
  border: 2px solid var(--primary);
  background-color: var(--primary-subtle);
}

.cal-day-cell.is-selected {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.cal-day-cell.is-selected .cal-day-num {
  color: #ffffff;
}

.cal-day-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.cal-day-indicators {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-urgent { background-color: var(--danger); box-shadow: 0 0 6px var(--danger); }
.dot-high { background-color: var(--warning); }
.dot-regular { background-color: var(--primary); }

.cal-day-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
}

.cal-day-cell.is-selected .cal-day-badge {
  color: #ffffff;
}

/* Day Agenda Sidebar */
.cal-agenda-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.cal-agenda-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  max-height: 480px;
  overflow-y: auto;
}

.agenda-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.agenda-item-content {
  flex: 1;
  overflow: hidden;
}

.agenda-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-item-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.agenda-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Pomodoro Focus Timer
   ========================================================================== */
.pomo-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.pomo-main-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pomo-mode-tabs {
  display: inline-flex;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem;
  gap: 0.35rem;
  margin-bottom: 2rem;
}

.pomo-mode-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.pomo-mode-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* SVG Circular Ring */
.pomo-timer-display {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 1rem 0 2rem;
}

.pomo-svg-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pomo-bg-circle {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 8;
}

.pomo-progress-circle {
  fill: none;
  stroke: url(#pomo-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.pomo-timer-center {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pomo-timer-text {
  font-size: 3.2rem;
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1;
}

.pomo-cycle-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.pomo-controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Pomodoro History Card */
.pomo-side-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.pomo-stats-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pomo-stat-box {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.pomo-stat-box .val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-heading);
}

.pomo-stat-box .lbl {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}

.pomo-history-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 380px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background-color: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.history-duration {
  font-size: 0.85rem;
  font-weight: 600;
}

.history-time {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Holidays Section
   ========================================================================== */
.holidays-toolbar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.holidays-selectors {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.holidays-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.holiday-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.holiday-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-dim);
  box-shadow: var(--shadow-md);
}

.holiday-card.holiday-today {
  border: 2px solid var(--success);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.holiday-card.holiday-past {
  opacity: 0.65;
}

.holiday-card-main {
  display: flex;
  gap: 1rem;
}

.holiday-date-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  border: 1px solid var(--primary-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.holiday-date-day {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  font-family: var(--font-heading);
}

.holiday-date-month {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.holiday-info {
  flex: 1;
}

.holiday-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.holiday-local-name {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.holiday-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.holiday-full-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.holiday-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
}

/* ==========================================================================
   Productivity Statistics
   ========================================================================== */
.stats-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stats-charts-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
}

/* Trend Chart */
.trend-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  padding-top: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.trend-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 12%;
  height: 100%;
  justify-content: flex-end;
}

.trend-bar-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
}

.trend-bar-track {
  width: 100%;
  height: 140px;
  background-color: var(--bg-surface-elevated);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.trend-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.trend-bar-group.is-today .trend-bar-fill {
  background: linear-gradient(180deg, #38bdf8 0%, var(--primary) 100%);
  box-shadow: 0 0 12px var(--primary-glow);
}

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

/* Category & Priority Breakdowns */
.category-stat-row {
  margin-bottom: 1rem;
}

.cat-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.cat-stat-numbers {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.progress-bar-track {
  height: 8px;
  background-color: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  transition: width 0.5s ease;
}

.progress-cat-work { background-color: #818cf8; }
.progress-cat-personal { background-color: #f472b6; }
.progress-cat-study { background-color: #c084fc; }
.progress-cat-health { background-color: #34d399; }
.progress-cat-finance { background-color: #2dd4bf; }

.priority-stacked-bar {
  display: flex;
  height: 14px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background-color: var(--bg-surface-elevated);
}

.p-stack-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.segment-urgent { background-color: #f87171; }
.segment-high { background-color: #fbbf24; }
.segment-medium { background-color: #60a5fa; }
.segment-low { background-color: #94a3b8; }

.priority-legend {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.p-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.p-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.color-urgent { background-color: #f87171; }
.color-high { background-color: #fbbf24; }
.color-medium { background-color: #60a5fa; }
.color-low { background-color: #94a3b8; }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform var(--transition-bounce);
}

.modal-dialog-sm {
  max-width: 440px;
}

.modal-backdrop.is-open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.5rem 1.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem 1.75rem;
}

.modal-footer {
  padding: 1rem 1.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
}

/* Task Details Modal Content */
.task-detail-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.task-detail-title {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.task-detail-desc {
  background: var(--bg-surface-elevated);
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.task-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
}

.detail-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   Toasts & Alerts
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.toast-enter {
  transform: translateX(100%);
  opacity: 0;
}

.toast-exit {
  transform: translateX(100%);
  opacity: 0;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--success); color: #ffffff; }
.toast-error .toast-icon { background: var(--danger); color: #ffffff; }
.toast-warning .toast-icon { background: var(--warning); color: #ffffff; }
.toast-info .toast-icon { background: var(--info); color: #ffffff; }

.toast-content {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
}

.toast-close {
  color: var(--text-dim);
  font-size: 1.25rem;
  padding: 0.2rem;
  line-height: 1;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  width: 100%;
  animation: toast-countdown linear forwards;
}

@keyframes toast-countdown {
  from { width: 100%; }
  to { width: 0%; }
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.alert-info {
  background: var(--primary-subtle);
  border: 1px solid var(--primary-glow);
  color: var(--text-main);
}

/* ==========================================================================
   Empty States
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.empty-state-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 360px;
  margin-bottom: 1rem;
}

/* Mobile-only header elements hidden on desktop */
.sidebar-close-btn {
  display: none;
}

.mobile-header-brand {
  display: none;
}

/* Settings Backup Actions */
.settings-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.settings-backup-actions #settings-clear-data-btn {
  margin-left: auto;
}
