/* ============================================
   POMODORO TIMER — Premium Glassmorphism Design
   ============================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  --glass-blur: 24px;
  --ring-stroke: 7px;

  /* Static mode colors (used by history dots etc.) */
  --focus-color: #a78bfa;
  --break-color: #34d399;
  --long-break-color: #fb923c;
  --focus-glow: rgba(167, 139, 250, 0.3);
  --break-glow: rgba(52, 211, 153, 0.3);
  --long-break-glow: rgba(251, 146, 60, 0.3);

  /* Aliases → the active mode's accent (kept for all component CSS) */
  --active-color: var(--accent);
  --active-glow: var(--glow);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Themes ---------- */
[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.62);
  --text-tertiary: rgba(240, 240, 245, 0.35);
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-border-hover: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --kbd-bg: rgba(255, 255, 255, 0.08);
  --ring-track: rgba(255, 255, 255, 0.08);
  --modal-bg: rgba(18, 18, 28, 0.85);
  --btn-text: #ffffff;
}

[data-theme="light"] {
  --bg-primary: #eef0f8;
  --bg-secondary: #eeeef5;
  --text-primary: #1a1a2e;
  --text-secondary: rgba(26, 26, 46, 0.62);
  --text-tertiary: rgba(26, 26, 46, 0.38);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-hover: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-border-hover: rgba(26, 26, 46, 0.15);
  --glass-shadow: 0 20px 60px rgba(80, 80, 140, 0.14);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --kbd-bg: rgba(26, 26, 46, 0.06);
  --ring-track: rgba(26, 26, 46, 0.08);
  --modal-bg: rgba(255, 255, 255, 0.85);
  --btn-text: #ffffff;
}

/* ---------- Per-mode accent + ambient orbs ---------- */
[data-mode="focus"]      { --accent: #a78bfa; --glow: rgba(167,139,250,0.35); --orb1: #2c1157; --orb2: #12265e; --orb3: #171736; }
[data-mode="shortBreak"] { --accent: #34d399; --glow: rgba(52,211,153,0.35); --orb1: #084d33; --orb2: #0d3a54; --orb3: #10282c; }
[data-mode="longBreak"]  { --accent: #fb923c; --glow: rgba(251,146,60,0.35); --orb1: #4d2c08; --orb2: #54221d; --orb3: #2e2610; }
[data-theme="light"][data-mode="focus"]      { --orb1: #ddd3fb; --orb2: #cfe0fb; --orb3: #e8e6fa; }
[data-theme="light"][data-mode="shortBreak"] { --orb1: #bff0dc; --orb2: #c5ecfa; --orb3: #ddf7ec; }
[data-theme="light"][data-mode="longBreak"]  { --orb1: #fbe3c9; --orb2: #fbd9d3; --orb3: #f7f0d3; }

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh; /* iOS: viewport real, sem o pulo da barra do Safari */
  overflow: hidden;
  position: relative;
  transition: background 0.6s ease;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, a {
  touch-action: manipulation; /* remove o delay de double-tap-zoom no iOS */
}

/* ---------- Ambient Background Orbs ---------- */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-gradient .bg-orb {
  position: absolute;
  border-radius: 43% 57% 41% 59% / 57% 45% 55% 43%;
  transition: background 1.2s ease;
  animation: float 26s ease-in-out infinite, morph 18s ease-in-out infinite;
}

.bg-gradient .bg-orb:nth-child(1) {
  width: 620px; height: 620px; top: -220px; right: -120px;
  background: var(--orb1); filter: blur(130px); opacity: 0.75;
}

.bg-gradient .bg-orb:nth-child(2) {
  width: 520px; height: 520px; bottom: -180px; left: -120px;
  background: var(--orb2); filter: blur(120px); opacity: 0.65;
  animation-duration: 30s; animation-direction: reverse;
}

.bg-gradient .bg-orb:nth-child(3) {
  width: 420px; height: 420px; top: 42%; left: 38%;
  background: var(--orb3); filter: blur(110px); opacity: 0.5;
  animation-duration: 22s; animation-delay: -8s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -50px) scale(1.06); }
  50% { transform: translate(-30px, 25px) scale(0.95); }
  75% { transform: translate(50px, 35px) scale(1.03); }
}

@keyframes morph {
  0%, 100% { border-radius: 43% 57% 41% 59% / 57% 45% 55% 43%; }
  33% { border-radius: 70% 30% 52% 48% / 60% 40% 60% 40%; }
  66% { border-radius: 50% 50% 30% 70% / 50% 60% 40% 50%; }
}

/* ---------- Main Container ---------- */
.app-container {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

/* ---------- Header ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  transition: background 0.5s;
}

/* ---------- Main grid (2 columns) ---------- */
.main-grid {
  flex: 1;
  min-height: 420px;
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 20px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Today card */
.today-card {
  border-radius: 22px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--inset);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.today-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.today-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.today-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.today-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ---------- Top Bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.top-actions {
  display: flex;
  gap: 8px;
  min-width: 220px;
  justify-content: flex-end;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.icon-btn:active { transform: translateY(0) scale(0.96); }
#btnSettings:hover { transform: translateY(-1px) rotate(20deg); }

/* Theme icon swap */
.ic { display: none; }
[data-theme="dark"] .ic-moon { display: block; }
[data-theme="light"] .ic-sun { display: block; }

/* ---------- Mode Tabs ---------- */
.mode-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--inset);
}

.mode-tab {
  padding: 9px 22px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.mode-tab:hover { color: var(--text-primary); }

.mode-tab.active {
  background: var(--accent);
  color: var(--btn-text);
  box-shadow: 0 4px 16px var(--glow);
  font-weight: 600;
}

/* ---------- Timer Card ---------- */
.timer-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--inset);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vh, 26px);
  padding: clamp(16px, 3vh, 28px) 28px 14px;
}

/* Specular highlight */
.timer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

/* ---------- Progress Ring ---------- */
.timer-ring-container {
  position: relative;
  width: min(300px, 36vh);
  height: min(300px, 36vh);
}

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

.timer-ring-bg {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: var(--ring-stroke);
}

.timer-ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: var(--ring-stroke);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s linear, stroke 0.5s ease;
  filter: drop-shadow(0 0 10px var(--glow));
}

.timer-display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.timer-time {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vh, 76px);
  font-weight: 600;
  letter-spacing: -3px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-primary);
}

.timer-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ---------- Controls ---------- */
.controls {
  display: flex;
  gap: 14px;
  align-items: center;
}

.btn-primary {
  padding: 15px 56px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: var(--btn-text);
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  min-width: 180px;
  box-shadow: 0 6px 28px var(--glow);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px var(--glow);
}

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

.btn-secondary {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

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

.btn-secondary:active { transform: translateY(0) scale(0.96); }

/* ---------- Session Dots ---------- */
.session-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-text {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.session-dots {
  display: flex;
  gap: 8px;
}

.session-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--glass-border);
  transition: all var(--transition-normal);
}

.session-dot.completed {
  background: var(--active-color);
  box-shadow: 0 0 8px var(--active-glow);
}

.session-dot.current {
  background: var(--active-color);
  box-shadow: 0 0 8px var(--active-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ---------- Timer Card Footer ---------- */
.timer-card-footer {
  width: 100%;
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-tertiary);
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  border-radius: 2px;
  background: var(--ring-track);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.volume-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.stats-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.stats-btn:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

/* ---------- Modal Overlay ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 90%;
  max-width: 480px;
  max-height: calc(100vh - 120px);
  border-radius: 24px;
  background: var(--modal-bg);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-normal);
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal::-webkit-scrollbar {
  width: 6px;
}

.modal::-webkit-scrollbar-track {
  background: transparent;
}

.modal::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

/* Specular highlight */
.modal::before {
  content: '';
  position: sticky;
  top: 0;
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px 28px 28px;
}

/* ---------- Settings Form ---------- */
.settings-group {
  margin-bottom: 24px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.setting-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.setting-label .icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.setting-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.number-input {
  width: 64px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: all var(--transition-fast);
  -moz-appearance: textfield;
}

.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.number-input:focus {
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px var(--active-glow);
}

.setting-unit {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: var(--glass-border);
  transition: all var(--transition-normal);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: all var(--transition-normal);
}

.toggle input:checked + .toggle-slider {
  background: var(--active-color);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #fff;
}

/* Select */
.select-input {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(240,240,245,0.5)' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

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

.select-input option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px 16px;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--active-color);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 4px;
}

/* Weekly Chart */
.weekly-chart {
  margin-top: 8px;
}

.chart-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.chart-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 100px;
  gap: 8px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.chart-bar-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 100%;
  max-width: 32px;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  background: var(--active-color);
  opacity: 0.6;
  transition: all var(--transition-normal);
}

.chart-bar.today {
  opacity: 1;
  box-shadow: 0 0 8px var(--active-glow);
}

.chart-day {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
}

.chart-day.today {
  color: var(--active-color);
}

/* ---------- Keyboard Shortcuts Info ---------- */
.shortcuts-info {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.shortcut kbd {
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  font-family: var(--font-primary);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------- Notification Toast ---------- */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 200;
  padding: 14px 24px;
  border-radius: 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: transform var(--transition-normal);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */

/* Narrow window: stack the two columns; the page scrolls. */
@media (max-width: 900px) {
  .app-container { padding: 20px 20px 16px; }
  .top-bar { flex-wrap: wrap; }
  .brand, .top-actions { min-width: 0; }
  .main-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .sidebar { min-height: 0; }
  .tasks-panel { min-height: 320px; }
}

/* ---------- Mobile (phones) ---------- */
@media (max-width: 640px) {
  body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-container {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    gap: 14px;
    /* Safe areas: notch em cima, home indicator embaixo */
    padding: calc(12px + env(safe-area-inset-top, 0px))
             calc(14px + env(safe-area-inset-right, 0px))
             calc(20px + env(safe-area-inset-bottom, 0px))
             calc(14px + env(safe-area-inset-left, 0px));
  }

  /* Header: marca + ações na 1ª linha, abas em linha própria ocupando tudo */
  .top-bar { gap: 12px; }
  .brand { order: 1; flex: 1; }
  .top-actions { order: 2; }
  .mode-tabs { 
    order: 3; 
    width: 100%;
    padding: 3px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  .mode-tab {
    flex: 1;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-radius: 11px;
    transition: all var(--transition-normal);
  }
  .mode-tab.active {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff;
  }

  /* Timer: iOS Liquid Glass */
  .main-grid { min-height: 0; gap: 14px; }
  .timer-card {
    padding: 24px 18px 16px;
    gap: 18px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.015) 100%);
    backdrop-filter: blur(40px) saturate(210%);
    -webkit-backdrop-filter: blur(40px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 0 50px -15px var(--active-glow);
  }
  .timer-ring-container {
    width: min(72vw, 300px);
    height: min(72vw, 300px);
  }
  .timer-time { 
    font-size: clamp(48px, 16vw, 72px); 
    letter-spacing: -2px;
    font-weight: 800;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  }

  /* Controles: alvos de toque maiores (mín. 44px) com animações squishy */
  .controls { width: 100%; justify-content: center; gap: 14px; }
  .btn-primary { 
    flex: 1; 
    max-width: 260px; 
    min-width: 0; 
    padding: 15px 20px; 
    font-size: 16px;
    font-weight: 700;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--active-color) 0%, rgba(255, 255, 255, 0.25) 160%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 28px var(--active-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, background 0.3s ease;
  }
  .btn-primary:active {
    transform: scale(0.94);
    box-shadow: 0 4px 12px var(--active-glow);
  }
  .btn-secondary { 
    width: 54px; 
    height: 54px; 
    flex-shrink: 0; 
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, background 0.2s ease;
  }
  .btn-secondary:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.1);
  }
  .icon-btn { 
    width: 44px; 
    height: 44px; 
    border-radius: 12px;
    transition: transform 0.2s ease;
  }
  .icon-btn:active {
    transform: scale(0.92);
  }

  .timer-card-footer { flex-wrap: wrap; justify-content: center; gap: 12px; }
  .volume-slider { width: 110px; }
  .stats-btn { padding: 10px 18px; }

  /* Modais viram bottom-sheets fluidos com abas de arrastar estilo iOS */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .modal {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 48px);
    border-radius: 32px 32px 0 0;
    background: rgba(12, 12, 20, 0.72);
    backdrop-filter: blur(40px) saturate(210%);
    -webkit-backdrop-filter: blur(40px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.4);
    padding-top: 24px;
    position: relative;
  }
  /* iOS Top Handle for Bottom Sheets */
  .modal::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.25);
  }
  .modal-body {
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  /* iOS dá zoom automático em inputs < 16px — evita isso */
  .number-input, .task-add-input, .select-input { font-size: 16px; }

  .shortcuts-info { display: none; } /* sem teclado físico */
  .tasks-panel { min-height: 280px; }
  .toast {
    top: calc(12px + env(safe-area-inset-top, 0px));
    max-width: calc(100vw - 28px);
    white-space: normal;
    text-align: center;
  }
  body.zen-mode .zen-exit {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 16px;
    opacity: 1; /* sem mouse para "acordar" o botão — deixa sempre visível */
  }
  body.zen-mode .app-container { height: 100dvh; min-height: 0; }
}

/* PWA instalado (standalone): nada de barra do navegador */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}

/* ---------- Zen Mode (timer-only fullscreen) ---------- */
/* Hide everything that isn't the timer; enlarge and center it. */
.zen-exit {
  display: none;
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 50;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.35s ease, color 0.2s ease, transform 0.2s ease;
}
.zen-exit:hover { color: var(--text-primary); transform: scale(1.06); }

body.zen-mode .zen-exit { display: flex; }
/* Fade the exit button in only on mouse activity, so the screen stays clean */
body.zen-mode.zen-active .zen-exit { opacity: 1; }

body.zen-mode .top-bar,
body.zen-mode .sidebar,
body.zen-mode .shortcuts-info,
body.zen-mode .timer-card-footer,
body.zen-mode .controls .btn-secondary,
body.zen-mode .session-text {
  display: none !important;
}

body.zen-mode .app-container {
  height: 100vh;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.zen-mode .main-grid {
  grid-template-columns: 1fr;
  width: 100%;
  min-height: 0;
  place-items: center;
}

body.zen-mode .timer-card {
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  gap: clamp(24px, 5vh, 48px);
  transform: scale(1);
}
body.zen-mode .timer-card::before { display: none; }

body.zen-mode .timer-ring-container {
  width: min(560px, 72vh);
  height: min(560px, 72vh);
}

body.zen-mode .timer-time {
  font-size: clamp(72px, 18vh, 180px);
}

body.zen-mode .session-indicator {
  opacity: 0.7;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---------- Task Input ---------- */
.task-input-wrapper {
  width: 100%;
}

.task-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  outline: none;
  transition: all var(--transition-fast);
}

.task-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.task-input:focus {
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px var(--active-glow);
  background: var(--glass-bg-hover);
}

/* ---------- Bottom Actions ---------- */
.bottom-actions {
  display: flex;
  gap: 8px;
}

/* ---------- Tasks Panel (sidebar card) ---------- */
.tasks-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 22px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--inset);
  padding: 18px 20px;
  overflow: hidden;
}

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.tasks-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
}

.tasks-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tasks-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tasks-collapse {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform var(--transition-fast);
}

.tasks-board-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 2px;
  transition: color var(--transition-fast);
}

.tasks-board-btn:hover {
  color: var(--active-color);
}

.tasks-panel.collapsed .tasks-collapse {
  transform: rotate(-90deg);
}

.tasks-panel.collapsed .tasks-body {
  display: none;
}

.tasks-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-add {
  display: flex;
  gap: 8px;
}

.task-add-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.88rem;
  outline: none;
  transition: all var(--transition-fast);
}

.task-add-input::placeholder {
  color: var(--text-tertiary);
}

.task-add-input:focus {
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px var(--active-glow);
}

.task-add-btn {
  width: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.task-add-btn:hover {
  background: var(--active-color);
  color: #fff;
  border-color: transparent;
}

.task-list {
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.task-list::-webkit-scrollbar {
  width: 5px;
}

.task-list::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--transition-fast);
}

.task-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.task-item .task-check,
.task-item .task-pomos,
.task-item .task-del {
  margin-top: 1px;
}

.task-item:hover {
  background: var(--glass-bg-hover);
}

.task-item.active {
  border-left-color: var(--active-color);
  background: var(--glass-bg-hover);
}

.task-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid var(--glass-border-hover);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition-fast);
}

.task-check:hover {
  border-color: var(--active-color);
}

.task-check::after {
  content: '✓';
  font-size: 0.7rem;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.task-item.done .task-check {
  background: var(--active-color);
  border-color: var(--active-color);
}

.task-item.done .task-check::after {
  opacity: 1;
}

.task-text {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item.done .task-text {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.task-pomos {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  border: none;
  background: transparent;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all var(--transition-fast);
}

.task-pomos:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

.task-del {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0;
  transition: all var(--transition-fast);
}

.task-item:hover .task-del {
  opacity: 1;
}

.task-del:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ---------- Task Stages (pipeline) ---------- */
.task-stages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.stage-chip {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all var(--transition-fast);
}

.stage-chip:hover {
  border-color: var(--active-color);
  color: var(--text-secondary);
}

.stage-chip.done {
  background: var(--active-color);
  border-color: transparent;
  color: #fff;
}

.task-due {
  font-size: 0.66rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.task-note {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Batch view: filter tasks by pending stage */
.task-stage-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.sf-chip {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-primary);
  transition: all var(--transition-fast);
}

.sf-chip:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.sf-chip.active {
  background: var(--active-color);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--active-glow);
}

.task-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 4px;
  margin-top: 6px;
  cursor: default;
}

.task-section:first-child {
  margin-top: 0;
}

.task-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--active-color);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-edit {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--active-color);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  outline: none;
}

.task-section .task-del {
  opacity: 0;
}

.task-section:hover .task-del {
  opacity: 1;
}

.tasks-empty {
  padding: 14px 8px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  cursor: default;
}

.tasks-clear {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tasks-clear:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

.tasks-addsection {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed var(--glass-border);
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tasks-addsection:hover {
  color: var(--active-color);
  border-color: var(--active-color);
}

/* ---------- Pipeline (stages) editor ---------- */
.pipeline-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.pl-empty {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  padding: 6px 2px;
}

.pl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.pl-key {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--active-color);
  padding: 2px 7px;
  border-radius: 6px;
}

.pl-label {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.pl-btn:hover:not(:disabled) {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.pl-btn:disabled { opacity: 0.3; cursor: default; }
.pl-btn.on { background: var(--active-color); color: #fff; }
.pl-btn.pl-del:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.pipeline-add {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Board column management ---------- */
.board-col-title { display: flex; align-items: center; gap: 8px; }

.board-col-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.board-col:hover .board-col-actions { opacity: 1; }

.board-col-add {
  flex: 0 0 200px;
  background: transparent;
  border: 1px dashed var(--glass-border);
  align-items: stretch;
  justify-content: flex-start;
}

.board-addcol {
  margin: 10px;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.board-addcol:hover { color: var(--active-color); background: var(--glass-bg-hover); }

/* ---------- History Modal (Large) ---------- */
.modal-lg {
  max-width: 540px;
}

/* ---------- History View Toggle ---------- */
.history-views {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.history-view {
  flex: 1;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-view:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.history-view.active {
  background: var(--active-color);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px var(--active-glow);
}

/* ---------- History Filters ---------- */
.history-filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  margin-bottom: 20px;
}

.history-filter {
  flex: 1;
  padding: 8px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-filter:hover {
  color: var(--text-primary);
}

.history-filter.active {
  background: var(--active-color);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--active-glow);
}

/* ---------- History Summary Bar ---------- */
.history-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.history-summary-item {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.history-summary-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--active-color);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.history-summary-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ---------- History List ---------- */
.history-list {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.history-list::-webkit-scrollbar {
  width: 5px;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

/* Date Header */
.history-date-header {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  padding: 12px 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 4px;
  position: sticky;
  top: 0;
  background: transparent;
  z-index: 1;
}

.history-date-header:first-child {
  padding-top: 0;
}

/* Session Item */
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}

.history-item:hover {
  background: var(--glass-bg);
  border-radius: 10px;
}

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

/* Timeline dot */
.history-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--active-color);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--active-glow);
}

.history-dot.break {
  background: var(--break-color);
  box-shadow: 0 0 6px var(--break-glow);
}

/* Item content */
.history-item-content {
  flex: 1;
  min-width: 0;
}

.history-item-task {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.history-item-task.untitled {
  color: var(--text-tertiary);
  font-style: italic;
}

.history-item-meta {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.history-item-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Duration badge */
.history-item-duration {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--active-color);
  font-variant-numeric: tabular-nums;
}

/* Delete button */
.history-item-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  transition: all var(--transition-fast);
}

.history-item:hover .history-item-delete {
  opacity: 1;
}

.history-item-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Empty state */
.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  gap: 12px;
}

.history-empty-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

/* ---------- Kanban Board ---------- */
.modal-board {
  width: min(1140px, 96vw);
  max-width: none;
  height: 88vh;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.board {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding: 12px 24px 24px;
  overflow-x: auto;
  overflow-y: hidden;
}

.board-empty {
  margin: auto;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.board-col {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.board-col.drop {
  border-color: var(--active-color);
  box-shadow: 0 0 0 2px var(--active-glow);
}

.board-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--active-color);
}

.board-col-count {
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.board-col-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.board-col-body::-webkit-scrollbar { width: 5px; }
.board-col-body::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

.board-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--glass-bg-hover);
  border: 1px solid var(--glass-border);
  border-left: 2px solid transparent;
  cursor: grab;
  transition: border-color var(--transition-fast), opacity var(--transition-fast);
}

.board-card:hover { border-color: var(--glass-border-hover); }
.board-card:active { cursor: grabbing; }
.board-card.dragging { opacity: 0.45; }
.board-card.active { border-left-color: var(--active-color); }

.bc-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bc-title {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--text-primary);
  word-break: break-word;
}

.board-card.done .bc-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.board-card .task-del { opacity: 0.5; }
.board-card:hover .task-del { opacity: 1; }

.board-add {
  padding: 8px 10px 10px;
}

.board-add input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.82rem;
  outline: none;
  transition: all var(--transition-fast);
}

.board-add input::placeholder { color: var(--text-tertiary); }

.board-add input:focus {
  border-color: var(--active-color);
  background: var(--glass-bg);
}

/* ---------- Overtime ---------- */
.timer-time.overtime {
  color: var(--active-color);
  animation: overtime-pulse 1.6s ease-in-out infinite;
}

@keyframes overtime-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ---------- Data Buttons ---------- */
.data-btn {
  width: auto;
  height: auto;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-family: var(--font-primary);
  font-weight: 500;
}

/* Clear History Button */
.history-clear-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.06);
  color: rgba(239, 68, 68, 0.7);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-clear-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

