/* ========= BUTTONS ========= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 15px;
  min-height: 48px;
  padding: 14px 24px;
  transition: background 150ms ease, transform 100ms ease, opacity 150ms ease;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover { background: var(--bg-surface-hover); }

.btn-ghost {
  background: transparent;
  color: var(--accent-text);
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-ghost:hover { background: var(--accent-subtle); }

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-icon {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 20px;
}

.btn-icon:hover { background: var(--bg-surface-hover); }

.btn-full { width: 100%; }

.btn-lg { min-height: 56px; font-size: 16px; }

/* ========= CARDS ========= */

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-default);
  padding: var(--space-base);
}

.card-interactive {
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}

.card-interactive:hover { background: var(--bg-surface-hover); }
.card-interactive:active { transform: scale(0.99); }

/* ========= INPUTS ========= */

.input-text {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 200ms ease;
  outline: none;
}

.input-text:focus {
  border-color: var(--border-active);
}

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

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  height: 56px;
  overflow: hidden;
}

.stepper:focus-within {
  border-color: var(--border-active);
}

.stepper-btn {
  width: 56px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 22px;
  font-weight: 600;
  background: transparent;
  transition: background 150ms ease;
  user-select: none;
  flex-shrink: 0;
}

.stepper-btn:hover { background: var(--bg-surface-hover); }
.stepper-btn:active { background: var(--bg-surface); }

.stepper-value {
  flex: 1;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  padding: 0;
}

.stepper-value::-webkit-inner-spin-button,
.stepper-value::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.stepper-unit {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: var(--space-base);
  flex-shrink: 0;
}

/* Chips */
.chips {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.chip {
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}

.chip.selected {
  background: var(--accent-subtle);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* ========= DRAWER ========= */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: var(--bg-surface-raised);
  border-radius: var(--radius-drawer) var(--radius-drawer) 0 0;
  box-shadow: var(--shadow-drawer);
  z-index: 201;
  transition: transform 250ms ease-out;
  overflow-y: auto;
  padding: 0 20px 24px;
}

.drawer.open {
  transform: translateX(-50%) translateY(0);
}

.drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: 2px;
  margin: 12px auto 16px;
}

.drawer-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-base);
}

.drawer-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: -12px;
  margin-bottom: var(--space-base);
}

/* ========= TOAST ========= */

.toast-container {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 300;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-raised);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  border-left: 3px solid var(--text-secondary);
  transform: translateY(-20px);
  opacity: 0;
  transition: all 200ms ease;
  pointer-events: auto;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }

.toast-action {
  margin-left: auto;
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ========= TIMER ========= */

.session-timer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-base);
  height: 44px;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--timer-active);
  font-size: 15px;
  transition: border-color 300ms ease, background 300ms ease;
}

.session-timer.warning {
  border-bottom-color: var(--timer-warning);
}

.session-timer.done {
  border-bottom-color: var(--timer-done);
  animation: timerPulse 1s ease 3;
}

@keyframes timerPulse {
  0%, 100% { background: var(--bg-surface); }
  50% { background: rgba(52, 211, 153, 0.08); }
}

.session-timer .timer-icon {
  font-size: 18px;
}

.session-timer .timer-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.session-timer .timer-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.session-timer .timer-actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-xs);
}

/* ========= STATUS ICONS ========= */

.status-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-pending { color: var(--text-tertiary); }
.status-in_progress { color: var(--accent); }
.status-completed { color: var(--success); }
.status-skipped { color: var(--text-disabled); }

/* ========= PROGRESS BAR ========= */

.progress-bar {
  height: 3px;
  background: var(--border-default);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 300ms ease;
  border-radius: 2px;
}

.progress-bar-fill.complete {
  background: var(--success);
}

/* Segmented progress */
.progress-segments {
  display: flex;
  gap: 2px;
  height: 3px;
}

.progress-segment {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: var(--border-default);
  transition: background 300ms ease;
}

.progress-segment.completed { background: var(--success); }
.progress-segment.active { background: var(--accent); }

/* ========= UTILITY ========= */

.label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: var(--space-xs);
}

.field {
  margin-bottom: var(--space-base);
}

.divider {
  height: 1px;
  background: var(--border-divider);
  margin: var(--space-base) 0;
}

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-accent { color: var(--accent); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background: var(--accent-subtle);
  color: var(--accent-text);
}

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

.badge-archived {
  background: var(--bg-surface-hover);
  color: var(--text-tertiary);
}

.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: var(--space-lg);
}
