@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

/* ==============================================
   ITCSS ARCHITECTURE
   1. Settings – Variablen & Config
   2. Generic – Reset & Global
   3. Elements – HTML-Elemente
   4. Components – UI-Komponenten
   5. Utilities – Helper-Klassen
   ============================================== */

/* ==============================================
   1. SETTINGS – Design Tokens
   ============================================== */

:root {
  color-scheme: dark;

  /* Breakpoints */
  --breakpoint-mobile: 640px;
  --breakpoint-tablet: 768px;

  /* Typography */
  --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Brand Colors */
  --brand-red: #FF5252;

  /* Dark Theme (Default) */
  --bg-app: #2A2829;
  --bg-glass: rgba(54, 52, 53, 0.65);
  --bg-glass-hover: rgba(68, 66, 67, 0.75);
  --bg-modal: rgba(42, 40, 41, 0.96);
  --border-glass: rgba(187, 187, 187, 0.18);
  --border-glass-focus: rgba(255, 82, 82, 0.5);
  --text-primary: #FFFFFF;
  --text-secondary: #BBBBBB;
  --text-muted: #A8A8A8;

  /* Shadows */
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 16px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

  /* Priority & Status Colors */
  --color-priority-low: #38bdf8;
  --color-priority-medium: #fb923c;
  --color-priority-high: #ff5252;
  --color-success: #FF5252;
  --color-warning: #f59e0b;
  --color-active-green: #10b981;

  /* Effects */
  --blur-amount: blur(16px);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-normal: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-slow: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Mobile UX */
  --touch-target-min: 44px;
  --touch-spacing: 8px;
  --bottom-bar-height: 64px;
  --bottom-bar-safe-area: calc(64px + env(safe-area-inset-bottom));
  --fab-size: 56px;
  --fab-margin: 16px;
  --sheet-handle-width: 32px;
  --sheet-handle-height: 4px;
  --sheet-max-height: 90vh;
}

/* Light Theme */
[data-theme="light"] {
  color-scheme: light;
  --bg-app: #F2F2F2;
  --bg-glass: rgba(255, 255, 255, 0.75);
  --bg-glass-hover: rgba(255, 255, 255, 0.9);
  --bg-modal: rgba(255, 255, 255, 0.98);
  --border-glass: rgba(42, 40, 41, 0.12);
  --border-glass-focus: rgba(255, 82, 82, 0.6);
  --text-primary: #000000;
  --text-secondary: #2A2829;
  --text-muted: #595959;
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 16px -6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

/* ==============================================
   2. GENERIC – Reset & Global
   ============================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, rgba(255, 82, 82, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(187, 187, 187, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(255, 82, 82, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: rgba(255, 82, 82, 0.1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==============================================
   3. ELEMENTS – HTML-Basiselemente
   ============================================== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

select option {
  background-color: var(--bg-modal);
  color: var(--text-primary);
}

input[type="date"],
input[type="time"] {
  position: relative;
  font-family: var(--font-family);
  color: var(--text-primary);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  background: transparent;
  cursor: pointer;
  filter: invert(1);
  opacity: 0.5;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.9;
  transform: scale(1.1);
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  width: auto;
  height: auto;
  touch-action: manipulation;
}

/* ==============================================
   4. COMPONENTS – UI-Komponenten
   ============================================== */

/* App Container */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
}

/* Glass Panel */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal), border var(--transition-normal);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: var(--touch-target-min);
}

.btn:active {
  transform: scale(0.98);
  transition-duration: 0.05s;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-red), #d63031);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 82, 82, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 82, 82, 0.3);
}

.btn-primary:active {
  transform: scale(0.98) translateY(1px);
  box-shadow: 0 2px 10px rgba(255, 82, 82, 0.2);
  filter: brightness(0.95);
}

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

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

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

.btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 12px;
}

.btn-icon:active,
.btn-mini:active {
  transform: scale(0.92);
}

.btn-danger {
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(255, 82, 82, 0.25);
  border-color: rgba(255, 82, 82, 0.5);
}

.btn-mini {
  padding: 0.3rem;
  min-width: 36px;
  min-height: 36px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  touch-action: manipulation;
}

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

.btn-mini.btn-mini-active {
  background: rgba(255, 82, 82, 0.15);
  border-color: var(--brand-red);
  color: var(--brand-red);
  animation: pulse-border 1.5s infinite;
}

.btn-mini.btn-mini-danger:hover {
  background: rgba(255, 82, 82, 0.15);
  border-color: rgba(255, 82, 82, 0.3);
  color: var(--color-priority-high);
}

/* Ripple Touch Feedback */
@media (hover: none) and (pointer: coarse) {
  .btn {
    position: relative;
    overflow: hidden;
  }

  .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
  }

  .btn:active::before {
    width: 300px;
    height: 300px;
  }
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.brand-icon {
  background: linear-gradient(135deg, var(--brand-red), #d63031);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 82, 82, 0.3);
  color: #fff;
}

.brand-icon svg,
.brand-icon .material-symbols-outlined {
  width: 24px;
  height: 24px;
  font-size: 24px;
}

.brand h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Active Timer Widget */
.active-timer-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-red);
  transition: all var(--transition-normal);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
}

.active-timer-widget.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.active-timer-pulse {
  width: 10px;
  height: 10px;
  background-color: var(--brand-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--brand-red);
  animation: pulse 1.5s infinite;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.stat-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

#stat-today-time {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

/* Chart Panel */
.chart-panel {
  display: flex;
  flex-direction: column;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.chart-title-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-chevron {
  font-size: 18px !important;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  display: inline-block;
}

.chart-chevron.expanded {
  transform: rotate(180deg);
}

.chart-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-normal);
}

.chart-body.expanded {
  grid-template-rows: 1fr;
}

.chart-body-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 1rem;
}

.chart-total {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.css-chart-bar-container {
  width: 100%;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  display: flex;
  border: 1px solid var(--border-glass);
}

.css-chart-bar-segment {
  height: 100%;
  transition: width var(--transition-slow) ease-in-out;
  position: relative;
  cursor: pointer;
}

.css-chart-bar-segment:first-child {
  border-top-left-radius: 99px;
  border-bottom-left-radius: 99px;
}

.css-chart-bar-segment:last-child {
  border-top-right-radius: 99px;
  border-bottom-right-radius: 99px;
}

.css-chart-bar-segment:hover {
  filter: saturate(1.4) brightness(1.2);
}

.css-chart-bar-segment::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #000000;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.css-chart-bar-segment:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.legend-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.legend-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.legend-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.legend-progress-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.legend-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width var(--transition-slow);
}

.no-data-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem 0;
  font-size: 0.875rem;
  font-style: italic;
}

/* Controls Panel */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

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

.search-box svg,
.search-box .material-symbols-outlined {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  min-height: var(--touch-target-min);
}

.input-field:focus {
  outline: none;
  border-color: var(--border-glass-focus);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.15);
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.select-field {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.625rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  min-height: var(--touch-target-min);
}

.select-field:focus {
  border-color: var(--border-glass-focus);
}

.select-field:active {
  background: var(--bg-glass-hover);
  transform: scale(0.99);
  transition-duration: 0.05s;
}

/* Task List */
.tasks-grid {
  position: relative;
}

#tasks-container-wrapper > div.active {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  box-shadow: var(--shadow-md);
}

.task-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: visible;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border-glass);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  transition: border-left-color var(--transition-fast), background var(--transition-fast);
}

.task-card:last-child {
  border-bottom: none;
}

.task-card.prio-low { border-left-color: var(--color-priority-low); }
.task-card.prio-medium { border-left-color: var(--color-priority-medium); }
.task-card.prio-high { border-left-color: var(--color-priority-high); }

.task-card.active-timer {
  border-left-color: var(--brand-red) !important;
  background: rgba(255, 82, 82, 0.03);
}

.task-card.active-timer .task-card-header::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 40%;
  min-height: 20px;
  max-height: 32px;
  background: var(--brand-red);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--brand-red);
  animation: pulse-bar 1.5s ease-in-out infinite;
}

.task-card.completed-task {
  opacity: 0.55;
  border-left-color: var(--border-glass) !important;
}

/* Swipe Actions */
.task-card-swipe-wrapper {
  position: relative;
  overflow: hidden;
}

.task-card-content {
  position: relative;
  background: var(--bg-glass);
  transition: transform 0.25s var(--ease-out-expo);
  z-index: 2;
  touch-action: pan-y;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.task-card-content.swiping {
  transition: none;
  will-change: transform;
}

.task-card-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.task-card-swipe-wrapper.swipe-active .task-card-actions {
  opacity: 1;
  pointer-events: auto;
}

.task-swipe-action {
  height: 100%;
  min-height: 44px;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: width var(--transition-fast);
  border: none;
  outline: none;
  touch-action: manipulation;
}

.task-swipe-action .material-symbols-outlined {
  font-size: 24px;
}

.task-swipe-action-delete {
  background: linear-gradient(135deg, #ff5252, #d63031);
}

.task-swipe-action-edit {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.task-swipe-action-duplicate {
  background: linear-gradient(135deg, #fb923c, #f97316);
}

.task-card-swipe-indicator {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 40%;
  min-height: 32px;
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transition: opacity var(--transition-fast), width var(--transition-fast);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

/* Task Header */
.task-card-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1.25rem 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  min-height: 56px;
  transition: background var(--transition-fast);
}

.task-card-header:hover {
  background: rgba(255, 255, 255, 0.025);
}

.task-card-header:active {
  background: rgba(255, 255, 255, 0.04);
  transform: scale(0.995);
}

.task-card-header-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.task-card-header-main .task-title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  max-width: 55%;
}

.task-card-header-main .task-badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  overflow: hidden;
  flex-shrink: 1;
}

.task-card-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.task-card-header-meta .task-swipe-hint-icon {
  display: none;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.task-card-time {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.task-card.active-timer .task-card-time {
  color: var(--brand-red);
}

.task-card.active-timer .task-card-time .material-symbols-outlined {
  animation: spin 3s linear infinite;
}

.task-header-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.task-header-edit-btn .material-symbols-outlined {
  font-size: 17px;
  color: var(--text-muted);
}

.task-header-edit-btn:hover .material-symbols-outlined {
  color: var(--text-primary);
}

.task-card-chevron {
  font-size: 18px !important;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

.task-card-chevron.expanded {
  transform: rotate(180deg);
}

/* Task Body */
.task-card-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-normal), border-color var(--transition-normal);
  border-top: 1px solid transparent;
}

.task-card-body.expanded {
  grid-template-rows: 1fr;
  border-top-color: var(--border-glass);
}

.task-card-body-inner {
  overflow: hidden;
  padding: 0 1.25rem 0 1rem;
  transition: padding var(--transition-normal);
}

.task-card-body.expanded .task-card-body-inner {
  padding: 1rem 1.25rem 1rem 1rem;
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.badge-priority-low {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-priority-low);
}

.badge-priority-medium {
  background: rgba(251, 146, 60, 0.15);
  color: var(--color-priority-medium);
}

.badge-priority-high {
  background: rgba(255, 82, 82, 0.15);
  color: var(--color-priority-high);
}

.priority-arrow {
  display: none;
}

.badge-category {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-mini {
  font-size: 0.625rem !important;
  padding: 1px 4px !important;
  border-radius: 4px !important;
  text-transform: none !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  vertical-align: middle;
}

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

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

.checkmark {
  height: 22px;
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.task-status-container:active .checkmark {
  transform: scale(0.92);
  background-color: rgba(255, 255, 255, 0.15);
  transition-duration: 0.05s;
}

.task-status-container:hover input ~ .checkmark {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.task-status-container input:checked ~ .checkmark {
  background-color: var(--brand-red);
  border-color: var(--brand-red);
}

.checkmark svg,
.checkmark .material-symbols-outlined {
  width: 14px;
  height: 14px;
  font-size: 14px;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-status-container input:checked ~ .checkmark svg,
.task-status-container input:checked ~ .checkmark .material-symbols-outlined {
  opacity: 1;
  transform: scale(1);
}

/* Task Content */
.task-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.task-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

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

.task-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Subtasks */
.subtasks-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border-glass);
  padding-top: 0.75rem;
}

.subtasks-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
}

.subtasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.subtask-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 0.8125rem;
  transition: background var(--transition-fast);
  min-height: 48px;
}

.subtask-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.subtask-row.completed-subtask {
  opacity: 0.6;
}

.subtask-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.subtask-checkmark {
  height: 22px;
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 4px;
}

.subtask-checkmark svg,
.subtask-checkmark .material-symbols-outlined {
  width: 12px;
  height: 12px;
  font-size: 12px;
}

.subtask-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtask-row.completed-subtask .subtask-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.subtask-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subtask-time-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.subtask-row.active-subtask-timer .subtask-time-label {
  color: var(--brand-red);
}

.subtask-quick-add {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.subtask-quick-add .input-field {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 8px;
  min-height: 40px;
}

.subtask-quick-add .btn {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  min-height: 40px;
}

/* Important Star */
.task-important-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.task-important-btn .material-symbols-outlined {
  font-size: 20px;
  color: var(--border-glass);
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  transition: color var(--transition-fast), font-variation-settings var(--transition-fast);
}

.task-important-btn:hover .material-symbols-outlined {
  color: #f59e0b;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.task-important-btn.is-important .material-symbols-outlined {
  color: #f59e0b;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.6));
}

.task-important-btn.is-important:hover {
  transform: scale(1.15);
}

.important-toggle-label {
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}

.important-toggle-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.important-toggle-ui {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition-fast);
  width: 100%;
}

.important-toggle-ui .important-star-icon {
  font-size: 18px;
  color: var(--border-glass);
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  transition: all var(--transition-fast);
}

.important-toggle-label input:checked + .important-toggle-ui {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
}

.important-toggle-label input:checked + .important-toggle-ui .important-star-icon {
  color: #f59e0b;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.5));
}

/* Task Footer */
.task-footer {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  border-top: 1px solid var(--border-glass);
  margin-top: 0.75rem;
  padding-top: 0.625rem;
}

.task-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-accumulated-time {
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.task-time-main {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.task-time-main svg,
.task-time-main .material-symbols-outlined {
  font-size: 15px;
  color: var(--text-secondary);
}

.task-time-breakdown {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.task-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.timer-controls-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Manual Time Popup */
.manual-time-anchor {
  position: relative;
  display: inline-block;
  overflow: visible;
}

.manual-time-anchor .btn {
  flex: none;
}

.manual-time-popup {
  position: absolute;
  bottom: 120%;
  right: 0 !important;
  left: auto !important;
  background: var(--bg-modal);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.75rem;
  width: 220px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10;
  backdrop-filter: var(--blur-amount);
}

.manual-time-popup.show {
  display: flex;
}

.subtask-row .manual-time-popup {
  bottom: auto;
  top: 120%;
}

.manual-time-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.manual-time-presets .preset-btn {
  padding: 0.5rem 0.25rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 36px;
  touch-action: manipulation;
}

.manual-time-presets .preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.custom-manual-input {
  display: flex;
  gap: 0.5rem;
}

.custom-manual-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 0.5rem 0.625rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  outline: none;
  min-height: 36px;
}

/* History Toggle */
.history-toggle-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
  min-height: 36px;
  touch-action: manipulation;
}

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

.history-toggle-btn svg,
.history-toggle-btn .material-symbols-outlined {
  width: 14px;
  height: 14px;
  font-size: 14px;
  transition: transform var(--transition-fast);
}

.history-toggle-btn.expanded svg,
.history-toggle-btn.expanded .material-symbols-outlined {
  transform: rotate(180deg);
}

.task-history-logs {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  border: 1px dashed var(--border-glass);
  margin-top: 0.5rem;
}

.task-history-logs.show {
  display: flex;
}

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.log-meta {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.log-duration {
  font-weight: 700;
  color: var(--text-primary);
}

.btn-delete-log {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all var(--transition-fast);
  min-width: 28px;
  min-height: 28px;
  justify-content: center;
  touch-action: manipulation;
}

.btn-delete-log:hover {
  color: var(--color-priority-high);
  background: rgba(255, 82, 82, 0.1);
}

.btn-delete-log svg,
.btn-delete-log .material-symbols-outlined {
  width: 14px;
  height: 14px;
  font-size: 14px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--blur-amount);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

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

.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.35s var(--ease-spring), opacity 0.25s ease-out;
  opacity: 0;
}

.modal-overlay.show .modal-content {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.modal-content.modal-large {
  max-width: 900px;
  width: 95%;
}

#category-modal .modal-content {
  max-width: 700px;
}

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

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: all var(--transition-fast);
}

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

.modal-close svg,
.modal-close .material-symbols-outlined {
  width: 20px;
  height: 20px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-modal-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.625rem 0.875rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition-fast);
  min-height: var(--touch-target-min);
}

.form-modal-input:focus {
  outline: none;
  border-color: var(--border-glass-focus);
}

.form-modal-input.error,
.form-modal-input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: #ff5252;
  background: rgba(255, 82, 82, 0.05);
}

.form-modal-input.success {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.form-error-message {
  font-size: 0.75rem;
  color: #ff5252;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  animation: slideIn 0.2s ease-out;
}

.form-error-message .material-symbols-outlined {
  font-size: 14px;
}

.priority-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.priority-option {
  position: relative;
}

.priority-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.priority-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: capitalize;
  min-height: var(--touch-target-min);
}

.priority-option input:checked + .priority-label {
  color: #fff;
  border-color: transparent;
}

.priority-option input[value="low"]:checked + .priority-label {
  background: var(--color-priority-low);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.priority-option input[value="medium"]:checked + .priority-label {
  background: var(--color-priority-medium);
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.3);
}

.priority-option input[value="high"]:checked + .priority-label {
  background: var(--color-priority-high);
  box-shadow: 0 0 10px rgba(255, 82, 82, 0.3);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
}

/* Category Manager */
.category-manager-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.category-manager-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
}

.category-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-picker-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-picker-wrapper input[type="color"] {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border: none;
}

.category-name-display {
  font-size: 0.875rem;
  font-weight: 600;
}

.category-manager-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-add-form {
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.category-add-row {
  display: flex;
  gap: 0.5rem;
}

.category-add-row .form-modal-input {
  flex: 1;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.toast {
  background: var(--bg-modal);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: var(--blur-amount);
  transform: translateY(20px);
  opacity: 0;
  animation: slideIn 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid var(--brand-red);
}

.toast.toast-success {
  border-left-color: var(--color-active-green);
}

.toast.toast-error {
  border-left-color: var(--brand-red);
}

/* Report Components */
.report-filters {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.report-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.5rem 0.875rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 40px;
  touch-action: manipulation;
}

.preset-btn:hover,
.preset-btn.active {
  background: var(--bg-glass-hover);
  border-color: var(--brand-red);
  color: var(--text-primary);
}

.report-stats {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  align-items: center;
  background: rgba(255, 82, 82, 0.05);
  border: 1px solid rgba(255, 82, 82, 0.15);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.report-total-hours {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stats-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.report-results {
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 0.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.report-week-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.report-week-header {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.report-week-title {
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.report-week-subtotal {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--brand-red);
}

.report-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}

.report-table th {
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.5px;
}

.report-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  vertical-align: top;
  line-height: 1.4;
}

.report-table tr:last-child td {
  border-bottom: none;
}

.report-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.col-date {
  width: 90px;
  white-space: nowrap;
  font-weight: 600;
}

.col-task {
  width: 180px;
  font-weight: 700;
}

.col-description {
  min-width: 250px;
  color: var(--text-secondary);
}

.col-category {
  width: 130px;
}

.col-duration {
  width: 90px;
  text-align: right;
  font-weight: 700;
}

.report-table th.col-duration {
  text-align: right;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.report-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.report-empty-state .material-symbols-outlined {
  font-size: 3rem;
  color: var(--text-muted);
}

/* Weighting Slider */
.weighting-slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
}

.weighting-slider-container span {
  font-size: 0.8125rem;
  font-weight: 600;
  width: 40%;
  word-break: break-word;
}

#weight-label-left {
  text-align: right;
  color: var(--text-primary);
}

#weight-label-right {
  text-align: left;
  color: var(--text-primary);
}

.weight-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.weight-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-red);
  cursor: pointer;
  box-shadow: 0 0 8px var(--brand-red);
  transition: transform var(--transition-fast);
}

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

/* Journal */
.bookings-journal-panel {
  grid-column: 1 / -1;
  margin-top: 2rem;
  padding: 1.5rem;
}

.journal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
}

.journal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.journal-title h2 {
  font-size: 1.125rem;
  font-weight: 700;
}

.journal-title .material-symbols-outlined {
  color: var(--brand-red);
  font-size: 24px;
}

.journal-table-wrapper {
  overflow-x: auto;
  max-height: calc(100vh - 320px);
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.1);
}

.journal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}

.journal-table th,
.journal-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.journal-table th {
  background: var(--bg-modal);
  font-weight: 600;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.journal-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.journal-table td.col-duration {
  font-weight: 700;
  color: var(--text-primary);
}

.journal-link-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.journal-link-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.journal-link-icon {
  color: var(--brand-red);
  font-size: 24px;
}

.journal-link-text {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.journal-link-title {
  font-size: 1rem;
  font-weight: 700;
}

.journal-link-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Datepicker */
.custom-datepicker-popup {
  position: absolute;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  width: 290px;
  background: var(--bg-modal);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  user-select: none;
  animation: datepicker-fade-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-datepicker-popup.show {
  display: flex;
}

.datepicker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.5rem;
}

.datepicker-header button {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background var(--transition-fast), color var(--transition-fast);
  min-height: unset;
}

.datepicker-header button:hover {
  background: var(--border-glass);
  color: var(--brand-red);
}

.datepicker-month-year {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

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

.datepicker-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.datepicker-day:hover {
  background: var(--border-glass-focus);
  color: #fff;
}

.datepicker-day.other-month {
  color: var(--text-muted);
  opacity: 0.35;
}

.datepicker-day.selected {
  background: var(--brand-red) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 82, 82, 0.4);
}

.datepicker-day.today {
  border: 1.5px solid var(--brand-red);
  color: var(--brand-red);
}

.datepicker-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.datepicker-backdrop.show {
  display: block;
  opacity: 1;
}

/* Mobile Components */
.stats-chip-row {
  display: none;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.stat-chip .material-symbols-outlined {
  font-size: 16px;
  color: var(--brand-red);
}

.stat-chip strong {
  color: var(--text-primary);
  font-weight: 700;
}

.stats-chip-row .expand-icon {
  margin-left: auto;
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.stats-detail-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
}

.stats-detail-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 82, 82, 0.1);
  border-radius: 12px;
  flex-shrink: 0;
}

.stats-detail-icon .material-symbols-outlined {
  font-size: 24px;
  color: var(--brand-red);
}

.stats-detail-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.stats-detail-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-modal);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border-top: 1px solid var(--border-glass);
  display: none;
  justify-content: space-around;
  align-items: stretch;
  padding: 0.5rem 0;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  z-index: 999;
  height: var(--bottom-bar-height);
}

.bottom-bar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.375rem 0.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  touch-action: manipulation;
  min-width: var(--touch-target-min);
}

.bottom-bar-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 28px;
  height: 3px;
  background: var(--brand-red);
  border-radius: 0 0 3px 3px;
  transition: transform var(--transition-fast);
}

.bottom-bar-btn.active::before {
  transform: translateX(-50%) scaleX(1);
}

.bottom-bar-btn:active {
  transform: scale(0.92);
}

.bottom-bar-btn .material-symbols-outlined {
  font-size: 24px;
  transition: all var(--transition-fast);
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.bottom-bar-btn.active {
  color: var(--brand-red);
}

.bottom-bar-btn.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  transform: scale(1.1);
}

.bottom-bar-btn-primary {
  color: var(--brand-red);
}

.bottom-bar-btn-primary .material-symbols-outlined {
  font-size: 28px;
  font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 28;
}

.bottom-bar-btn-primary:active {
  transform: scale(0.88);
}

.bottom-bar-label {
  font-size: 0.625rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.fab {
  position: fixed;
  bottom: calc(var(--bottom-bar-safe-area) + var(--fab-margin));
  right: var(--fab-margin);
  width: var(--fab-size);
  height: var(--fab-size);
  background: linear-gradient(135deg, var(--brand-red), #d63031);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 82, 82, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  z-index: 85;
  transition: all var(--transition-normal);
  touch-action: manipulation;
}

.fab .material-symbols-outlined {
  font-size: 28px;
  color: #fff;
  font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 28;
}

.fab:active {
  transform: scale(0.9);
  box-shadow: 0 4px 12px rgba(255, 82, 82, 0.3);
}

.floating-timer-banner {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  max-width: calc(100% - 1.5rem);
  width: auto;
  min-width: 260px;
  background: var(--bg-modal);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border: 1px solid rgba(255, 82, 82, 0.3);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 82, 82, 0.1);
  z-index: 95;
  cursor: pointer;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  opacity: 0;
  touch-action: manipulation;
}

.floating-timer-banner:active {
  transform: translateX(-50%) translateY(0) scale(0.97);
}

.floating-timer-pulse {
  width: 10px;
  height: 10px;
  background: var(--brand-red);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 1.5s infinite;
}

.floating-timer-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.floating-timer-task {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-timer-time {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brand-red);
  font-variant-numeric: tabular-nums;
}

.floating-timer-expand-icon {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--text-muted);
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-modal);
  border-radius: 20px 20px 0 0;
  max-height: var(--sheet-max-height);
  transform: translateY(100%);
  transition: transform var(--transition-normal);
  z-index: 105;
  display: none;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  touch-action: none;
}

.bottom-sheet-handle {
  width: var(--sheet-handle-width);
  height: var(--sheet-handle-height);
  background: var(--border-glass);
  border-radius: 2px;
  margin: 0.5rem auto 0.75rem;
  flex-shrink: 0;
  cursor: grab;
  touch-action: pan-y;
}

.bottom-sheet-handle:active {
  cursor: grabbing;
}

.bottom-sheet-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 1.5rem 1.5rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.filter-sheet-trigger {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: var(--touch-target-min);
  width: 100%;
  justify-content: space-between;
  touch-action: manipulation;
}

.filter-sheet-trigger:active {
  transform: scale(0.98);
  background: var(--bg-glass-hover);
}

.filter-sheet-trigger .material-symbols-outlined {
  font-size: 20px;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  background: var(--brand-red);
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
}

.active-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.3);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-red);
  cursor: pointer;
  transition: all var(--transition-fast);
  touch-action: manipulation;
}

.filter-chip:active {
  transform: scale(0.95);
}

.filter-chip .material-symbols-outlined {
  font-size: 16px;
}

.pull-to-refresh-indicator {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: var(--bg-modal);
  border: 2px solid var(--border-glass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast), top var(--transition-fast);
  z-index: 80;
  box-shadow: var(--shadow-md);
}

.pull-to-refresh-indicator.visible {
  opacity: 1;
  top: 1rem;
}

.pull-to-refresh-indicator.refreshing {
  animation: spin 1s linear infinite;
}

.pull-to-refresh-indicator .material-symbols-outlined {
  font-size: 24px;
  color: var(--brand-red);
}

.pull-to-refresh-indicator.active {
  animation: spin 1s linear infinite;
}

.swipe-threshold-reached {
  filter: brightness(1.2);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
}

.haptic-feedback {
  animation: haptic-pulse 0.3s ease-out;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

[data-theme="light"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.05) 100%
  );
  background-size: 200% 100%;
}

.skeleton-stat-card {
  height: 100px;
  border-radius: 20px;
  opacity: 0;
  animation: shimmer 1.5s ease-in-out infinite, skeleton-fade-in 0.4s ease-out forwards;
}

.skeleton-stat-card:nth-child(1) { animation-delay: 0s, 0s; }
.skeleton-stat-card:nth-child(2) { animation-delay: 0s, 0.05s; }
.skeleton-stat-card:nth-child(3) { animation-delay: 0s, 0.1s; }

.skeleton-chart {
  height: 300px;
  border-radius: 20px;
  opacity: 0;
  animation: shimmer 1.5s ease-in-out infinite, skeleton-fade-in 0.4s ease-out 0.15s forwards;
}

.skeleton-task-card {
  height: 80px;
  border-radius: 0;
  border-bottom: 1px solid var(--border-glass);
  opacity: 0;
  animation: shimmer 1.5s ease-in-out infinite, skeleton-fade-in 0.3s ease-out forwards;
}

.skeleton-task-card:nth-child(1) { animation-delay: 0s, 0s; }
.skeleton-task-card:nth-child(2) { animation-delay: 0s, 0.05s; }
.skeleton-task-card:nth-child(3) { animation-delay: 0s, 0.1s; }
.skeleton-task-card:nth-child(4) { animation-delay: 0s, 0.15s; }
.skeleton-task-card:nth-child(5) { animation-delay: 0s, 0.2s; }

.skeleton-task-card:last-child {
  border-bottom: none;
}

.skeleton-tasks-container {
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  box-shadow: var(--shadow-md);
}

.loading-state {
  display: none;
}

.loading-state.active {
  display: block;
}

.content-loaded {
  display: none;
}

.content-loaded.active {
  display: block;
}

.skeleton-text {
  height: 1rem;
  border-radius: 4px;
}

.skeleton-text-sm {
  height: 0.875rem;
  width: 60%;
}

.skeleton-text-lg {
  height: 1.25rem;
  width: 80%;
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

[data-theme="light"] .shimmer {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.03) 0%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.03) 100%
  );
  background-size: 200% 100%;
}

/* ==============================================
   5. UTILITIES – Helper-Klassen
   ============================================== */

.mobile-hidden {
  display: none !important;
}

.mobile-full-width {
  width: 100% !important;
}

.mobile-text-readable {
  font-size: 1rem;
  line-height: 1.5;
}

.desktop-hidden {
  display: none !important;
}

/* ==============================================
   ANIMATIONS – Keyframes
   ============================================== */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(255, 82, 82, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(255, 82, 82, 0);
  }
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.4);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(255, 82, 82, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 82, 82, 0);
  }
}

@keyframes pulse-bar {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--brand-red); }
  50% { opacity: 0.6; box-shadow: 0 0 16px var(--brand-red); }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes skeleton-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes swipe-hint-pulse {
  0%, 100% {
    transform: translateY(-50%) translateX(0);
    opacity: 0.7;
    width: 6px;
  }
  50% {
    transform: translateY(-50%) translateX(4px);
    opacity: 1;
    width: 8px;
  }
}

@keyframes swipe-hint-wobble {
  0%, 100% { transform: translateX(0); }
  10%, 30% { transform: translateX(-3px); }
  20%, 40% { transform: translateX(3px); }
  50%, 100% { transform: translateX(0); }
}

@keyframes datepicker-fade-in {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes haptic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255, 82, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}

/* ==============================================
   RESPONSIVE – Konsolidierte Media Queries
   ============================================== */

/* Tablet & Mobile (≤768px) */
@media (max-width: 768px) {
  /* App Container */
  .app-container {
    padding: 0.75rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    gap: 0.75rem;
    padding-bottom: var(--bottom-bar-safe-area);
  }

  /* Glass Panel */
  .glass-panel {
    border-radius: 16px;
    padding: 1rem;
  }

  /* Scrollbar */
  ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  /* Buttons */
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    min-height: 48px;
  }

  .btn .material-symbols-outlined {
    font-size: 20px;
  }

  .btn-icon {
    width: 48px;
    height: 48px;
    min-height: 48px;
  }

  .btn-mini {
    min-width: 44px;
    min-height: 44px;
    padding: 0.4rem;
  }

  .btn-mini .material-symbols-outlined {
    font-size: 18px;
  }

  /* Dashboard */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Forms */
  .form-modal-input {
    min-height: 48px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }

  .priority-label {
    min-height: 48px;
    padding: 0.875rem;
    font-size: 0.9375rem;
  }

  .select-field {
    min-height: 48px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }

  /* Search & Filter */
  .search-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .search-box {
    width: 100%;
    min-width: unset;
  }

  .filter-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
  }

  .filter-actions > * {
    width: 100%;
  }

  .filter-actions .btn {
    justify-content: center;
  }

  /* Tasks */
  .task-card-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.35rem 0.75rem;
    padding: 0.875rem 1rem;
    min-height: 64px;
    align-items: center;
  }

  .task-status-container {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .task-card-header-main {
    display: contents;
  }

  .task-card-header-main .task-title {
    grid-column: 2 / span 2;
    grid-row: 1;
    font-size: 0.9375rem;
    max-width: 100%;
  }

  .task-card-header-main .task-badges {
    grid-column: 2;
    grid-row: 2;
  }

  .task-card-header-meta {
    grid-column: 3;
    grid-row: 2;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-left: 0;
  }

  .task-card-header-meta .task-swipe-hint-icon {
    display: inline-flex !important;
    font-size: 18px;
    margin-left: auto;
    opacity: 0.6;
    animation: swipe-hint-wobble 4s ease-in-out infinite;
  }

  .task-card:first-child .task-swipe-hint-icon {
    opacity: 0.8;
    animation: swipe-hint-wobble 2.5s ease-in-out 4;
  }

  .task-card-content.card-expanded .task-swipe-hint-icon {
    opacity: 0 !important;
    pointer-events: none;
    animation: none !important;
  }

  .task-header-edit-desktop {
    display: none !important;
  }

  .task-card:hover .task-swipe-hint-icon,
  .task-card:active .task-swipe-hint-icon {
    opacity: 0.8;
    color: var(--brand-red);
  }

  .priority-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    margin-right: 0.25rem;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
  }

  .priority-arrow.priority-arrow-high { color: var(--color-priority-high); }
  .priority-arrow.priority-arrow-medium { color: var(--color-priority-medium); }
  .priority-arrow.priority-arrow-low { color: var(--color-priority-low); }

  .badge-priority-low,
  .badge-priority-medium,
  .badge-priority-high {
    display: none !important;
  }

  .task-swipe-action {
    min-height: 48px;
  }

  .checkmark {
    height: 28px;
    width: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  .checkmark svg,
  .checkmark .material-symbols-outlined {
    width: 18px;
    height: 18px;
    font-size: 18px;
  }

  .task-card-content.can-swipe .task-card-swipe-indicator {
    opacity: 0.7;
    animation: swipe-hint-pulse 2s ease-in-out infinite;
  }

  .task-card-content.swiping .task-card-swipe-indicator {
    opacity: 1;
    animation: none;
  }

  .task-card:first-child .task-card-swipe-indicator {
    opacity: 0.85;
    animation: swipe-hint-pulse 2s ease-in-out 3;
  }

  /* Subtasks */
  .subtask-row {
    padding: 0.625rem 0.75rem;
    min-height: 56px;
    font-size: 0.9375rem;
    gap: 0.75rem;
  }

  .subtask-title {
    font-size: 0.9375rem;
  }

  .subtask-right {
    gap: 0.625rem;
  }

  .subtask-checkmark {
    height: 28px;
    width: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  .subtask-checkmark svg,
  .subtask-checkmark .material-symbols-outlined {
    width: 14px;
    height: 14px;
    font-size: 14px;
  }

  .subtask-quick-add .input-field {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    min-height: 44px;
  }

  .subtask-quick-add .btn {
    padding: 0.625rem 0.875rem;
    min-height: 44px;
  }

  /* Manual Time */
  .manual-time-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
  }

  .subtask-row .manual-time-popup {
    bottom: auto;
    top: calc(100% + 8px);
  }

  .manual-time-presets {
    gap: 0.625rem;
  }

  .manual-time-presets .preset-btn {
    padding: 0.625rem 0.375rem;
    font-size: 0.8125rem;
    min-height: 44px;
  }

  .custom-manual-input input {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    min-height: 44px;
  }

  /* History */
  .history-toggle-btn {
    padding: 0.625rem 0;
    min-height: 44px;
    font-size: 0.8125rem;
  }

  .btn-delete-log {
    padding: 0.375rem;
    min-width: 36px;
    min-height: 36px;
  }

  .btn-delete-log svg,
  .btn-delete-log .material-symbols-outlined {
    width: 16px;
    height: 16px;
    font-size: 16px;
  }

  /* Modals */
  .modal-content {
    padding: 1.5rem 1rem;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
    margin-top: auto;
    transform: translateY(100%);
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal-overlay.show .modal-content {
    transform: translateY(0);
    opacity: 1;
  }

  .modal-content::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--border-glass);
    border-radius: 2px;
  }

  /* Category Manager */
  .category-manager-actions {
    gap: 0.625rem;
  }

  /* Toast */
  .toast-container {
    bottom: max(1rem, env(safe-area-inset-bottom) + 1rem);
    right: 1rem;
    left: 1rem;
  }

  /* Report */
  .report-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .preset-btn {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    min-height: 44px;
  }

  /* Journal */
  .journal-link-section {
    display: none !important;
  }

  .journal-link-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .journal-link-btn {
    width: 100%;
    justify-content: center;
  }

  /* Datepicker */
  .custom-datepicker-popup.mobile-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 310px;
    max-width: 90vw;
    z-index: 1000;
  }

  @keyframes datepicker-fade-in {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  /* Bottom Bar */
  .mobile-bottom-bar {
    display: flex;
  }

  /* FAB */
  .fab {
    display: flex;
  }

  /* Floating Timer */
  .floating-timer-banner.active {
    display: flex;
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }

  /* Bottom Sheet */
  .modal-overlay.show .bottom-sheet {
    display: flex;
    transform: translateY(0);
  }

  /* Filter Sheet */
  .filter-sheet-trigger {
    display: flex;
  }

  .controls-panel .filter-actions > :not(.filter-sheet-trigger):not(#add-task-btn) {
    display: none;
  }

  /* Utilities */
  .mobile-hidden {
    display: none !important;
  }

  .mobile-full-width {
    width: 100% !important;
  }

  .mobile-text-readable {
    font-size: 1rem;
    line-height: 1.5;
  }
}

/* Mobile (≤640px) */
@media (max-width: 640px) {
  /* Dashboard */
  .dashboard-grid {
    gap: 0.5rem;
  }

  /* Stats */
  .stats-container {
    display: none !important;
  }

  .stats-chip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
    padding: 0.3rem 0.65rem;
    gap: 0.35rem;
  }

  .stats-chip-row:active {
    background: var(--bg-glass-hover);
    transform: scale(0.99);
  }

  .stat-chip {
    padding: 0.25rem 0.45rem;
    font-size: 0.65rem;
  }

  .stat-chip .material-symbols-outlined {
    font-size: 14px;
  }

  /* Chart */
  .chart-panel {
    display: none !important;
  }

  .chart-legend {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Header */
  .app-header {
    flex-wrap: nowrap;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    min-height: 24px;
  }

  .brand {
    flex: 0 0 auto;
    min-width: 0;
    gap: 0.4rem;
  }

  .brand h1 {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(255, 82, 82, 0.25);
  }

  .brand-icon .material-symbols-outlined {
    font-size: 16px;
    width: 16px;
    height: 16px;
  }

  .header-actions {
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.4rem;
    flex-shrink: 0;
  }

  #quick-book-btn,
  .app-header #theme-toggle-btn {
    display: none;
  }

  .active-timer-widget {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    gap: 0.3rem;
    order: 10;
    flex-basis: 100%;
    justify-content: center;
    width: 100%;
  }

  .active-timer-widget #header-timer-task-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Controls */
  .controls-panel {
    position: sticky;
    top: calc(env(safe-area-inset-top) + 4px);
    z-index: 80;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-amount);
    -webkit-backdrop-filter: var(--blur-amount);
    padding: 0.75rem 1rem;
    margin: 0;
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
  }

  #add-task-btn {
    display: none !important;
  }

  .search-filter-row {
    flex-direction: row !important;
    gap: 0.5rem;
    align-items: center;
  }

  .search-box {
    flex: 1;
    min-width: 0;
  }

  .filter-actions {
    flex: 0 0 auto;
    width: auto !important;
  }

  .input-field {
    min-height: 40px;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  }

  .search-box .material-symbols-outlined {
    left: 0.75rem;
    font-size: 16px;
  }

  .filter-sheet-trigger {
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .filter-sheet-trigger .material-symbols-outlined {
    font-size: 18px;
  }

  /* Tasks */
  .tasks-grid {
    margin-top: 0.25rem;
  }

  .task-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .timer-controls-group {
    width: 100%;
    justify-content: space-between;
  }

  .timer-controls-group > .btn {
    flex: 1;
  }

  .timer-controls-group > .manual-time-anchor {
    flex: none;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 0.625rem;
  }

  .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Desktop (≥769px) */
@media (min-width: 769px) {
  .modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
  }

  .desktop-hidden {
    display: none !important;
  }
}

/* ==============================================
   LOGIN OVERLAY
   ============================================== */

#login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-app);
  padding: 1.5rem;
}

.login-card {
  width: min(400px, 100%);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-error {
  color: var(--brand-red);
  font-size: 0.875rem;
  margin: 0;
  min-height: 1.25em;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

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