/* ==========================================================================
   DAYFLOW V2 — MODULAR DESIGN SYSTEM & STYLES
   ========================================================================== */

:root {
  /* Color Palette - Premium Dark Theme */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-glass: rgba(30, 41, 59, 0.75);
  --bg-glass-card: rgba(15, 23, 42, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(99, 102, 241, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #06b6d4;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  /* Category Tags Colors */
  --cat-learning: #8b5cf6;
  --cat-work: #3b82f6;
  --cat-household: #10b981;
  --cat-family: #ec4899;
  --cat-health: #f59e0b;
  --cat-travel: #06b6d4;
  --cat-general: #64748b;

  /* Fonts & Shadows */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Safe Area Insets for Mobile */
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Nav */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

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

.logo-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.view-nav {
  display: flex;
  background: var(--bg-primary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 0.25rem;
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: #fff;
  background: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* View Panels Switching */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: #475569;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.btn-danger:hover {
  background: var(--accent-danger);
  color: #fff;
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.icon-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Controls Bar & Calendar Picker */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

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

.calendar-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-md);
}

.date-picker-input {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
}

.week-range-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.select-input, .text-input, .number-input {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.select-input:focus, .text-input:focus, .number-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.text-input.input-locked {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
}

.field-lock-msg {
  font-size: 0.7rem;
  color: var(--accent-warning);
  font-weight: 600;
  margin-top: 0.2rem;
}

/* Main Layout */
.main-content {
  flex: 1;
  padding: 1.5rem 2rem;
}

.view-panel {
  display: none;
}
.view-panel.active {
  display: block;
}

/* 30-Min Schedule Grid */
.grid-wrapper {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.timeline-table-container {
  overflow-x: auto;
  max-height: calc(100vh - 200px);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 980px;
}

.schedule-table th, .schedule-table td {
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.8rem;
}

.schedule-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}

.schedule-table th.time-col {
  width: 100px;
  text-align: center;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.schedule-table th.day-col {
  text-align: center;
}

.day-date {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
}

.time-cell {
  background: rgba(30, 41, 59, 0.8);
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.75rem;
  vertical-align: middle !important;
}

.slot-cell {
  height: 58px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
}

.slot-cell:hover {
  background: rgba(99, 102, 241, 0.08);
}

.slot-cell.empty:hover::after {
  content: "+ Add Task";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.slot-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  height: 100%;
  justify-content: space-between;
}

.slot-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.slot-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planned-subtext {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-indicator {
  font-size: 0.7rem;
  line-height: 1;
}

.slot-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
}

.category-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95px;
}

.category-tag.Learning { background: var(--cat-learning); }
.category-tag.Work { background: var(--cat-work); }
.category-tag.Household { background: var(--cat-household); }
.category-tag.Family { background: var(--cat-family); }
.category-tag.Health { background: var(--cat-health); }
.category-tag.Travel { background: var(--cat-travel); }
.category-tag.General { background: var(--cat-general); }

.time-dur-badge {
  color: var(--text-secondary);
  font-weight: 500;
}
.time-dur-badge strong {
  color: var(--accent-secondary);
}

.slot-cell.status-Done {
  border-left: 3px solid var(--accent-success);
  background: rgba(16, 185, 129, 0.05);
}
.slot-cell.status-Partially {
  border-left: 3px solid var(--accent-warning);
  background: rgba(245, 158, 11, 0.05);
}
.slot-cell.status-Not {
  border-left: 3px solid var(--accent-danger);
  background: rgba(239, 68, 68, 0.05);
}

/* Strike-through and subtle dimming for Done tasks */
.slot-cell.status-Done .slot-title {
  text-decoration: line-through;
  opacity: 0.8;
}

/* ==========================================================================
   INLINE GRID TASK TITLE & DURATION EDITING
   ========================================================================== */

.slot-title.inline-editable {
  cursor: text;
  border-radius: var(--radius-sm, 4px);
  padding: 0 0.2rem;
  margin-left: -0.2rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.slot-title.inline-editable:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: underline dashed rgba(255, 255, 255, 0.45);
}

.slot-cell.status-Done .slot-title.inline-editable:hover {
  text-decoration: line-through underline dashed rgba(255, 255, 255, 0.45);
}

.inline-title-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--accent-primary, #6366f1);
  border-radius: var(--radius-sm, 4px);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  padding: 0.12rem 0.35rem;
  line-height: 1.2;
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
  box-sizing: border-box;
  z-index: 5;
  position: relative;
}

.actual-time-badge.inline-editable {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm, 4px);
  padding: 0 0.25rem;
  margin: -0.05rem -0.15rem;
  transition: all 0.15s ease;
  border-bottom: 1px dashed rgba(165, 180, 252, 0.4);
}

.actual-time-badge.inline-editable:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  border-bottom-color: #a5b4fc;
  transform: scale(1.05);
}

.inline-duration-input {
  width: 52px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--accent-primary, #6366f1);
  border-radius: var(--radius-sm, 4px);
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  padding: 0.05rem 0.2rem;
  text-align: center;
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
  box-sizing: border-box;
  z-index: 5;
  position: relative;
}

/* Hide spin buttons on inline number input for clean look */
.inline-duration-input::-webkit-outer-spin-button,
.inline-duration-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inline-duration-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ==========================================================================
   INTERACTIVE GRID TASK STATUS CONTROLS (Option 3: Quick Toggle & Popover)
   ========================================================================== */

.status-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm, 6px);
  padding: 0.15rem 0.35rem;
  font-size: 0.72rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  line-height: 1;
  position: relative;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-quick-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.status-quick-btn:active {
  transform: scale(0.95);
}

.status-quick-btn .status-btn-icon {
  display: inline-block;
  font-size: 0.82rem;
  line-height: 1;
}

.status-quick-btn .status-name {
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.15rem;
}

/* Status-specific button badge styling */
.status-quick-btn.status-btn-Done {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}
.status-quick-btn.status-btn-Done:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.status-quick-btn.status-btn-Partially {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}
.status-quick-btn.status-btn-Partially:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.status-quick-btn.status-btn-Not {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}
.status-quick-btn.status-btn-Not:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.status-quick-btn.status-btn-Pending {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
}
.status-quick-btn.status-btn-Pending:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* Status Quick Popover Menu */
.status-quick-menu {
  position: fixed;
  z-index: 10000;
  background: rgba(20, 24, 36, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-highlight, rgba(255, 255, 255, 0.18));
  border-radius: var(--radius-md, 10px);
  padding: 0.35rem;
  min-width: 175px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  animation: contextMenuPop 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-menu-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0.3rem 0.5rem 0.2rem;
}

.status-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 6px);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}

.status-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.status-menu-item.active {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
  font-weight: 600;
}

.status-menu-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.status-menu-label {
  flex: 1;
}

.status-menu-check {
  font-size: 0.85rem;
  color: #34d399;
  opacity: 0;
}

.status-menu-item.active .status-menu-check {
  opacity: 1;
}

/* Status Chips inside Main Grid Context Menu */
.context-menu-section-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem 0.2rem;
}

.context-menu-status-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem 0.45rem;
}

.status-chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.status-chip-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.28);
}

.status-chip-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary, #6366f1);
  color: #fff;
}

/* Habit Ledger & Cards */
.habits-container, .analytics-container, .notes-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.panel-header h2 { font-size: 1.5rem; font-weight: 800; }
.panel-header p { color: var(--text-secondary); font-size: 0.9rem; }

/* Habit Target Log Date Bar */
.habit-date-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.date-bar-left, .date-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.date-bar-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.date-quick-pills {
  display: flex;
  gap: 0.4rem;
}

.date-pill {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.date-pill:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.date-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.custom-date-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.habit-date-picker {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
}

.habit-date-picker:focus {
  border-color: var(--accent-primary);
}

.habit-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.habit-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.habit-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.habit-btn .pts {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.preset-btn-wrapper {
  position: relative;
  display: flex;
}

.preset-btn-wrapper .habit-btn {
  width: 100%;
}

.preset-actions-badges {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.edit-preset-badge,
.remove-preset-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.edit-preset-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.65rem;
}

.remove-preset-badge {
  background: var(--accent-danger);
  color: #fff;
}

.preset-btn-wrapper:hover .edit-preset-badge,
.preset-btn-wrapper:hover .remove-preset-badge {
  opacity: 1;
  transform: scale(1.1);
}

.add-preset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
  background: rgba(30, 41, 59, 0.4);
  color: var(--accent-secondary);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-preset-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  color: #fff;
}

/* Preset Habit Creation Modal & Emoji/Points Pickers */
.modal-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-header-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  font-size: 1.1rem;
}

.emoji-picker-container,
.points-picker-container {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.emoji-quick-pills,
.points-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
}

.emoji-pill,
.points-pill {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.emoji-pill:hover,
.points-pill:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.emoji-pill.active,
.points-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.emoji-custom-input {
  width: 60px !important;
  text-align: center;
  font-size: 1.1rem;
  padding: 0.35rem 0.2rem !important;
}

.points-custom-input {
  width: 75px !important;
  text-align: center;
  font-size: 0.9rem;
}

/* Delete Preset Confirmation Modal */
.modal-card-confirm {
  max-width: 440px;
  text-align: center;
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.15);
}

.confirm-modal-body {
  padding: 2rem 1.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.confirm-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.confirm-icon {
  font-size: 1.75rem;
}

.confirm-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.confirm-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.confirm-desc strong {
  color: var(--text-primary);
}

.confirm-subdesc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.confirm-actions .btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.habit-form-card, .habit-history-card, .analytics-card, .todo-card, .notes-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.form-row { display: flex; gap: 0.75rem; margin-top: 1rem; }
.form-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.total-pts-badge {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent-secondary);
  background: rgba(6, 182, 212, 0.15);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); text-align: left; }
.data-table th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }

/* Analytics Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}

.stat-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-info { display: flex; flex-direction: column; width: 100%; }
.stat-label-wrapper { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }

.clickable-stat-card {
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.clickable-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  background: var(--bg-tertiary);
}

.stat-click-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-light);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.3);
  letter-spacing: 0.2px;
}

/* Points Bifurcation Modal Styling */
.points-bifurcation-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .points-bifurcation-summary {
    grid-template-columns: 1fr;
  }
}

.bifurcation-metric-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bifurcation-metric-icon {
  font-size: 1.5rem;
  background: var(--bg-secondary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.bifurcation-metric-info {
  display: flex;
  flex-direction: column;
}

.bifurcation-metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.bifurcation-metric-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.bifurcation-metric-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.bifurcation-metric-card.total-metric-card {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.05));
}

.bifurcation-metric-card.total-metric-card .bifurcation-metric-value {
  color: #34d399;
}

/* Filter Bar */
.bifurcation-filter-bar {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-primary);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.bifurcation-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

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

/* Points Audit Table */
.points-audit-table-container {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
}

.points-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.points-audit-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1;
}

.points-audit-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

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

.audit-pts-pill {
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-block;
}

.audit-source-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.audit-source-habit {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.audit-source-goal {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.category-bars-list { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.cat-bar-item { display: flex; flex-direction: column; gap: 0.4rem; }
.cat-bar-header { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; }

.progress-track {
  height: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.4s ease; }

/* Analytics Grid & Habit Reports */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.habit-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.habit-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.habit-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}

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

.habit-count-pill {
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.habit-pts-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* 7-Day Consistency Trend */
.habit-daily-trend-matrix {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .habit-daily-trend-matrix {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }
}

.daily-trend-day {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  transition: all 0.2s ease;
}

.daily-trend-day.has-habits {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.daily-trend-day.is-today {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.daily-trend-day.is-selected-day {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.trend-day-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.trend-day-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.trend-bar-wrapper {
  width: 12px;
  height: 60px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin: 0.25rem 0;
}

.trend-bar-fill {
  width: 100%;
  background: linear-gradient(to top, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
  transition: height 0.4s ease;
}

.trend-day-pts {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.trend-day-count {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Notes & Todo */
.notes-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; width: 100%; min-width: 0; }
@media (max-width: 768px) { .notes-grid { grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; } }

.todo-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.todo-text-input {
  width: 100%;
}

.todo-form-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.todo-select {
  flex: 1;
  min-width: 110px;
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  outline: none;
}

.todo-due-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.2rem 0.45rem;
}

.todo-date-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
  padding: 0.2rem 0.2rem;
  cursor: pointer;
}

.todo-due-quick-pills {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.todo-due-quick-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.todo-due-quick-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.todo-due-quick-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.todo-due-quick-btn.clear {
  padding: 0.2rem 0.4rem;
  color: #f87171;
}

.todo-due-quick-btn.clear:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.todo-add-btn {
  padding: 0.45rem 1.25rem;
  font-size: 0.85rem;
}

.todo-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.todo-filter-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.todo-filter-pill:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.todo-filter-pill.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.todo-day-scope-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.25rem;
}

.todo-day-scope-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.todo-day-scope-pill:hover {
  color: var(--text-primary);
}

.todo-day-scope-pill.active {
  background: var(--accent-primary);
  color: #fff;
}

.todo-item-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.todo-item:hover {
  border-color: var(--bg-tertiary);
  background: rgba(30, 41, 59, 0.4);
}

.todo-item-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.todo-item-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.todo-text {
  font-weight: 500;
  color: var(--text-primary);
}

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

/* Priority Badges */
.priority-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.priority-high {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-low {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.todo-category-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Due Date Badges */
.todo-due-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  letter-spacing: 0.01em;
}

.todo-due-today {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.todo-due-overdue {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.todo-due-tomorrow {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.todo-due-future {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.todo-scheduled-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.todo-item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.schedule-todo-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

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

.edit-todo-btn {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.edit-todo-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.scheduled-task-preview {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.preview-task-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.preview-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.25rem;
}

/* Multi-Day Time Block Controls */
.schedule-mode-tabs {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
}

.schedule-mode-tab {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.schedule-mode-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.multi-day-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.span-pills, .pattern-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.span-pill-btn, .pattern-pill-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.span-pill-btn:hover, .pattern-pill-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.span-pill-btn.active, .pattern-pill-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.chips-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.chips-summary-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.day-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.4rem;
  max-height: 180px;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-align: center;
}

.day-chip-name {
  font-size: 0.7rem;
  font-weight: 700;
}

.day-chip-date {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.day-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  color: #fff;
}

.day-chip.active .day-chip-date {
  color: var(--accent-primary);
}

.day-chip.skipped {
  background: var(--bg-primary);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  opacity: 0.45;
  text-decoration: line-through;
}

.day-chip.has-conflict {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3);
}

.day-chip.has-conflict.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: #fbbf24;
}

.day-chip.has-conflict .day-chip-date {
  color: #fbbf24;
}

/* Conflict Banner in Multi-Day toolbar */
.conflict-alert-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  gap: 0.5rem;
}

.conflict-banner-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.conflict-banner-msg {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fbbf24;
}

.btn-conflict-action {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-conflict-action:hover {
  background: #fbbf24;
  color: #0f172a;
}

/* Conflict Comparison Box in Modal */
.conflict-comparison-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin: 0.75rem 0;
  text-align: left;
}

.conflict-item {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.conflict-existing {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.conflict-incoming {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.conflict-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

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

.conflict-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.conflict-arrow {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

/* Scheduled Slots Warning in Delete Modal */
.scheduled-slots-warning-box {
  background: var(--bg-primary);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slots-warning-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slots-warning-icon {
  font-size: 1rem;
}

.slots-warning-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f87171;
}

.slots-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.slot-tag-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Todo Completion Progress Bar */
.todo-progress-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.progress-header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.progress-icon {
  font-size: 1rem;
}

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

.progress-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-light);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.todo-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.todo-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #6366f1 0%, #10b981 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-celebration-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #34d399;
  animation: celebrationGlow 2s infinite alternate;
}

@keyframes celebrationGlow {
  0% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.2); }
  100% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
}

/* Phase 4: Rich Markdown Journal & Code Scratchpad */
.notes-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.notes-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.notes-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

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

.notes-view-switcher {
  display: inline-flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.notes-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notes-mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.notes-mode-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.notes-status-pill {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 50px;
  text-align: right;
}

/* Phase 5: Note Sheets Sub-Navigation Tab Bar */
.notes-sheets-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 0.35rem 0.5rem;
  overflow: hidden;
  position: relative;
}

.sheets-scroll-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
  user-select: none;
}

.sheets-scroll-btn:hover {
  color: #fff;
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.2);
}

.notes-sheets-tab-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
  flex: 1 1 0%;
  min-width: 0 !important;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: 2px;
}

.notes-sheets-tab-bar::-webkit-scrollbar {
  height: 4px;
}

.notes-sheets-tab-bar::-webkit-scrollbar-track {
  background: transparent;
}

.notes-sheets-tab-bar::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 2px;
}

.notes-sheets-tab-bar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.note-sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  user-select: none;
}

.note-sheet-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.3);
}

.note-sheet-tab.active {
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.note-sheet-tab-icon {
  font-size: 0.95rem;
}

.note-sheet-tab-title {
  font-size: 0.78rem;
}

.note-sheet-tab-delete {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 0 0.2rem;
  margin-left: 0.2rem;
  cursor: pointer;
  border-radius: 3px;
  line-height: 1;
  transition: all 0.15s ease;
}

.note-sheet-tab-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.add-sheet-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.add-sheet-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Icon picker inside Modal */
.sheet-icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sheet-icon-option {
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sheet-icon-option:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  transform: scale(1.08);
}

.sheet-icon-option.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* Markdown Toolbar */
.notes-markdown-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-bottom: none;
  border-radius: 0;
  padding: 0.45rem 0.65rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
  margin: 0 0.25rem;
}

.toolbar-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.toolbar-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.toolbar-btn:active {
  transform: translateY(0);
}

.toolbar-snippet-select {
  font-size: 0.74rem;
  padding: 0.2rem 0.5rem;
  height: 26px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 4px;
}

/* Dual-Pane Editor & Live Preview Container */
.notes-dual-pane {
  display: grid;
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--bg-primary);
  overflow: hidden;
  min-height: 420px;
}

/* View Modes */
.notes-dual-pane.mode-edit {
  grid-template-columns: 1fr;
}
.notes-dual-pane.mode-edit .notes-preview-pane {
  display: none;
}

.notes-dual-pane.mode-preview {
  grid-template-columns: 1fr;
}
.notes-dual-pane.mode-preview .notes-editor-pane {
  display: none;
}

.notes-dual-pane.mode-split {
  grid-template-columns: 1fr 1fr;
}
.notes-dual-pane.mode-split .notes-editor-pane {
  border-right: 1px solid var(--border-color);
}

.notes-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.notes-textarea {
  width: 100%;
  flex: 1;
  min-height: 420px;
  background: transparent;
  color: var(--text-primary);
  border: none;
  padding: 1rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  tab-size: 2;
}

.notes-textarea:focus {
  background: rgba(99, 102, 241, 0.02);
}

/* Markdown Rendered Preview Pane */
.notes-preview-pane {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 520px;
  background: rgba(15, 23, 42, 0.4);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.notes-preview-pane .markdown-h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f8fafc;
  border-bottom: 2px solid rgba(99, 102, 241, 0.4);
  padding-bottom: 0.35rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.notes-preview-pane .markdown-h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.25rem;
  margin-top: 0.85rem;
  margin-bottom: 0.5rem;
}

.notes-preview-pane .markdown-h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

.notes-preview-pane .markdown-h4,
.notes-preview-pane .markdown-h5,
.notes-preview-pane .markdown-h6 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.notes-preview-pane .markdown-p {
  margin-bottom: 0.65rem;
}

.notes-preview-pane .markdown-spacer {
  height: 0.75rem;
}

.notes-preview-pane .markdown-del {
  color: var(--text-muted);
}

.notes-preview-pane .markdown-link {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notes-preview-pane .markdown-quote {
  border-left: 3px solid var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.5rem 0.85rem;
  margin: 0.65rem 0;
  color: #cbd5e1;
  font-style: italic;
}

.notes-preview-pane .markdown-hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 1.25rem 0;
}

.notes-preview-pane .markdown-list,
.notes-preview-pane .markdown-numbered-list {
  padding-left: 1.4rem;
  margin: 0.4rem 0 0.75rem 0;
}

.notes-preview-pane .markdown-list li,
.notes-preview-pane .markdown-numbered-list li {
  margin-bottom: 0.25rem;
}

.notes-preview-pane .markdown-task-list {
  list-style: none;
  padding-left: 0;
  margin: 0.4rem 0 0.75rem 0;
}

.notes-preview-pane .markdown-task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.notes-preview-pane .markdown-task-item input.task-checkbox {
  margin-top: 0.25rem;
  cursor: default;
  accent-color: var(--accent-primary);
}

.notes-preview-pane .markdown-task-item.task-done span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Tables */
.notes-preview-pane .markdown-table-wrapper {
  overflow-x: auto;
  margin: 0.85rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.notes-preview-pane .markdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.notes-preview-pane .markdown-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.notes-preview-pane .markdown-table td {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.notes-preview-pane .markdown-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Inline Code */
.notes-preview-pane .inline-code {
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
  padding: 0.12rem 0.38rem;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.85em;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Fenced Code Block */
.notes-preview-pane .code-block-wrapper {
  margin: 0.85rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #0d1117;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notes-preview-pane .code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem;
  background: #161b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notes-preview-pane .code-block-lang {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b949e;
}

.notes-preview-pane .code-copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #c9d1d9;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.notes-preview-pane .code-copy-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.notes-preview-pane .code-copy-btn.copied {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
}

.notes-preview-pane .code-block-wrapper pre {
  margin: 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e6edf3;
}

/* Syntax Highlighting Token Colors */
.hl-keyword { color: #ff7b72; font-weight: 600; }
.hl-string { color: #a5d6ff; }
.hl-number { color: #79c0ff; }
.hl-comment { color: #8b949e; font-style: italic; }
.hl-tag { color: #7ee787; font-weight: 600; }
.hl-attribute { color: #d2a8ff; }
.hl-binding { color: #ffa657; font-weight: 600; }
.hl-type { color: #ffa657; font-weight: 600; }

.markdown-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.markdown-empty-state .empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}
.markdown-empty-state p {
  font-size: 0.88rem;
  max-width: 380px;
}

/* Notes Footer */
.notes-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.notes-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.notes-word-count {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

@media (max-width: 900px) {
  .notes-dual-pane.mode-split {
    grid-template-columns: 1fr;
  }
  .notes-dual-pane.mode-split .notes-editor-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

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

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

.close-btn, .modal-close-btn { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; transition: color 0.15s ease; }
.close-btn:hover, .modal-close-btn:hover { color: var(--text-primary); }

.modal-body { padding: 1.5rem; }
.modal-meta { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.meta-badge {
  background: var(--bg-tertiary);
  color: var(--accent-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; min-width: 0; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.modal-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; }

/* Auth Modal & Tabs */
.auth-modal-card { max-width: 440px; }
.auth-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}
.auth-tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.auth-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}
.btn-block { width: 100%; margin-top: 1rem; padding: 0.75rem; font-size: 0.9rem; font-weight: 700; }
.auth-error-msg {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-danger);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Full Screen Login Landing Gate */
.login-screen-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
              radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent 40%),
              var(--bg-primary);
  padding: 1.5rem;
}
.login-card-wrapper {
  width: 100%;
  max-width: 440px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-brand {
  text-align: center;
  padding: 2rem 1.5rem 1.25rem 1.5rem;
}
.logo-icon-lg {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: pulse 2s infinite ease-in-out;
}
.login-brand h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-brand .tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.login-card-body {
  padding: 1.5rem;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  color: var(--accent-secondary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.user-avatar-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(129, 140, 248, 0.4);
}
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0 1rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.auth-divider span {
  padding: 0 0.75rem;
}
.google-auth-section {
  width: 100%;
}
.google-btn-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 44px;
}

/* Active Current Time Slot Highlight & Focus */
.slot-cell.current-active-slot {
  border: 2px solid #818cf8 !important;
  box-shadow: 0 0 18px rgba(129, 140, 248, 0.5), inset 0 0 12px rgba(129, 140, 248, 0.2) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25)) !important;
  position: relative;
  z-index: 2;
  animation: glowPulse 2.5s infinite ease-in-out;
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 14px rgba(129, 140, 248, 0.4); }
  50% { box-shadow: 0 0 24px rgba(168, 85, 247, 0.7); }
  100% { box-shadow: 0 0 14px rgba(129, 140, 248, 0.4); }
}

.now-pill {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  box-shadow: 0 2px 6px rgba(168, 85, 247, 0.4);
}

.current-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  gap: 0.25rem;
}

.now-hint-text {
  font-size: 0.7rem;
  color: #c084fc;
  font-weight: 700;
}

/* Schedule View Granularity Selector (Day / Week / Month) */
.view-mode-selector {
  display: flex;
  background: var(--bg-tertiary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 0.2rem;
}
.view-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.view-mode-btn.active {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
}

/* Day View Expanded Styling */
.day-view-single-col {
  width: calc(100% - 100px);
  text-align: center;
  font-size: 1rem;
}
.day-view-cell {
  height: 64px;
}
.day-view-content {
  padding: 0.6rem 0.8rem;
}
.lg-title {
  font-size: 0.95rem;
  font-weight: 700;
}
.status-name {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.2rem;
}
.slot-notes-preview {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  font-style: italic;
}

/* Month View Matrix Styling */
#monthViewContainer {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.month-grid-wrapper {
  padding: 1.5rem;
  background: var(--bg-glass);
}
.month-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.month-header-bar h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-primary);
}
.month-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.month-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.month-days-header .day-short {
  display: none;
}
.month-days-header .day-full {
  display: inline;
}
.month-days-matrix {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.6rem;
}
.month-day-cell {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 105px;
  padding: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.month-day-cell:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.month-day-cell.pad {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.month-day-cell.today-cell {
  border-color: #818cf8;
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.3);
  background: rgba(99, 102, 241, 0.1);
}
.month-day-num {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.today-tag {
  background: #a855f7;
  color: #fff;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
}
.month-day-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  justify-content: center;
}
.month-metric-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--accent-secondary);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
}
.month-metric-badge.actual {
  color: #34d399;
}
.month-empty-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

.month-metric-badge .badge-mini {
  display: none;
}
.month-metric-badge .badge-full {
  display: inline;
}

/* ==========================================================================
   USER SETTINGS & PREFERENCES VIEW STYLES
   ========================================================================== */

.settings-header-actions {
  display: flex;
  align-items: center;
}

.settings-container {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  margin-top: 1.25rem;
}

.settings-section-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.settings-section-icon {
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.settings-section-header-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.settings-section-header-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0 0;
}

.settings-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.settings-section-grid .settings-card {
  height: 100%;
  box-sizing: border-box;
}

.settings-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.settings-card-icon {
  font-size: 1.5rem;
  background: var(--bg-tertiary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
}

.settings-card-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.settings-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.window-presets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.window-preset-pill,
.notif-preset-pill {
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.window-preset-pill:hover,
.notif-preset-pill:hover {
  background: var(--bg-primary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.window-preset-pill.active,
.notif-preset-pill.active {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  font-weight: 700;
}

.range-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.range-val-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--bg-tertiary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.settings-slider {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
}

/* Theme Picker Grid */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.theme-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.theme-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.theme-card.active {
  border-color: var(--accent-primary);
  background: var(--accent-light);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.theme-preview-box {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.theme-preview-box .preview-header {
  height: 14px;
}

.theme-preview-box .preview-content {
  flex: 1;
}

.preview-dark .preview-header { background: #1e293b; }
.preview-dark .preview-content { background: #0f172a; }

.preview-oled .preview-header { background: #121212; }
.preview-oled .preview-content { background: #000000; }

.preview-emerald .preview-header { background: #064e3b; }
.preview-emerald .preview-content { background: #022c22; }

.preview-light .preview-header { background: #e2e8f0; }
.preview-light .preview-content { background: #f8fafc; }

.theme-card-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Accent Color Picker */
.accent-picker-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.accent-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.accent-pill:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.accent-pill.active {
  border-color: var(--accent-primary);
  background: var(--accent-light);
  color: var(--accent-primary);
  font-weight: 700;
}

.accent-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.field-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* THEMES */
body.theme-oled {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #141414;
  --bg-surface: #0a0a0a;
  --border-color: #222222;
}

body.theme-emerald {
  --bg-primary: #022c22;
  --bg-secondary: #064e3b;
  --bg-tertiary: #047857;
  --bg-surface: #064e3b;
  --border-color: #059669;
}

body.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --card-bg: #ffffff;
}

/* Compact Grid Mode */
.compact-grid .time-slot-cell {
  height: 28px !important;
  min-height: 28px !important;
  font-size: 0.72rem !important;
  padding: 0.1rem 0.35rem !important;
}

.compact-grid .time-col-cell {
  height: 28px !important;
  min-height: 28px !important;
  font-size: 0.68rem !important;
}

/* Grid Cell Selection & Shortcut Styles */
.slot-cell.selected-slot {
  outline: 2px solid var(--accent-primary, #6366f1) !important;
  outline-offset: -2px;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.45) !important;
  z-index: 5 !important;
  position: relative;
  background-color: rgba(99, 102, 241, 0.08) !important;
}

.slot-cell.copied-source {
  outline: 2px dashed #10b981 !important;
  outline-offset: -2px;
  animation: copySourcePulse 2s infinite ease-in-out;
  z-index: 4 !important;
  position: relative;
}

@keyframes copySourcePulse {
  0%, 100% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.6); }
}

.slot-cell.multi-selected-slot {
  outline: 2px solid var(--accent-primary, #6366f1) !important;
  outline-offset: -2px;
  background-color: rgba(99, 102, 241, 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3), 0 0 10px rgba(99, 102, 241, 0.35) !important;
  z-index: 5 !important;
  position: relative;
}

/* ==========================================================================
   FLOATING BULK ACTION BAR
   ========================================================================== */
.bulk-action-bar {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: rgba(18, 22, 34, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  padding: 0.45rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: bulkSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  max-width: 95vw;
}

@keyframes bulkSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.bulk-action-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.bulk-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.bulk-count-badge {
  background: var(--accent-primary, #6366f1);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bulk-duration {
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
  font-weight: 500;
}

.bulk-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.16);
}

.bulk-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bulk-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  color: #fff;
}

.bulk-btn:active {
  transform: translateY(0);
}

.bulk-btn-done:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.bulk-btn-progress:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.bulk-btn-pending:hover {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.bulk-btn-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.bulk-category-dropdown-wrapper {
  position: relative;
}

.bulk-category-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 22, 34, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  z-index: 1001;
}

.bulk-cat-item {
  background: transparent;
  border: none;
  color: #e2e8f0;
  padding: 0.4rem 0.75rem;
  text-align: left;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bulk-cat-item:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}

.bulk-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.bulk-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Light Theme support for Bulk Action Bar */
body.theme-light .bulk-action-bar {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(99, 102, 241, 0.3);
}

body.theme-light .bulk-info {
  color: #1e293b;
}

body.theme-light .bulk-divider {
  background: rgba(0, 0, 0, 0.12);
}

body.theme-light .bulk-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #334155;
  border-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .bulk-btn:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #0f172a;
}

body.theme-light .bulk-category-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.15);
}

body.theme-light .bulk-cat-item {
  color: #334155;
}

body.theme-light .bulk-cat-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #1e293b;
}

/* DayFlow Floating Toast Notification */
.dayflow-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.dayflow-toast {
  background: var(--bg-card, #1e2230);
  color: var(--text-primary, #f8fafc);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 10px rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlideIn 0.2s ease-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(8px);
}

.dayflow-toast.toast-success {
  border-left: 4px solid #10b981;
}

.dayflow-toast.toast-info {
  border-left: 4px solid var(--accent-primary, #6366f1);
}

.dayflow-toast.toast-warning {
  border-left: 4px solid #f59e0b;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Custom Grid Context Menu */
.grid-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 210px;
  background: var(--bg-card, #1e2230);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 10px rgba(99, 102, 241, 0.2);
  padding: 6px;
  backdrop-filter: blur(12px);
  animation: contextMenuPop 0.12s ease-out;
  user-select: none;
}

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

.context-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary, #f8fafc);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  gap: 12px;
}

.context-menu-item:hover:not(.disabled) {
  background: var(--accent-primary, #6366f1);
  color: #ffffff;
}

.context-menu-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.context-menu-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-menu-shortcut {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  font-family: monospace;
  font-weight: 600;
}

.context-menu-item:hover:not(.disabled) .context-menu-shortcut {
  color: rgba(255, 255, 255, 0.85);
}

.context-menu-divider {
  height: 1px;
  background: var(--border-color, rgba(255, 255, 255, 0.1));
  margin: 4px 6px;
}

/* Header Notification Bell */
#notificationBellBtn {
  position: relative;
  padding: 0.45rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#notificationBellBtn.bell-active::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
  animation: bellDotPulse 2s infinite ease-in-out;
}

@keyframes bellDotPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

#notificationBellBtn.bell-disabled {
  opacity: 0.5;
}

/* iOS-style Toggle Switches */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
}

.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.switch-toggle input:checked + .slider {
  background-color: var(--accent-primary, #6366f1);
  border-color: var(--accent-primary, #6366f1);
}

.switch-toggle input:checked + .slider:before {
  transform: translateX(20px);
}

/* Status Pills */
.status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.status-pill-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-pill-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Volume Slider Range */
.slider-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  outline: none;
  transition: background 0.2s;
  cursor: pointer;
  margin: 8px 0;
}

.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-primary, #6366f1);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease;
}

.slider-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-primary, #6366f1);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  border: 2px solid #ffffff;
}

/* ==========================================================================
   DAYFLOW V2 — COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

/* Mobile Bottom Navigation Bar (Hidden by default on desktop/tablet) */
.mobile-bottom-nav {
  display: none;
}

/* Day View Fluid Width & Sticky Schedule Matrix Styles */
.schedule-table.day-view-mode {
  min-width: 100% !important;
  table-layout: auto !important;
}

.schedule-table.day-view-mode th.day-col {
  width: auto;
}

.schedule-table th.time-col {
  position: sticky;
  left: 0;
  z-index: 15;
  background: var(--bg-tertiary);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
}

.schedule-table td.time-cell {
  position: sticky;
  left: 0;
  z-index: 8;
  background: var(--bg-secondary);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
}

.schedule-table th {
  position: sticky;
  top: 0;
  z-index: 10;
}

.schedule-table th.time-col {
  z-index: 20; /* intersection of top & left sticky */
}

/* Quick Day Jump & Horizontal Scroll Bar (Shown on Mobile/Tablet in Week View) */
.grid-horizontal-scroll-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}

@media (max-width: 1023px) {
  .grid-horizontal-scroll-nav {
    display: flex;
  }
}

.grid-day-pills-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
}

.grid-day-pills-bar::-webkit-scrollbar {
  display: none;
}

.grid-day-pill {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.26rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex: 1;
  text-align: center;
}

.grid-day-pill:hover {
  background: var(--bg-tertiary);
  color: #fff;
  border-color: var(--accent-primary);
}

.grid-day-pill.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary);
  color: #a5b4fc;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.3);
}

.grid-scroll-arrow-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.grid-scroll-arrow-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.grid-wrapper {
  position: relative;
}

.grid-scroll-fade-right {
  position: absolute;
  top: 42px;
  right: 0;
  bottom: 10px;
  width: 24px;
  background: linear-gradient(to right, transparent, rgba(15, 23, 42, 0.85));
  pointer-events: none;
  z-index: 12;
  transition: opacity 0.2s ease;
}

@media (min-width: 1024px) {
  .grid-scroll-fade-right {
    display: none !important;
  }
}

/* Dynamic Single-Source-of-Truth Compaction Classes */
.app-header.actions-compact .header-actions .btn-label {
  display: none !important;
}
.app-header.actions-compact .user-badge #userDisplayName {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-header.actions-compact .header-actions .btn {
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}

.app-header.nav-compact .view-nav .nav-btn .nav-btn-text {
  display: none !important;
}
.app-header.nav-compact .view-nav .nav-btn {
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  gap: 0;
}

.app-header.brand-compact .brand-text .badge {
  display: none !important;
}

/* ==========================================================================
   BREAKPOINT 0A: COMPACT ACTIONS ON DESKTOPS & LAPTOPS (<= 1510px)
   Eliminates header overflow between 1351px and 1505px (Finding 36 Band 2)
   ========================================================================== */
@media (max-width: 1510px) {
  .app-header {
    padding: 0.75rem 1.25rem;
    gap: 0.5rem;
  }

  .header-actions {
    gap: 0.35rem;
  }

  /* Compact icon-only mode for Export, Import, Logout */
  .header-actions .btn-label {
    display: none;
  }

  .header-actions .btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
  }

  .user-badge {
    padding: 0.35rem 0.65rem;
    max-width: 140px;
  }

  .user-badge #userDisplayName {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ==========================================================================
   BREAKPOINT 0B: COMPACT NAV ON COMPACT DESKTOPS (<= 1315px)
   Eliminates header overflow between 1141px and 1311px (Finding 36 Band 1)
   ========================================================================== */
@media (max-width: 1315px) {
  .app-header {
    padding: 0.65rem 1rem;
  }

  .view-nav {
    gap: 0.25rem;
    padding: 0.2rem;
  }

  .view-nav .nav-btn .nav-btn-text {
    display: none;
  }

  .view-nav .nav-btn {
    padding: 0.45rem 0.6rem;
    font-size: 0.95rem;
    gap: 0;
  }
}

/* Intermediate tablet boundary compaction (<= 800px) */
@media (max-width: 800px) {
  .app-header {
    padding: 0.5rem 0.65rem;
    gap: 0.35rem;
  }

  .brand-text .badge {
    display: none;
  }

  .brand {
    gap: 0.35rem;
  }

  .header-actions {
    gap: 0.25rem;
  }

  .header-actions .btn {
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
  }

  .view-nav .nav-btn {
    padding: 0.35rem 0.45rem;
  }
}

/* ==========================================================================
   BREAKPOINT 1: TABLET & COMPACT DESKTOPS (<= 1023px)
   ========================================================================== */
@media (max-width: 1023px) {
  .app-header {
    padding: 0.65rem 1rem;
    gap: 0.5rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .brand-text h1 {
    font-size: 1.2rem;
  }

  .view-nav {
    gap: 0.25rem;
    padding: 0.2rem;
  }

  .nav-btn .nav-btn-text {
    display: none;
  }

  .nav-btn {
    padding: 0.45rem 0.55rem;
    font-size: 0.95rem;
    gap: 0;
  }

  .header-actions {
    gap: 0.4rem;
  }

  .header-actions .btn-label {
    display: none;
  }

  .header-actions .btn {
    padding: 0.45rem 0.6rem;
    font-size: 0.82rem;
  }

  .user-badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    max-width: 140px;
  }

  .user-badge #userDisplayName {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .controls-bar {
    padding: 0.75rem 1.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .main-content {
    padding: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .notes-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }

  .analytics-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }

  .settings-grid-layout,
  .settings-section-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   BREAKPOINT 2: MOBILE PHONES & SMALL SCREENS (<= 767px)
   ========================================================================== */
@media (max-width: 767px) {
  /* Hide Desktop Top Navigation (Delegated to Mobile Bottom Bar) */
  .app-header .view-nav {
    display: none !important;
  }

  .app-header {
    padding: 0.6rem 0.85rem;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .brand {
    gap: 0.5rem;
  }

  .logo-icon {
    font-size: 1.4rem;
  }

  .brand-text h1 {
    font-size: 1.1rem;
  }

  .brand-text .badge {
    display: none;
  }

  .user-badge {
    padding: 0.35rem 0.5rem;
  }

  .user-badge #userDisplayName {
    display: none;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .header-actions .btn {
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
  }

  /* Main Content Area - Safe Area & Bottom Nav Clearance */
  .main-content {
    padding: 0.65rem 0.65rem;
    padding-bottom: calc(68px + var(--safe-area-bottom));
  }

  /* Prevent outer double-scrollbar in grid view on mobile */
  .app-container:has(#view-grid.active) {
    height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
  }

  /* Pinned Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: #cbd5e1; /* High contrast against dark background (> 6:1 WCAG AA) */
    padding: 6px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 72px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-btn:hover {
    color: #ffffff;
  }

  .mobile-nav-btn.active {
    color: #a5b4fc; /* High contrast active indigo/purple (> 7.5:1 WCAG AA) */
  }

  .mobile-nav-btn.active .mobile-nav-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.7));
  }

  .mobile-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.2s ease;
  }

  .mobile-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  /* Controls Bar Stacked Multi-Row Layout */
  .controls-bar {
    padding: 0.65rem 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .view-mode-selector {
    display: flex;
    width: 100%;
  }

  .view-mode-btn {
    flex: 1;
    text-align: center;
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
  }

  .week-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.35rem;
  }

  .calendar-picker-wrapper {
    padding: 0.25rem 0.45rem;
  }

  .date-picker-input {
    font-size: 0.78rem;
  }

  .week-range-text {
    font-size: 0.8rem;
    text-align: center;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

  .filter-group label {
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .filter-group .select-input {
    flex: 1;
    font-size: 0.8rem;
  }

  /* Schedule Grid & Timeline Table */
  .timeline-table-container {
    height: calc(100dvh - 305px - var(--safe-area-bottom));
    max-height: calc(100dvh - 305px - var(--safe-area-bottom));
    min-height: 250px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(15, 23, 42, 0.8);
  }

  /* Always-visible prominent horizontal scrollbar on mobile */
  .timeline-table-container::-webkit-scrollbar {
    width: 6px;
    height: 9px;
  }

  .timeline-table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid var(--border-color);
  }

  .timeline-table-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
  }

  .timeline-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary-hover);
  }

  .schedule-table {
    min-width: 680px;
  }

  .schedule-table.day-view-mode {
    min-width: 100% !important;
  }

  .schedule-table th, .schedule-table td {
    padding: 0.35rem 0.4rem;
    font-size: 0.75rem;
  }

  .schedule-table th.time-col {
    width: 75px;
    min-width: 70px;
    font-size: 0.72rem;
  }

  .time-cell {
    font-size: 0.72rem;
  }

  .slot-cell {
    height: 52px;
  }

  .slot-title {
    font-size: 0.75rem;
  }

  .planned-subtext {
    font-size: 0.62rem;
  }

  .category-tag {
    max-width: 65px;
    font-size: 0.58rem;
    padding: 0.05rem 0.3rem;
  }

  .time-dur-badge {
    font-size: 0.65rem;
  }

  /* Mobile Month View Matrix Adaptation */
  #monthViewContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .month-grid-wrapper {
    padding: 0.65rem 0.35rem;
  }

  .month-header-bar {
    margin-bottom: 0.65rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .month-header-bar h3 {
    font-size: 1.1rem;
  }

  .month-subtitle {
    font-size: 0.72rem;
  }

  .month-days-header {
    gap: 3px;
    font-size: 0.68rem;
    margin-bottom: 0.35rem;
  }

  .month-days-matrix {
    gap: 3px;
  }

  .month-day-cell {
    min-height: 54px;
    padding: 0.25rem 0.15rem;
    border-radius: var(--radius-sm);
  }

  .month-day-num {
    font-size: 0.75rem;
    margin-bottom: 2px;
  }

  .today-tag {
    font-size: 0.5rem;
    padding: 0.05rem 0.2rem;
  }

  .month-day-body {
    gap: 2px;
  }

  .month-metric-badge {
    font-size: 0.6rem;
    padding: 1px 2px;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .month-metric-badge .badge-full {
    display: none;
  }

  .month-metric-badge .badge-mini {
    display: inline;
  }

  .month-empty-text {
    display: none;
  }

  /* Habit Ledger */
  .habits-container {
    gap: 1rem;
  }

  .panel-header h2 {
    font-size: 1.25rem;
  }

  .panel-header p {
    font-size: 0.82rem;
  }

  .habit-date-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
  }

  .date-bar-left, .date-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  .date-bar-label {
    font-size: 0.78rem;
  }

  .date-pill {
    padding: 0.28rem 0.6rem;
    font-size: 0.75rem;
  }

  .custom-date-label {
    font-size: 0.75rem;
  }

  .habit-date-picker {
    font-size: 0.78rem;
    padding: 0.28rem 0.5rem;
  }

  .habit-quick-actions {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .habit-btn {
    padding: 0.8rem 1rem;
    font-size: 0.82rem;
  }

  .habit-form-card .form-row {
    flex-direction: column;
    gap: 0.6rem;
  }

  .habit-form-card .form-row input,
  .habit-form-card .form-row button {
    width: 100% !important;
  }

  .habit-history-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
  }

  .habit-history-card .data-table {
    min-width: 480px;
  }

  /* Focus & Habit Analytics */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.85rem;
    gap: 0.65rem;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.4rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .analytics-card {
    padding: 1rem;
  }

  .analytics-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .habit-daily-trend-matrix {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.6rem;
    gap: 0.5rem;
  }

  .daily-trend-day {
    min-width: 65px;
    flex: 1;
    padding: 0.5rem 0.35rem;
  }

  .trend-bar-wrapper {
    height: 50px;
  }

  /* Notes & Todo */
  .todo-card, .notes-card {
    padding: 1rem;
  }

  .todo-progress-container {
    padding: 0.65rem 0.85rem;
  }

  .todo-progress-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .todo-add-form .todo-form-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .todo-add-form .todo-form-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .todo-add-form .todo-select {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 120px;
    width: auto !important;
  }

  .todo-add-form .todo-due-picker-wrap {
    flex: 1 1 100%;
    width: 100% !important;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .todo-due-picker-wrap .form-date-input {
    flex: 1;
    min-width: 120px;
  }

  .todo-due-quick-pills {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
  }

  .todo-add-form .todo-add-btn {
    flex: 1 1 100%;
    width: 100% !important;
  }

  .todo-filter-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
    overflow-x: visible !important;
    gap: 0.35rem !important;
    padding-bottom: 0.25rem !important;
  }

  .todo-filter-pill {
    padding: 0.3rem 0.55rem;
    font-size: 0.76rem;
  }

  .todo-day-scope-wrap {
    display: flex;
    gap: 0.35rem;
    width: 100%;
    margin-top: 0.2rem;
  }

  .notes-card, .todo-card {
    padding: 0.85rem 0.65rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .notes-header-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
  }

  .notes-title-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
  }

  .notes-title-group h2 {
    font-size: 1.15rem;
    word-break: break-word;
  }

  .notes-header-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
  }

  .notes-view-switcher {
    display: inline-flex;
    max-width: 100%;
    flex-shrink: 0;
  }

  .notes-mode-btn {
    padding: 0.28rem 0.5rem;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .notes-sheets-header {
    padding: 0.3rem 0.4rem;
    gap: 0.25rem;
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .notes-sheets-tab-bar {
    flex: 1 1 0% !important;
    min-width: 0 !important;
  }

  .sheets-scroll-btn {
    width: 24px;
    height: 24px;
    font-size: 1rem;
    flex-shrink: 0 !important;
  }

  .add-sheet-btn {
    padding: 0.28rem 0.45rem;
    font-size: 0.72rem;
    flex-shrink: 0 !important;
  }

  .add-sheet-text {
    font-size: 0.72rem;
  }

  .notes-markdown-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
    overflow-x: visible !important;
    gap: 0.3rem 0.25rem !important;
    padding: 0.35rem 0.45rem !important;
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .notes-markdown-toolbar .toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
  }

  .notes-markdown-toolbar .toolbar-divider {
    width: 1px;
    height: 16px;
    margin: 0 0.15rem;
    background: var(--border-color);
  }

  .notes-markdown-toolbar .toolbar-btn {
    padding: 0.25rem 0.45rem;
    font-size: 0.74rem;
    min-height: 28px;
    line-height: 1;
  }

  .notes-markdown-toolbar .toolbar-snippet-select {
    height: 28px;
    font-size: 0.72rem;
    max-width: 125px;
    padding: 0.15rem 0.35rem;
  }

  .notes-dual-pane.mode-split {
    grid-template-columns: 1fr !important;
  }

  .notes-dual-pane.mode-split .notes-editor-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .notes-pane {
    min-height: 250px;
    max-height: 400px;
  }

  .notes-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  /* Settings View */
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .settings-header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .settings-header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .settings-card {
    padding: 1.25rem 1rem;
  }

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

  .window-presets-container {
    grid-template-columns: 1fr;
  }

  /* Modals: Responsive Bottom Sheet Pattern */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
  }

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

  .modal-header {
    padding: 1rem 1.25rem;
    flex-shrink: 0;
  }

  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(88vh - 120px);
    padding: 1rem 1.25rem 1.5rem;
  }

  .modal-footer {
    padding: 0.75rem 1.25rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    flex: 1;
    justify-content: center;
  }

  .points-bifurcation-summary {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   BREAKPOINT 3: EXTRA SMALL MOBILE SCREENS (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .app-header {
    padding: 0.45rem 0.5rem;
    gap: 0.3rem;
  }

  .brand {
    gap: 0.35rem;
  }

  .logo-icon {
    font-size: 1.25rem;
  }

  .brand-text h1 {
    font-size: 0.98rem;
  }

  .header-actions {
    gap: 0.22rem;
  }

  .header-actions .btn {
    padding: 0.32rem 0.4rem;
    font-size: 0.78rem;
    min-width: 28px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .user-badge {
    padding: 0.28rem 0.38rem;
    font-size: 0.78rem;
    min-width: 26px;
    height: 30px;
  }

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

  .stat-card {
    padding: 0.65rem 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 1.15rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  /* Auth Screens on Small Mobile */
  .login-screen-container {
    padding: 0.75rem;
  }

  .login-card-wrapper {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .login-brand h2 {
    font-size: 1.4rem;
  }

  .login-brand .tagline {
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   BREAKPOINT 4: ULTRA-NARROW SCREENS (<= 360px / 320px)
   Eliminates rightmost button clipping at 320px (Finding 33)
   ========================================================================== */
@media (max-width: 360px) {
  .app-header {
    padding: 0.35rem 0.35rem;
    gap: 0.2rem;
  }

  .brand {
    gap: 0.2rem;
  }

  .logo-icon {
    font-size: 1.15rem;
  }

  .brand-text h1 {
    font-size: 0.9rem;
    letter-spacing: -0.03em;
  }

  .header-actions {
    gap: 0.16rem;
  }

  .header-actions .btn {
    padding: 0.25rem 0.3rem;
    font-size: 0.72rem;
    min-width: 24px;
    height: 26px;
  }

  .user-badge {
    padding: 0.2rem 0.25rem;
    font-size: 0.72rem;
    min-width: 24px;
    height: 26px;
  }

  /* Ultra-narrow Month View */
  .month-grid-wrapper {
    padding: 0.35rem 0.15rem;
  }

  .month-days-header .day-full {
    display: none;
  }

  .month-days-header .day-short {
    display: inline;
  }

  .month-days-header {
    gap: 2px;
    font-size: 0.62rem;
  }

  .month-days-matrix {
    gap: 2px;
  }

  .month-day-cell {
    min-height: 46px;
    padding: 0.15rem 0.05rem;
  }

  .month-day-num {
    font-size: 0.68rem;
  }

  .month-metric-badge {
    font-size: 0.52rem;
    padding: 1px 0;
  }
}

/* ==========================================================================
   DAY TEMPLATES STYLING
   ========================================================================== */

.day-templates-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.day-template-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.day-template-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.day-template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.day-template-card-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.day-template-count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.day-template-card-desc {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.day-template-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.day-template-card-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  color: var(--text-primary);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-chip-more {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
}

.day-templates-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1.5px dashed var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.01);
}

.template-slot-edit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .template-slot-edit-row {
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
  }
}

/* Header buttons in Week View */
.day-col-header-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.day-template-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.65;
  transition: all 0.15s ease;
  margin-left: 0.35rem;
  line-height: 1;
}

.day-template-action-btn:hover {
  opacity: 1;
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  transform: scale(1.1);
}

/* Day View template trigger bar */
.day-view-template-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Preview rows in Apply Template Modal */
.apply-preview-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.apply-preview-slot-row.will-apply {
  border-left: 3px solid #10b981;
}

.apply-preview-slot-row.will-skip {
  border-left: 3px solid #f59e0b;
  opacity: 0.8;
}

.apply-tag-apply {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.apply-tag-skip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* ==========================================================================
   WORK EFFECTIVENESS & PRODUCTIVE WORK CLASSIFICATION
   ========================================================================== */

.stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

#taskProductiveGroup {
  margin-top: -0.25rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.productive-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.custom-toggle-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #f59e0b;
  cursor: pointer;
}

.productive-toggle-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.task-field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 1.85rem;
}

/* Productive Category Pills in Settings */
.productive-categories-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.prod-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.prod-cat-pill:hover {
  background: var(--bg-hover, var(--bg-secondary));
  border-color: var(--text-muted);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.prod-cat-pill.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.12);
}

.prod-cat-icon {
  font-size: 1.05rem;
}

.prod-cat-name {
  font-size: 0.85rem;
}

.prod-cat-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.2s ease;
}

.prod-cat-pill.active .prod-cat-badge {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
}

.prod-cat-badge-pill {
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 600;
  margin-left: 0.4rem;
  vertical-align: middle;
  display: inline-block;
}

/* Slot Card Productive Indicator */
.slot-prod-icon {
  font-size: 0.72rem;
  color: #f59e0b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.5));
  margin-left: 2px;
  cursor: help;
}

/* Bulk Action Bar Productive Toggle */
.bulk-btn-productive {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.bulk-btn-productive:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fef3c7;
}

/* ========================================================
   CUSTOM TASK CATEGORIES & CATEGORY MANAGER STYLES
   ======================================================== */
.categories-management-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.category-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.95rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.category-manage-row:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-manage-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.category-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.category-manage-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.category-manage-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-manage-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.category-badge-system {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(100, 116, 139, 0.18);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.category-badge-archived {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.category-badge-prod-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid transparent;
}

.category-badge-prod-btn.is-prod {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}

.category-badge-prod-btn.is-prod:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.6);
}

.category-badge-prod-btn.is-standard {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-color: var(--border-color);
}

.category-badge-prod-btn.is-standard:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.category-manage-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.75rem;
  flex-shrink: 0;
}

.category-action-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.category-action-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.category-action-btn.btn-del-cat:hover:not(:disabled) {
  border-color: #ef4444;
  color: #ef4444;
}

.category-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.category-emoji-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-emoji-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.15);
  border-color: var(--accent-primary);
}

.category-emoji-btn.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.category-color-swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-color-swatch-btn:hover {
  transform: scale(1.18);
}

.category-color-swatch-btn.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--accent-primary);
  transform: scale(1.1);
}



