/* ==========================================================================
   Trello Timeline View - Ultra Premium Design System
   Matches Asana / Trello Premium Timeline View with Pixel Parity
   ========================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Primary & Slate Tokens */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-sidebar: #FFFFFF;
  --border-color: #ECEEF1;
  --border-light: #F3F4F6;
  --text-main: #1F2937;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  
  /* Brand Blue */
  --brand-blue: #0079BF;
  --brand-blue-hover: #026AA7;
  --today-blue: #0284C7;
  
  /* Task Pill Color System (Matches Screenshot Exactly) */
  --pill-yellow-bg: #FEEFAD;
  --pill-yellow-text: #855806;
  --pill-yellow-border: #FCE588;
  
  --pill-blue-bg: #BAE0F7;
  --pill-blue-text: #134E75;
  --pill-blue-border: #A4D3F3;
  
  --pill-purple-bg: #E1D7F5;
  --pill-purple-text: #533296;
  --pill-purple-border: #D1C3EE;
  
  --pill-green-bg: #BCEDB8;
  --pill-green-text: #266221;
  --pill-green-border: #A8E5A1;
  
  --pill-milestone-bg: #FDE8E8;
  --pill-milestone-text: #B91C1C;
  --pill-milestone-border: #F87171;
  
  /* Layout Dimensions */
  --sidebar-width: 140px;
  --col-day-width: 140px;
  --header-height: 58px;
  --row-height: 84px;
  --today-line-color: #EF4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.4;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: #FFFFFF;
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  background: #FFFFFF;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.top-left, .top-center, .top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: #111827;
  letter-spacing: -0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.brand:hover {
  opacity: 0.85;
}

.brand:active {
  transform: scale(0.98);
}

.trello-icon {
  width: 26px;
  height: 26px;
}

.brand-title {
  font-weight: 700;
  color: #1E293B;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background-color: #E2E8F0;
  margin: 0 4px;
}

.toggle-completed-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: #4B5563;
  background-color: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.toggle-completed-btn:hover {
  background-color: #F3F4F6;
  border-color: #D1D5DB;
  color: #111827;
}

.toggle-completed-btn.active {
  background-color: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.toggle-completed-btn.active svg {
  stroke: #059669;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: #374151;
  background-color: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.refresh-btn:hover {
  background-color: #F3F4F6;
  border-color: #D1D5DB;
  color: #111827;
}

.refresh-btn:active {
  background-color: #E5E7EB;
}

.refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.board-selector-wrap label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.select-dropdown {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: #1F2937;
  background-color: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-dropdown:hover {
  background-color: #F3F4F6;
  border-color: #D1D5DB;
}

.select-dropdown:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}

.group-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.control-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pill-group {
  display: flex;
  background-color: #F3F4F6;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.pill-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn.active {
  background-color: #FFFFFF;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Date Navigator */
.nav-date-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #F9FAFB;
  padding: 3px 6px;
  border-radius: 10px;
  border: 1px solid #E5E7EB;
}

.nav-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  color: #4B5563;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background-color: #E5E7EB;
  color: #111827;
}

.today-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: #1F2937;
  cursor: pointer;
  transition: all 0.15s ease;
}

.today-btn:hover {
  background-color: #E5E7EB;
}

.date-range-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111827;
  padding: 0 8px;
  letter-spacing: -0.01em;
}

/* Zoom & Action Buttons */
.zoom-controls {
  display: flex;
  background-color: #F3F4F6;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.zoom-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoom-btn.active {
  background-color: #FFFFFF;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.primary-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  color: #FFFFFF;
  background-color: var(--brand-blue);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 121, 191, 0.3);
}

.primary-btn:hover {
  background-color: var(--brand-blue-hover);
  transform: translateY(-1px);
}

.secondary-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: #374151;
  background-color: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.secondary-btn:hover {
  background-color: #E5E7EB;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background-color: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #065F46;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   Main Timeline Wrapper
   ========================================================================== */
.timeline-wrapper {
  display: flex;
  flex: 1;
  height: auto;
  min-height: 0;
  width: 100vw;
  overflow: hidden;
  position: relative;
  background-color: #FFFFFF;
}

/* Left Sidebar (Milestone & People Columns) */
.timeline-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  border-right: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 30;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.02);
}

.sidebar-corner-cell {
  height: 48px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  background-color: #FAFBFD;
}

.sidebar-rows-container {
  display: flex;
  flex-direction: column;
  overflow-y: hidden; /* Synced with main grid */
}

/* Sidebar Row Cell (Matches screenshot exact layout: Avatar + Name) */
.sidebar-row-cell {
  min-height: 76px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  background-color: #FFFFFF;
  transition: background-color 0.15s ease, height 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar-row-cell:hover {
  background-color: #F9FAFB;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1.5px solid #FFFFFF;
}

.sidebar-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-label-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 0px;
  flex-shrink: 0;
}

.sidebar-label-tag svg {
  width: 15px;
  height: 15px;
  color: #FFFFFF;
}

.sidebar-row-cell.is-label-row .sidebar-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1F2937;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
}

.sidebar-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
}

/* Milestone Cell (Top row in screenshot) */
.sidebar-row-cell.is-milestone-row .milestone-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #F3F4F6;
  border: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
}

/* ==========================================================================
   Right Area: Scrollable Grid
   ========================================================================== */
.timeline-grid-container {
  flex: 1;
  overflow: auto;
  position: relative;
  background-color: #FFFFFF;
}

/* Sleek Modern Scrollbars for Timeline */
.timeline-grid-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.timeline-grid-container::-webkit-scrollbar-track {
  background: #F8FAFC;
}

.timeline-grid-container::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.timeline-grid-container::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Header Row (Day 9, Day 10, Day 11...) */
.timeline-header-row {
  display: flex;
  height: 48px;
  border-bottom: 1px solid var(--border-color);
  background-color: #FAFBFD;
  position: sticky;
  top: 0;
  z-index: 20;
}

.timeline-day-header {
  width: var(--col-day-width);
  min-width: var(--col-day-width);
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #6B7280;
  user-select: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.timeline-day-header:hover {
  background-color: #F1F4F9;
}

/* Highlighted current/active day badge (Wed 11 in screenshot) */
.timeline-day-header.is-today {
  color: #0284C7;
  font-weight: 700;
}

/* Weekend Day Header Box (Saturday & Sunday) */
.timeline-day-header.is-weekend {
  background-color: #EDEFF2;
  color: #64748B;
}

.timeline-day-header.is-weekend .day-badge-pill {
  color: #64748B;
}

.timeline-day-header.is-weekend.is-today {
  color: #0284C7;
}

/* Holiday Day Header Box */
.timeline-day-header.is-holiday {
  background-color: #EDEFF2;
  color: #1E293B;
}

.timeline-day-header.is-holiday .holiday-icon-indicator {
  font-size: 0.85rem;
  line-height: 1;
  margin-left: 2px;
}

.day-badge-pill {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-day-header.is-today .day-badge-pill,
.timeline-day-header.is-weekend.is-today .day-badge-pill {
  background-color: #0284C7;
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.4);
}

/* Vertical "Today" Time Marker Line */
.today-marker-line {
  position: absolute;
  top: 48px;
  bottom: 0;
  min-height: calc(100% - 48px);
  width: 2px;
  background-color: var(--today-line-color);
  z-index: 15;
  pointer-events: none;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.today-marker-line::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--today-line-color);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

/* SVG Dependency Overlay */
.dependency-svg-layer {
  position: absolute;
  top: 48px;
  left: 0;
  width: 100%;
  height: calc(100% - 48px);
  pointer-events: none;
  z-index: 12;
}

.dependency-curve {
  fill: none;
  stroke: #D1D5DB;
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: stroke 0.2s ease;
}

.dependency-curve:hover {
  stroke: #6B7280;
  stroke-width: 3;
}

/* Grid Body Rows */
.timeline-grid-body {
  position: relative;
  display: flex;
  flex-direction: column;
}

.timeline-grid-row {
  min-height: 56px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  display: flex;
  transition: height 0.2s ease;
  box-sizing: border-box;
}

/* Background Day Columns */
.grid-col-cell {
  width: var(--col-day-width);
  min-width: var(--col-day-width);
  height: 100%;
  border-right: 1px solid var(--border-color);
  background-color: #FFFFFF;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.grid-col-cell:hover {
  background-color: #FAFAFC;
}

.grid-col-cell.is-today-col {
  background-color: #F0F9FF20;
}

/* Weekend Grid Column (Saturday & Sunday) */
.grid-col-cell.is-weekend-col {
  background-color: #F4F5F7;
}

.grid-col-cell.is-weekend-col:hover {
  background-color: #EBEDF0;
}

.grid-col-cell.is-weekend-col.is-today-col {
  background-color: #E0F2FE80;
}

/* Holiday Grid Column (Same light grey as weekend) */
.grid-col-cell.is-holiday-col {
  background-color: #F4F5F7;
}

.grid-col-cell.is-holiday-col:hover {
  background-color: #EBEDF0;
}

.grid-col-cell.is-holiday-col.is-today-col {
  background-color: #E0F2FE80;
}

/* ==========================================================================
   Task Bars / Pills (Exact Screenshot Recreation)
   ========================================================================== */
.task-pill {
  position: absolute;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 2px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  z-index: 10;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.task-pill:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  z-index: 18;
}

.task-pill.is-dragging {
  cursor: grabbing !important;
  opacity: 0.92;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16) !important;
  transform: scale(1.02);
  z-index: 50 !important;
  transition: none !important;
}

body.is-dragging-task {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: grabbing !important;
}

.task-pill-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
  pointer-events: none;
}

.task-pill-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Resize Handles (Left and Right edges) */
.task-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: ew-resize;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.task-pill:hover .task-resize-handle {
  opacity: 1;
}

.task-resize-handle.resize-left {
  left: 0;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.task-resize-handle.resize-right {
  right: 0;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.task-resize-handle:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.task-resize-handle::after {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background-color: currentColor;
  opacity: 0.45;
}

.task-resize-handle:hover::after {
  opacity: 0.95;
  height: 15px;
}

/* Drag & Resize Live Tooltip */
.task-drag-tooltip {
  position: fixed;
  z-index: 9999;
  background: #111827;
  color: #FFFFFF;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
}

/* Task Pill Colors */
.task-pill.color-yellow {
  background-color: var(--pill-yellow-bg);
  color: var(--pill-yellow-text);
  border: 1px solid var(--pill-yellow-border);
}

.task-pill.color-blue {
  background-color: var(--pill-blue-bg);
  color: var(--pill-blue-text);
  border: 1px solid var(--pill-blue-border);
}

.task-pill.color-purple {
  background-color: var(--pill-purple-bg);
  color: var(--pill-purple-text);
  border: 1px solid var(--pill-purple-border);
}

.task-pill.color-green {
  background-color: var(--pill-green-bg);
  color: var(--pill-green-text);
  border: 1px solid var(--pill-green-border);
}

.task-pill.color-orange {
  background-color: #FED7AA;
  color: #9A3412;
  border: 1px solid #FDBA74;
}

.task-pill.color-pink {
  background-color: #FCE7F3;
  color: #9D174D;
  border: 1px solid #FBCFE8;
}

.task-pill.color-sky {
  background-color: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.task-pill.color-lime {
  background-color: #ECFCCB;
  color: #3F6212;
  border: 1px solid #D9F99D;
}

.task-pill.color-red {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.task-pill.color-gray {
  background-color: #F3F4F6;
  color: #374151;
  border: 1px solid #E5E7EB;
}

/* Milestone Box (e.g. Product Demo on Friday) */
.task-pill.color-milestone {
  background-color: var(--pill-milestone-bg);
  color: var(--pill-milestone-text);
  border: 1px solid var(--pill-milestone-border);
  border-radius: 6px;
  height: 38px;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
}

/* Checkmark badge inside task (like 'Mobile app prototype' in screenshot) */
.task-pill-icon {
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-check-circle {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  max-width: 15px;
  max-height: 15px;
  aspect-ratio: 1 / 1;
  flex: 0 0 15px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: #16A34A;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
  margin-right: 2px;
}

.task-check-circle svg {
  width: 8.5px;
  height: 8.5px;
  display: block;
  stroke: #FFFFFF;
  stroke-width: 2.2;
}

/* Automatic State-based Color Overrides */
/* 1. Mint Green: Checklist is 100% completed */
.task-pill.is-completed,
.task-pill.color-green {
  background-color: var(--pill-green-bg) !important;
  color: var(--pill-green-text) !important;
  border: 1px solid var(--pill-green-border) !important;
}

.task-pill.is-completed:hover,
.task-pill.color-green:hover {
  background-color: #AEE6A9 !important;
  border-color: #97D990 !important;
}

.task-pill.is-completed .task-check-circle,
.task-pill.color-green .task-check-circle {
  background-color: #16A34A;
  color: #FFFFFF;
}

/* 2. Red: Task is overdue (due date < today and not 100% completed) */
.task-pill.is-overdue {
  background-color: #FEE2E2 !important;
  color: #991B1B !important;
  border: 1px solid #FCA5A5 !important;
}

.task-pill.is-overdue:hover {
  background-color: #FED4D4 !important;
  border-color: #F87171 !important;
}

.task-pill.is-overdue .task-pill-checklist-badge {
  color: #991B1B;
}

.task-overdue-icon {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 3px;
  line-height: 1;
  flex-shrink: 0;
}

/* Stacking Sub-Tracks inside a single row */
.task-pill.track-0 {
  top: 8px;
}

.task-pill.track-1 {
  top: 44px;
}

/* ==========================================================================
   Bottom Drawer: Unscheduled Cards
   ========================================================================== */
.unscheduled-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 240px;
  background-color: #FFFFFF;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 50;
  display: none;
  flex-direction: column;
  transition: transform 0.25s ease;
}

.unscheduled-drawer.open {
  display: flex;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-light);
  background-color: #FAFBFD;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-title h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drawer-cards-list {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  overflow-x: auto;
}

.unscheduled-card-item {
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 200px;
  max-width: 240px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
}

.unscheduled-card-item:hover {
  border-color: var(--brand-blue);
  box-shadow: 0 3px 8px rgba(0, 121, 191, 0.15);
  transform: translateY(-2px);
}

.unscheduled-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unscheduled-card-list {
  font-size: 0.75rem;
  color: #6B7280;
  display: inline-block;
  background-color: #F3F4F6;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   Edit Card Modal Dialog
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background-color: #FFFFFF;
  border-radius: 16px;
  width: 96%;
  max-width: 1040px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 35px -5px rgba(0, 0, 0, 0.12), 0 12px 16px -5px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  border: 1px solid #E5E7EB;
  animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #E5E7EB;
  background-color: #FAFBFD;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #9CA3AF;
  cursor: pointer;
}

.close-btn:hover {
  color: #4B5563;
}

.modal-form {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

/* Two-Column Modal Body Layout */
.modal-body-layout {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 24px;
  align-items: start;
}

.modal-body-layout.holiday-mode {
  grid-template-columns: 1fr;
}

.modal-body-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #FAFBFD;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px 18px;
}

@media (max-width: 860px) {
  .modal-body-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* Checklist Section Styling */
.checklist-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.checklist-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
}

.checklist-panel-title svg {
  color: #0079BF;
}

.checklist-counter-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background-color: #E0F2FE;
  color: #0284C7;
  transition: all 0.2s ease;
}

.checklist-counter-badge.is-all-done {
  background-color: #DCFCE7;
  color: #15803D;
}

.checklist-progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: #E5E7EB;
  border-radius: 6px;
  overflow: hidden;
  margin: 2px 0 4px 0;
}

.checklist-progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #0079BF;
  border-radius: 6px;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
}

.checklist-progress-bar-fill.is-all-done {
  background-color: #10B981;
}

.checklist-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.checklist-empty-hint {
  font-size: 0.82rem;
  color: #9CA3AF;
  padding: 14px 10px;
  text-align: center;
  border: 1px dashed #E5E7EB;
  border-radius: 8px;
  background-color: #FFFFFF;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.checklist-item:hover {
  border-color: #CBD5E1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.checklist-item.is-checked {
  background-color: #F8FAFC;
}

.checklist-item-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #0079BF;
  flex-shrink: 0;
}

.checklist-item-text {
  flex: 1;
  font-size: 0.85rem;
  color: #1F2937;
  word-break: break-word;
  line-height: 1.4;
  user-select: text;
}

.checklist-item.is-checked .checklist-item-text {
  text-decoration: line-through;
  color: #9CA3AF;
}

.checklist-item-delete {
  background: transparent;
  border: none;
  color: #9CA3AF;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.5;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.checklist-item-delete:hover {
  opacity: 1;
  color: #EF4444;
  background-color: #FEE2E2;
}

.checklist-add-form {
  margin-top: 6px;
}

.checklist-add-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.checklist-add-input-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 0.84rem;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.checklist-add-input-row input:focus {
  border-color: #0079BF;
  box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}

.checklist-add-btn {
  background-color: #0079BF;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.checklist-add-btn:hover {
  background-color: #026aa7;
}

/* Timeline Pill Checklist Prefix Badge */
.task-pill-checklist-badge {
  font-weight: 700;
  opacity: 0.95;
  margin-right: 4px;
  letter-spacing: -0.2px;
  flex-shrink: 0;
  display: inline-block;
}

/* Segmented Entry Type Selector (Task vs Holiday / Leave) */
.entry-type-selector {
  display: flex;
  background-color: #F3F4F6;
  padding: 4px;
  border-radius: 9px;
  gap: 6px;
  border: 1px solid #E5E7EB;
}

.entry-type-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.entry-type-tab input[type="radio"] {
  display: none;
}

.entry-type-tab:hover {
  color: #1F2937;
}

.entry-type-tab.active,
.entry-type-tab:has(input:checked) {
  background-color: #FFFFFF;
  color: #0079BF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.date-format-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9CA3AF;
  margin-left: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.form-group input, .form-group select, .form-group textarea {
  padding: 9px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.form-group textarea {
  resize: vertical;
  min-height: 72px;
  max-height: 180px;
  line-height: 1.45;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 121, 191, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row.form-row-3 {
  grid-template-columns: 1.25fr 1fr 0.85fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .form-row,
  .form-row.form-row-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid #E5E7EB;
}

.modal-actions-left,
.modal-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Enforce uniform height, vertical alignment, and zero text-wrapping on all modal buttons */
.modal-actions button {
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  line-height: 1;
  white-space: nowrap;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 8px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.modal-actions button svg {
  flex-shrink: 0;
  display: block;
}

.modal-actions button span {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
}

.complete-btn {
  background-color: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #059669;
  padding: 0 16px;
  gap: 7px;
}

.complete-btn:hover {
  background-color: #D1FAE5;
  border-color: #6EE7B7;
  color: #047857;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.15);
}

.unschedule-btn {
  background-color: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #D97706;
  padding: 0 14px;
  gap: 7px;
}

.unschedule-btn:hover {
  background-color: #FEF3C7;
  border-color: #FCD34D;
  color: #B45309;
}

.archive-btn {
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  padding: 0 14px;
  gap: 6px;
}

.archive-btn:hover {
  background-color: #FEE2E2;
  border-color: #FCA5A5;
  color: #B91C1C;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.15);
}

.modal-actions-right .secondary-btn {
  background-color: #F3F4F6;
  border: 1px solid #E5E7EB;
  color: #374151;
  padding: 0 18px;
}

.modal-actions-right .secondary-btn:hover {
  background-color: #E5E7EB;
  color: #111827;
}

.modal-actions-right .primary-btn {
  background-color: var(--brand-blue);
  border: 1px solid var(--brand-blue);
  color: #FFFFFF;
  padding: 0 20px;
  font-weight: 700;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 121, 191, 0.25);
}

.modal-actions-right .primary-btn:hover {
  background-color: var(--brand-blue-hover);
  border-color: var(--brand-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 121, 191, 0.35);
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clear-field-link {
  background: transparent;
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s ease;
}

.clear-field-link:hover {
  color: #EF4444;
  text-decoration: underline;
}

.danger-btn {
  background: transparent;
  border: 1px solid #FCA5A5;
  color: #DC2626;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.danger-btn:hover {
  background-color: #FEE2E2;
}

/* Double-click Navigation & Focus States */
.sidebar-row-cell {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.sidebar-row-cell:hover {
  background-color: #F8FAFC;
}

.sidebar-row-cell.row-nav-flash {
  background-color: #E0F2FE !important;
  transition: background-color 0.15s ease;
}

/* Pulsing highlight for focused task pill */
@keyframes taskPillPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 121, 191, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 121, 191, 0);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 121, 191, 0);
    transform: scale(1);
  }
}

.task-pill.is-nav-focused {
  animation: taskPillPulse 0.75s ease-in-out 3;
  outline: 2.5px solid #0079BF;
  outline-offset: 1px;
  z-index: 50 !important;
}

/* Sleek Floating Navigation Toast */
.timeline-nav-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-nav-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.timeline-nav-toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #38BDF8;
  box-shadow: 0 0 8px #38BDF8;
}


/* ==========================================================================
   Comprehensive Responsive Architecture (Mobile, Tablet, Desktop)
   ========================================================================== */

/* Button Text Visibility Defaults (Desktop) */
.btn-text-full {
  display: inline;
}
.btn-text-compact {
  display: none;
}

/* Sidebar Toggle Button (Hidden on Desktop) */
.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.sidebar-toggle-btn:hover {
  background-color: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}
.sidebar-toggle-btn.active {
  background-color: #E0F2FE;
  color: #0284C7;
  border-color: #BAE6FD;
}
.sidebar-toggle-btn svg {
  flex-shrink: 0;
}

/* Smooth Sidebar Transitions & Responsive Collapse */
.timeline-sidebar {
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              min-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.18s ease;
}
.timeline-sidebar.collapsed-mobile {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  border-right: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* Inertial Touch-Scrolling Engine */
.timeline-grid-container {
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  
}
.sidebar-rows-container {
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Tablet Breakpoint (769px - 1024px) - e.g. iPad, iPad Air, Surface Pro
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 110px;
    --col-day-width: 115px;
  }
  .top-bar {
    height: auto;
    min-height: 56px;
    padding: 8px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: 8px;
    column-gap: 10px;
  }
  .top-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
  .brand-divider {
    display: none;
  }
  .control-label {
    display: none;
  }
  .pill-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
  }
  .top-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }
  .sidebar-toggle-btn {
    display: inline-flex;
  }
  .sidebar-toggle-btn .btn-text,
  .refresh-btn span,
  .toggle-completed-btn .btn-text,
  .sync-status .status-text {
    display: none;
  }
  .refresh-btn,
  .toggle-completed-btn,
  .sidebar-toggle-btn {
    padding: 0 9px;
    height: 32px;
  }
  .sync-status {
    padding: 0 6px;
    min-width: 24px;
    height: 32px;
    justify-content: center;
  }
  .secondary-btn {
    padding: 0 10px;
    height: 32px;
    font-size: 0.78rem;
  }
  .primary-btn {
    padding: 0 12px;
    height: 32px;
    font-size: 0.8rem;
  }
  .top-center {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 6px;
    border-top: 1px solid #F1F5F9;
  }
  .sidebar-corner-cell {
    font-size: 0.72rem;
  }
  .sidebar-row-cell {
    padding: 5px;
  }
  .sidebar-avatar,
  .sidebar-avatar-placeholder {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  .sidebar-name {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Mobile Breakpoint (<= 768px) - e.g. iPhone 14/15, Pixel, Galaxy
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 86px;
    --col-day-width: 96px;
    --row-height: 74px;
  }

  /* Compact button text toggle */
  .btn-text-full {
    display: none;
  }
  .btn-text-compact {
    display: inline;
  }

  .top-bar {
    height: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  /* Row 1: Brand (left) & Group by Toggle Pills (right) */
  .top-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 6px;
  }
  .brand {
    font-size: 1.05rem;
    gap: 7px;
    flex-shrink: 0;
  }
  .trello-icon {
    width: 22px;
    height: 22px;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .group-toggle-wrap {
    margin-left: auto;
    gap: 4px;
  }
  .control-label {
    display: none;
  }
  .pill-group {
    padding: 2px;
    gap: 2px;
  }
  .pill-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  /* Row 2: Date Navigation Controls Centered */
  .top-center {
    width: 100%;
    order: 2;
    display: flex;
    justify-content: center;
    padding: 4px 0;
    border-top: 1px solid #F1F5F9;
    border-bottom: 1px solid #F1F5F9;
  }
  .nav-date-controls {
    gap: 6px;
  }
  .nav-btn {
    width: 28px;
    height: 28px;
  }
  .today-btn {
    height: 28px;
    padding: 0 10px;
    font-size: 0.75rem;
  }
  .date-range-label {
    font-size: 0.82rem;
    font-weight: 700;
  }

  /* Row 3: Action Buttons & Zoom Controls Perfectly Spaced */
  .top-right {
    width: 100%;
    order: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    margin-left: 0;
    flex-wrap: nowrap;
  }
  .zoom-controls {
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
  }
  .zoom-btn {
    padding: 3px 7px;
    font-size: 0.72rem;
  }
  .refresh-btn span,
  .toggle-completed-btn .btn-text,
  .sidebar-toggle-btn .btn-text,
  .sync-status .status-text {
    display: none;
  }
  .refresh-btn,
  .toggle-completed-btn,
  .sidebar-toggle-btn {
    padding: 0 8px;
    height: 30px;
    flex-shrink: 0;
  }
  .secondary-btn {
    padding: 0 8px;
    height: 30px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 4px;
  }
  .secondary-btn svg {
    margin-right: 2px;
  }
  .primary-btn {
    padding: 0 10px;
    height: 30px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 4px;
  }
  .sync-status {
    padding: 0 5px;
    min-width: 20px;
    height: 30px;
    flex-shrink: 0;
    justify-content: center;
  }

  /* Compact Sidebar on Mobile */
  .sidebar-corner-cell {
    height: 44px;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
  }
  .sidebar-row-cell {
    min-height: 68px;
    padding: 4px 2px;
    gap: 2px;
  }
  .sidebar-avatar,
  .sidebar-avatar-placeholder {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }
  .sidebar-label-tag {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }
  .sidebar-label-tag svg {
    width: 12px;
    height: 12px;
  }
  .sidebar-name {
    font-size: 0.68rem;
    line-height: 1.15;
    max-width: 80px;
  }

  /* Compact Timeline Header & Pills on Mobile */
  .timeline-header-row {
    height: 44px;
  }
  .timeline-day-header {
    font-size: 0.76rem;
    gap: 4px;
  }
  .task-pill {
    font-size: 0.7rem;
    height: 26px;
    line-height: 26px;
    padding: 0 7px;
  }
  .task-pill-inner {
    gap: 4px;
  }
  .task-pill-title {
    font-size: 0.7rem;
  }

  /* Mobile Responsive Modals (Bottom Sheet / Scrollable Dialog) */
  .modal-overlay {
    padding: 8px;
    align-items: center;
  }
  .modal-content {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
    padding: 18px 16px;
    border-radius: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-header h2 {
    font-size: 1.15rem;
  }
  .modal-type-tabs {
    margin-bottom: 14px;
  }
  .modal-tab-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    padding: 9px 12px;
  }
  .modal-actions {
    flex-direction: column-reverse;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
  }
  .modal-actions-left {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
  }
  .modal-actions-right {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-actions button {
    width: 100%;
    height: 40px;
    justify-content: center;
  }

  /* Unscheduled Drawer Mobile Bottom Sheet */
  .unscheduled-drawer {
    max-height: 60vh;
  }
  .drawer-header {
    padding: 10px 14px;
  }
  .unscheduled-list {
    padding: 10px 14px;
    gap: 10px;
  }
  .unscheduled-card {
    min-width: 220px;
  }
}
