/* 
 * DriftlessWork - Custom Stylesheet
 * Custom styles for DriftlessWork task assistant.
 * Calming Dark Mode Theme utilizing user logo palette.
 */

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

:root {
  /* Logo-Derived Color System */
  --bg-deep: #02121d;
  --bg-dark: #051d2f;
  --color-navy: #065180;
  --color-ocean: #0478a6;
  --color-teal: #0688a6;
  --color-sky: #54c1d9;
  --color-snow: #fbfeff;
  
  /* Semantic Colors */
  --color-success: #0cd49f;
  --color-success-bg: rgba(12, 212, 159, 0.15);
  --color-warning: #ffd05b;
  --color-danger: #ff5c75;
  
  /* Glassmorphic Styles */
  --glass-bg: rgba(6, 81, 128, 0.20);
  --glass-bg-hover: rgba(6, 81, 128, 0.30);
  --glass-border: rgba(84, 193, 217, 0.20);
  --glass-border-focus: rgba(84, 193, 217, 0.45);
  --glass-shadow: 0 8px 32px 0 rgba(2, 18, 29, 0.37);
  --backdrop-blur: blur(16px);
  
  /* Energy Color Tokens */
  --energy-low: var(--color-navy);
  --energy-medium: var(--color-ocean);
  --energy-high: var(--color-sky);

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Borders & Spacing */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-round: 50%;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s ease;
}

/* Base Styles & Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  overflow-y: hidden; /* Hide outer page scrollbar on desktop viewports */
}

body {
  font-family: var(--font-family);
  background: radial-gradient(at top left, var(--bg-dark), var(--bg-deep));
  background-attachment: fixed;
  color: var(--color-snow);
  min-height: 100vh;
  display: flex;
  line-height: 1.5;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  -webkit-appearance: none;
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  -webkit-appearance: none;
  background: rgba(84, 193, 217, 0.45);
  border-radius: var(--radius-sm);
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(84, 193, 217, 0.85);
}

/* Cross-browser scrollbars for Firefox */
@supports not selector(::-webkit-scrollbar) {
  html, body, .main-content, .modal-body {
    scrollbar-color: rgba(84, 193, 217, 0.4) #02121d;
    scrollbar-width: thin;
  }
}

/* Accessibility: Hide visually but keep screen-readable */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout Hierarchy */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
  background: rgba(2, 18, 29, 0.5);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: var(--backdrop-blur);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.brand-logo {
  width: 100px;
  height: 90px;
  border-radius: 0px;
  object-fit: cover;
}

.brand-name {
  font-size: 2.00rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, var(--color-snow), var(--color-sky));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: auto;
}

.nav-item button {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(251, 254, 255, 0.65);
  transition: var(--transition-fast);
}

.nav-item button:hover {
  background: rgba(84, 193, 217, 0.08);
  color: var(--color-snow);
}

.nav-item.active button {
  background: var(--glass-bg);
  color: var(--color-sky);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.nav-item button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: var(--transition-fast);
}

/* Sidebar Widgets */


/* Main Dashboard Layout */
.main-content {
  padding: 2.5rem;
  overflow-y: scroll;
  height: 100vh;
  min-width: 0;
  max-width: 100%;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.header-meta h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.header-meta p {
  color: rgba(251, 254, 255, 0.5);
  font-size: 0.95rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius-md);
  backdrop-filter: var(--backdrop-blur);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(84, 193, 217, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-sky);
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.stat-info h3 {
  font-size: 0.8rem;
  color: rgba(251, 254, 255, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-info p {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-snow);
}

/* Dashboard Core Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
}

/* Section Card Wrapper */
.card-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--backdrop-blur);
  box-shadow: var(--glass-shadow);
  padding: 1.75rem;
  transition: border-color var(--transition-normal);
}

.card-section:hover {
  border-color: rgba(84, 193, 217, 0.25);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Task Creator Panel */
.creator-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(251, 254, 255, 0.7);
}

.form-input {
  width: 100%;
  background: rgba(1, 9, 15, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  outline: none;
  color: var(--color-snow);
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--glass-border-focus);
  box-shadow: 0 0 10px rgba(84, 193, 217, 0.15);
  background: rgba(1, 9, 15, 0.60);
}

/* Force time input text fields, including AM/PM, to inherit snow-white color */
input[type="time"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-text,
input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field,
input[type="time"]::-webkit-datetime-edit-ampm-field {
  color: var(--color-snow) !important;
}

/* Invert the calendar/clock dropdown indicator to white */
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5);
  cursor: pointer;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-teal), var(--color-ocean));
  color: var(--color-snow);
  box-shadow: 0 4px 15px rgba(6, 136, 166, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 136, 166, 0.4);
}

.btn-secondary {
  background: rgba(84, 193, 217, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--color-sky);
}

.btn-secondary:hover {
  background: rgba(84, 193, 217, 0.15);
  color: var(--color-snow);
}

.btn-danger {
  background: rgba(255, 92, 117, 0.1);
  border: 1px solid rgba(255, 92, 117, 0.2);
  color: var(--color-danger);
}

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

.btn-ai {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: var(--color-snow);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.btn-ai:disabled {
  background: var(--glass-bg);
  color: rgba(251, 254, 255, 0.3);
  box-shadow: none;
  cursor: not-allowed;
}

/* Quick Filters */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.filter-tab {
  background: none;
  border: 1px solid transparent;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: rgba(251, 254, 255, 0.6);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--color-snow);
  background: rgba(84, 193, 217, 0.05);
}

.filter-tab.active {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--color-sky);
}

/* Task List Styles */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.no-tasks {
  text-align: center;
  padding: 3rem 1.5rem;
  color: rgba(251, 254, 255, 0.4);
}

.no-tasks svg {
  margin-bottom: 1rem;
  stroke: rgba(251, 254, 255, 0.2);
}

/* Task Item Card */
.task-item {
  background: rgba(1, 9, 15, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-item:hover {
  border-color: rgba(84, 193, 217, 0.25);
  box-shadow: 0 4px 20px rgba(2, 18, 29, 0.2);
}

.task-item.completed {
  opacity: 0.6;
  border-color: rgba(12, 212, 159, 0.15);
  background: rgba(12, 212, 159, 0.02);
}

.task-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.task-checkbox-container {
  display: flex;
  align-items: center;
  height: 24px;
}

.task-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-ocean);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

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

.task-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--bg-deep);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-details {
  flex: 1;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.task-title {
  font-size: 1.05rem;
  font-weight: 600;
  transition: var(--transition-fast);
  word-break: break-word;
  max-width: 100%;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: rgba(251, 254, 255, 0.4);
}

.task-desc {
  font-size: 0.85rem;
  color: rgba(251, 254, 255, 0.55);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
}

.badge-energy-low {
  background: rgba(6, 81, 128, 0.25);
  color: rgba(84, 193, 217, 0.9);
  border: 1px solid rgba(84, 193, 217, 0.2);
}

.badge-energy-medium {
  background: rgba(6, 136, 166, 0.2);
  color: var(--color-sky);
  border: 1px solid rgba(84, 193, 217, 0.35);
}

.badge-energy-high {
  background: rgba(84, 193, 217, 0.25);
  color: var(--color-snow);
  border: 1px solid var(--color-sky);
  box-shadow: 0 0 10px rgba(84, 193, 217, 0.2);
}

.badge-subtasks {
  background: rgba(251, 254, 255, 0.05);
  color: rgba(251, 254, 255, 0.5);
  border: 1px solid rgba(251, 254, 255, 0.1);
}

.badge-subtasks-btn {
  background: rgba(251, 254, 255, 0.05);
  color: rgba(251, 254, 255, 0.5);
  border: 1px solid rgba(251, 254, 255, 0.1);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.badge-subtasks-btn:hover {
  background: rgba(84, 193, 217, 0.12);
  color: var(--color-sky);
  border-color: rgba(84, 193, 217, 0.45);
  box-shadow: 0 0 10px rgba(84, 193, 217, 0.15);
}

@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(84, 193, 217, 0.6); border-color: var(--color-sky); }
  70% { box-shadow: 0 0 0 15px rgba(84, 193, 217, 0); border-color: var(--color-sky); }
  100% { box-shadow: 0 0 0 0 rgba(84, 193, 217, 0); }
}

.highlight-pulse {
  animation: highlightPulse 1.2s ease-out;
}

.task-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: none;
  border: none;
  color: rgba(251, 254, 255, 0.45);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  color: var(--color-snow);
  background: rgba(251, 254, 255, 0.08);
}

.icon-btn-danger:hover {
  color: var(--color-danger);
  background: rgba(255, 92, 117, 0.1);
}

/* Nested Checklist for Subtasks */
.task-subtasks-container {
  margin-left: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(84, 193, 217, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.subtask-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: rgba(2, 18, 29, 0.2);
  font-size: 0.85rem;
}

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

.subtask-checkbox {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-navy);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.subtask-checkbox:checked {
  background: var(--color-teal);
  border-color: var(--color-teal);
}

.subtask-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--color-snow);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.subtask-text {
  font-weight: 500;
  word-break: break-word;
}

.subtask-item.completed .subtask-text {
  text-decoration: line-through;
  color: rgba(251, 254, 255, 0.35);
}

.subtask-tiny-start {
  font-size: 0.75rem;
  color: var(--color-sky);
  opacity: 0.8;
  margin-top: 0.1rem;
}

/* Melt Trigger Action in Task Card */
.melt-badge {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(79, 70, 229, 0.2));
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: #c084fc;
  cursor: pointer;
  transition: var(--transition-fast);
}

.melt-badge:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(79, 70, 229, 0.4));
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

/* Today's Focus Highlight Widget (Left Panel) */
.focus-widget {
  background: linear-gradient(135deg, rgba(6, 81, 128, 0.25), rgba(4, 120, 166, 0.1));
  border: 1.5px solid var(--color-ocean);
  box-shadow: 0 0 25px rgba(4, 120, 166, 0.15);
}

.focus-widget-task {
  margin-top: 0.5rem;
}

.focus-widget-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-snow);
  margin-bottom: 0.5rem;
}

.focus-widget-step {
  background: rgba(2, 18, 29, 0.4);
  border: 1px dashed var(--color-sky);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.focus-widget-step svg {
  color: var(--color-sky);
  flex-shrink: 0;
  margin-top: 2px;
}

.focus-widget-step-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--color-sky);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
}

.focus-widget-step-text {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Focus Mode Overlay */
.focus-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(5, 29, 47, 0.98), rgba(2, 18, 29, 0.99));
  z-index: 1000;
  display: none; /* Controlled by JS */
  backdrop-filter: blur(24px);
  padding: 2rem 1.5rem;
  overflow-y: auto;
  animation: fadeIn var(--transition-normal);
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.focus-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  margin: auto 0;
}

.focus-header-top {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.focus-timer-ring {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.ring-circle-bg {
  fill: none;
  stroke: rgba(6, 81, 128, 0.2);
  stroke-width: 8px;
}

.ring-circle-fill {
  fill: none;
  stroke: url(#timer-gradient);
  stroke-width: 8px;
  stroke-linecap: round;
  stroke-dasharray: 753.98; /* 2 * PI * r (r=120) */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  font-size: 3.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.focus-task-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.focus-parent-title {
  font-size: 1.1rem;
  color: rgba(251, 254, 255, 0.5);
  font-weight: 500;
}

.focus-active-step {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-snow);
}

.focus-trigger-box {
  background: rgba(84, 193, 217, 0.05);
  border: 1.5px dashed var(--color-sky);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  max-width: 480px;
  margin: 0 auto;
}

.focus-trigger-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-sky);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.focus-trigger-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.focus-controls {
  display: flex;
  gap: 1rem;
}

/* Modals & Wizards */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 18, 29, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1010;
  display: none; /* Controlled by JS */
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: var(--bg-dark);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(2, 18, 29, 0.6);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale var(--transition-normal);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(84, 193, 217, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid rgba(84, 193, 217, 0.1);
  background: rgba(2, 18, 29, 0.4);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Wizard Dynamic List */
.wizard-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.wizard-item {
  background: rgba(2, 18, 29, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  transition: var(--transition-fast);
}

.wizard-item:hover {
  border-color: var(--glass-border-focus);
}

.wizard-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-item-index {
  font-size: 0.8rem;
  color: var(--color-sky);
  font-weight: 700;
  background: rgba(84, 193, 217, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-item-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wizard-item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

/* Warmup Box */
.warmup-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.warmup-timer {
  font-size: 4rem;
  font-weight: 800;
  color: var(--color-sky);
  font-variant-numeric: tabular-nums;
  margin: 1rem 0;
}

.warmup-instruction {
  font-size: 1.2rem;
  font-weight: 600;
  min-height: 3.5rem;
}

/* Settings View Layout */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(84, 193, 217, 0.08);
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 75%;
}

.setting-title {
  font-weight: 600;
}

.setting-desc {
  font-size: 0.85rem;
  color: rgba(251, 254, 255, 0.5);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-deep);
  border: 1px solid var(--glass-border);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--color-snow);
  transition: .4s;
  border-radius: 50%;
}

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

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-teal);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Loading Spinners */
.loader-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--color-sky);
  font-weight: 600;
  padding: 2rem 0;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(84, 193, 217, 0.1);
  border-top-color: var(--color-sky);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

/* Custom Success/Confetti Pulse */
@keyframes successPulse {
  0% { box-shadow: 0 0 0 0 rgba(12, 212, 159, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(12, 212, 159, 0); }
  100% { box-shadow: 0 0 0 0 rgba(12, 212, 159, 0); }
}

.pulse-success {
  animation: successPulse 0.8s ease-out;
}

/* --- Star Task Button & Glowing States --- */
.icon-btn-star {
  color: rgba(251, 254, 255, 0.35);
  transition: all 0.2s ease;
}
.icon-btn-star.starred {
  color: #ffc83b;
  filter: drop-shadow(0 0 6px rgba(255, 200, 59, 0.5));
}
.icon-btn-star:hover {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
}

/* --- Task Groupings --- */
.task-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-sky);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.5rem 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.task-group-desc {
  font-size: 0.8rem;
  color: rgba(251, 254, 255, 0.45);
  margin-bottom: 1rem;
  font-style: italic;
}
.task-group-placeholder {
  border: 1px dashed rgba(84, 193, 217, 0.25);
  background: rgba(6, 81, 128, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(251, 254, 255, 0.5);
  margin-bottom: 1.25rem;
}

/* --- Step Collapse/Expand --- */
.btn-toggle-steps {
  display: block;
  width: 100%;
  text-align: center;
  background: rgba(251, 254, 255, 0.02);
  border: 1px solid rgba(84, 193, 217, 0.12);
  border-radius: 8px;
  color: var(--color-sky);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}
.btn-toggle-steps:hover {
  background: rgba(84, 193, 217, 0.08);
  color: var(--color-snow);
  border-color: rgba(84, 193, 217, 0.3);
}

/* --- Reminder Alert Banners --- */
.reminder-banner {
  background: rgba(6, 81, 128, 0.2);
  border: 1px solid rgba(84, 193, 217, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  animation: slideDownFade 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 10px rgba(84, 193, 217, 0.1);
}
.reminder-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.reminder-icon {
  font-size: 1.35rem;
  animation: wiggle 2s ease-in-out infinite;
}
.reminder-text {
  min-width: 0;
}
.reminder-text h4 {
  margin: 0 0 0.15rem 0;
  font-size: 0.95rem;
  color: var(--color-snow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reminder-text p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(251, 254, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reminder-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.reminder-banner-actions .btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  height: auto;
  line-height: normal;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(-12deg); }
  20% { transform: rotate(10deg); }
  30% { transform: rotate(-8deg); }
  40% { transform: rotate(6deg); }
  50% { transform: rotate(-4deg); }
  60% { transform: rotate(0); }
}

/* Responsive Styles */
.mobile-header {
  display: none;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1024px) {
  html {
    overflow-y: scroll !important; /* Force scrollbar track on mobile/tablet viewports */
  }

  .app-container {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: none;
  }

  .main-content {
    padding-top: 5rem; /* Space for fixed mobile header */
    padding-bottom: 5.5rem; /* Space for bottom mobile nav */
    height: auto;
    min-height: 100vh;
  }

  /* Mobile Header Bar */
  .mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(2, 18, 29, 0.9);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: var(--backdrop-blur);
    z-index: 900;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 4px 20px rgba(2, 18, 29, 0.4);
  }

  .mobile-header .brand {
    flex-direction: row;
    align-items: center;
    margin-bottom: 0;
    gap: 0.5rem;
  }



  /* Mobile Navigation Bottom Bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(2, 18, 29, 0.95);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: var(--backdrop-blur);
    z-index: 900;
    justify-content: space-around;
    align-items: center;
    padding: 0 1rem;
    box-shadow: 0 -4px 20px rgba(2, 18, 29, 0.4);
  }

  .mobile-nav button {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(251, 254, 255, 0.5);
    cursor: pointer;
    flex: 1;
    min-width: 0;
    height: 100%;
    transition: var(--transition-fast);
  }

  .mobile-nav button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
  }

  .mobile-nav button:hover {
    color: var(--color-snow);
  }

  .mobile-nav button.active {
    color: var(--color-sky);
    text-shadow: 0 0 10px rgba(84, 193, 217, 0.3);
  }
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .right-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 4.5rem 1.25rem 5.5rem 1.25rem; /* Enforce 20px uniform gutter */
  }

  .card-section {
    padding: 1rem;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .task-item {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .filter-tabs {
    width: 100%;
  }

  .task-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .task-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .task-subtasks-container {
    margin-left: 0.5rem;
    width: calc(100% - 0.5rem);
  }

  .subtask-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .subtask-left {
    width: 100%;
  }

  /* Stacking subtask actions */
  .subtask-item > div:last-child {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid rgba(84, 193, 217, 0.08);
    padding-top: 0.5rem;
    box-sizing: border-box;
  }

  /* Focus mode mobile scale */
  .focus-container {
    gap: 1rem;
  }

  .focus-timer-ring {
    width: 210px;
    height: 210px;
  }
  
  .timer-text {
    font-size: 2.75rem;
  }
  
  .focus-active-step {
    font-size: 1.35rem;
  }
  
  .focus-parent-title {
    font-size: 0.9rem;
  }

  .focus-trigger-box {
    padding: 1rem;
  }

  .focus-trigger-text {
    font-size: 0.95rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

/* Executive Toolbox: Breathing Widget */
.breathing-circle-outer {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(84, 193, 217, 0.05);
  border: 2px dashed rgba(84, 193, 217, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 1.5rem auto;
}

.breathing-circle-inner {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-teal) 0%, var(--color-sky) 100%);
  box-shadow: 0 0 25px rgba(84, 193, 217, 0.6);
  transform: scale(0.45);
  animation: box-breathing-pacer 16s infinite ease-in-out;
}

@keyframes box-breathing-pacer {
  /* 0% to 25%: Inhale */
  0% {
    transform: scale(0.45);
    background: radial-gradient(circle, var(--color-teal) 0%, var(--color-sky) 100%);
    box-shadow: 0 0 15px rgba(84, 193, 217, 0.4);
  }
  25% {
    transform: scale(1);
    background: radial-gradient(circle, var(--color-teal) 0%, var(--color-sky) 100%);
    box-shadow: 0 0 35px rgba(84, 193, 217, 0.8);
  }
  /* 25% to 50%: Hold Full */
  50% {
    transform: scale(1);
    background: radial-gradient(circle, var(--color-sky) 0%, #065180 100%);
    box-shadow: 0 0 30px rgba(6, 81, 128, 0.7);
  }
  /* 50% to 75%: Exhale */
  75% {
    transform: scale(0.45);
    background: radial-gradient(circle, #065180 0%, var(--color-teal) 100%);
    box-shadow: 0 0 15px rgba(4, 120, 166, 0.4);
  }
  /* 75% to 100%: Hold Empty */
  100% {
    transform: scale(0.45);
    background: radial-gradient(circle, var(--color-teal) 0%, var(--color-sky) 100%);
    box-shadow: 0 0 15px rgba(84, 193, 217, 0.4);
  }
}

/* Bulk Import & Dropzone */
.import-dropzone {
  border: 2px dashed rgba(84, 193, 217, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(1, 9, 15, 0.25);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.import-dropzone:hover {
  border-color: var(--color-sky);
  background: rgba(84, 193, 217, 0.05);
  box-shadow: 0 0 15px rgba(84, 193, 217, 0.15);
}

.import-dropzone.dragover {
  border-color: var(--color-teal);
  background: rgba(77, 201, 166, 0.08);
  box-shadow: 0 0 20px rgba(77, 201, 166, 0.15);
  transform: scale(1.01);
}

/* Bulk Import Wizard Cards */
.import-wizard-card {
  background: rgba(2, 18, 29, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.import-wizard-card:hover {
  border-color: var(--glass-border-focus);
}

.import-wizard-card.excluded {
  opacity: 0.4;
  border-color: rgba(251, 254, 255, 0.05);
}

.import-wizard-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.import-wizard-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 0.25rem;
  cursor: pointer;
  accent-color: var(--color-teal);
  flex-shrink: 0;
}

.import-wizard-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-left: 2.25rem;
}

.import-wizard-subtasks-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 2px solid rgba(84, 193, 217, 0.15);
  padding-left: 1rem;
  margin-top: 0.5rem;
}

.import-wizard-subtask-item {
  display: grid;
  grid-template-columns: 2fr 2fr 100px;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 600px) {
  .import-wizard-card-body {
    padding-left: 0;
  }
  
  .import-wizard-subtask-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(1, 9, 15, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
  }
}

/* Custom DOM Scroll Indicator */
.custom-scroll-track {
  position: fixed;
  right: 4px;
  top: 70px;
  bottom: 80px;
  width: 5px;
  background: rgba(2, 18, 29, 0.4);
  border: 1px solid rgba(84, 193, 217, 0.15);
  border-radius: 4px;
  z-index: 1050;
  display: none; /* Managed by JS */
  pointer-events: none; /* Clicks pass through */
}

@media (min-width: 1025px) {
  .custom-scroll-track {
    top: 20px;
    bottom: 20px;
    right: 6px;
    width: 6px;
  }
}

.custom-scroll-thumb {
  width: 100%;
  background: rgba(84, 193, 217, 0.55);
  box-shadow: 0 0 8px rgba(84, 193, 217, 0.35);
  border-radius: 4px;
  transition: transform 0.02s linear;
}



