/* ===================================================================
   MODULES SPECIFIC STYLES
   Main Todo, Not-Do List, Daily Ledger, Calendar, Pomodoro & Board
   =================================================================== */

/* -------------------------------------------------------------------
   MODULE 1: MAIN TODO LIST
   ------------------------------------------------------------------- */
.todo-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-paper);
}

.quick-add-form {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.quick-add-input {
  flex: 1;
  min-width: 260px;
}

.quick-add-options-row {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

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

.search-box {
  position: relative;
  min-width: 200px;
}

.search-box input {
  padding: 6px 12px 6px 30px;
  font-size: 0.85rem;
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* Todo List Rows */
.todo-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.todo-item-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-paper);
  transform: translateY(-1px);
}

.todo-item-card.completed {
  opacity: 0.72;
  background: var(--bg-paper-alt);
}

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

.todo-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.todo-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.todo-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
  transition: all var(--transition-fast);
}

.todo-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.todo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}

.todo-item-card:hover .todo-actions {
  opacity: 1;
}

/* Subtasks inside Todo */
.subtasks-container {
  margin-top: 8px;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

/* -------------------------------------------------------------------
   MODULE 2: NOT-DO LIST ("The Anti-Todo & Bad Habit Breaker")
   ------------------------------------------------------------------- */
.notdo-banner {
  background: linear-gradient(135deg, rgba(194, 51, 51, 0.08), rgba(200, 90, 50, 0.05));
  border: 1px solid var(--accent-crimson);
  border-left: 6px solid var(--accent-crimson);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.notdo-banner-text h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--accent-crimson);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notdo-banner-text p {
  font-size: 0.88rem;
  color: var(--text-body);
  margin-top: 4px;
}

.notdo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
}

.notdo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  position: relative;
  box-shadow: var(--shadow-paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.notdo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
  border-color: var(--accent-crimson);
}

.notdo-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: var(--space-xs);
}

.notdo-bad-habit {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-crimson);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notdo-consequence {
  font-size: 0.88rem;
  color: var(--text-body);
  background: var(--bg-paper-alt);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin: var(--space-xs) 0;
  border-left: 3px solid var(--accent-crimson);
  font-style: italic;
}

.notdo-alternative {
  font-size: 0.88rem;
  color: var(--accent-sage);
  background: var(--accent-sage-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  border-left: 3px solid var(--accent-sage);
  font-weight: 500;
}

.notdo-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xs);
  border-top: 1px dashed var(--border-subtle);
  margin-top: var(--space-xs);
}

.notdo-streak-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.notdo-actions {
  display: flex;
  gap: 6px;
}

/* -------------------------------------------------------------------
   MODULE 3: DAILY LEDGER ("Today's Planner")
   ------------------------------------------------------------------- */
.daily-planner-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-lg);
}

@media (max-width: 992px) {
  .daily-planner-grid {
    grid-template-columns: 1fr;
  }
}

.daily-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-paper);
  margin-bottom: var(--space-md);
}

.daily-section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-strong);
}

/* Mood Stamps Bar */
.mood-picker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.mood-stamp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-body);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mood-stamp-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.mood-stamp-btn.active {
  background: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(224, 130, 68, 0.25);
  font-weight: 700;
}

[data-theme="dark"] .mood-stamp-btn {
  background: #20242D;
  border-color: rgba(255, 255, 255, 0.08);
  color: #C9C5BA;
}

[data-theme="dark"] .mood-stamp-btn:hover {
  background: #282D38;
  border-color: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

[data-theme="dark"] .mood-stamp-btn.active {
  background: rgba(224, 130, 68, 0.18);
  border-color: var(--accent-primary);
  color: #F29354;
}

/* Rule of 3 Cards */
.rule-of-three-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px;
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

.rule-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Hourly Time Block Timeline */
.timeblock-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.timeblock-slot {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  position: relative;
  transition: all var(--transition-fast);
}

.timeblock-slot:hover {
  border-color: var(--accent-primary);
}

.timeblock-slot.current-hour {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
}

.timeblock-hour {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 60px;
  flex-shrink: 0;
}

.timeblock-slot.current-hour .timeblock-hour {
  color: var(--accent-primary);
}

.timeblock-task-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
}

/* -------------------------------------------------------------------
   MODULE 4: CALENDAR & DAY EVENTS
   ------------------------------------------------------------------- */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-lg);
}

@media (max-width: 992px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
}

.calendar-main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-paper);
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.calendar-month-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.calendar-weekday {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day-cell {
  min-height: 72px;
  padding: 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: var(--bg-paper-alt);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-day-cell:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.calendar-day-cell.other-month {
  opacity: 0.35;
}

.calendar-day-cell.today {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
  font-weight: 700;
}

.calendar-day-cell.selected {
  outline: 2px solid var(--accent-secondary);
}

.cal-day-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-body);
}

.cal-event-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-secondary);
}

.cal-dot.event-dot { background: var(--accent-sage); }
.cal-dot.task-dot { background: var(--accent-primary); }

/* Day Events Panel */
.day-events-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-paper);
  display: flex;
  flex-direction: column;
}

.agenda-event-card {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
  border-left: 4px solid var(--accent-sage);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* -------------------------------------------------------------------
   MODULE 5: POMODORO TIMER STATION
   ------------------------------------------------------------------- */
.pomodoro-wrapper {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}

.pomodoro-modes-group {
  display: flex;
  gap: 8px;
  background: var(--pill-bg);
  padding: 4px;
  border-radius: var(--radius-full);
}

.pomo-mode-btn {
  background: transparent;
  border: none;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pomo-mode-btn.active {
  background: var(--pill-active-bg);
  color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Dial Circle */
.pomodoro-dial-container {
  position: relative;
  width: 290px;
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.pomodoro-circle-bg {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 8;
}

.pomodoro-circle-progress {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.pomodoro-dial-inner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pomodoro-time-display {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-main);
  line-height: 1;
}

.pomodoro-status-text {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--accent-primary);
  margin-top: 6px;
}

/* Controls */
.pomodoro-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.btn-pomo-main {
  padding: 12px 36px;
  font-size: 1.15rem;
  border-radius: var(--radius-full);
}

/* Active Task Link */
.pomo-active-task-banner {
  width: 100%;
  background: var(--bg-card);
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

/* Pomodoro Session Stamp Card */
.pomo-stamps-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-paper);
}

.tomato-stamps-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 1.6rem;
  margin-top: 8px;
}

/* Ambient Noise Sound generator */
.ambient-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.ambient-options {
  display: flex;
  gap: 8px;
}

.ambient-btn {
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-body);
  transition: all var(--transition-fast);
}

.ambient-btn.active {
  background: var(--accent-secondary);
  color: #fff;
  border-color: var(--accent-secondary);
}

/* -------------------------------------------------------------------
   MODULE 6: STICKY BOARD & SCRATCHPAD
   ------------------------------------------------------------------- */
.stickies-board {
  min-height: 480px;
  background-color: var(--bg-paper-alt);
  background-image: 
    radial-gradient(var(--grid-line) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: flex-start;
  position: relative;
}

/* -------------------------------------------------------------------
   ELEVATED ACTION BUTTONS & TOKENS
   ------------------------------------------------------------------- */
.todo-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.todo-action-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

[data-theme="dark"] .todo-action-btn {
  background: #22262F;
  border-color: rgba(255, 255, 255, 0.09);
  color: #C9C5BA;
}

[data-theme="dark"] .todo-action-btn:hover {
  background: #2A303C;
  border-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.todo-action-btn.btn-action-focus:hover {
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.todo-action-btn.btn-action-today:hover {
  background: var(--accent-mustard-light);
  color: var(--accent-mustard);
  border-color: var(--accent-mustard);
}

.todo-action-btn.btn-action-delete:hover {
  background: var(--accent-crimson-light);
  color: var(--accent-crimson);
  border-color: var(--accent-crimson);
}

.focus-token-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  animation: stampImprint 0.3s forwards;
}

[data-theme="dark"] .focus-token-badge {
  background: rgba(224, 130, 68, 0.16);
  color: #F29354;
  border-color: rgba(224, 130, 68, 0.4);
  box-shadow: 0 0 10px rgba(224, 130, 68, 0.25);
}

/* Enhanced Dark Mode Task Cards */
[data-theme="dark"] .todo-item-card {
  background: #1B1E24;
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .todo-item-card:hover {
  background: #21252E;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .todo-item-card.completed {
  background: rgba(23, 26, 32, 0.55);
  border-color: rgba(255, 255, 255, 0.04);
  opacity: 0.55;
}

[data-theme="dark"] .todo-item-card.completed .todo-title {
  color: #726E65;
}

[data-theme="dark"] .todo-toolbar {
  background: #171A1F;
  border-color: rgba(255, 255, 255, 0.08);
}

/* ===================================================================
   FOUNTAIN PEN INK STUDIO (Header bar)
   =================================================================== */
.ink-studio-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pill-bg);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.ink-studio-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
}

.ink-bottle-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
  position: relative;
}

.ink-bottle-btn:hover {
  transform: scale(1.2);
}

.ink-bottle-btn.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--bg-paper), 0 0 0 3.5px var(--accent-primary);
}

.ink-terracotta { background: #C85A32; }
.ink-indigo { background: #2563EB; }
.ink-merlot { background: #991B1B; }
.ink-sage { background: #166534; }
.ink-charcoal { background: #475569; }

/* ===================================================================
   365-DAY "YEAR IN INK" MATRIX
   =================================================================== */
.bujo-matrix-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-paper);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.bujo-matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--space-md);
}

.bujo-matrix-title-group h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.bujo-matrix-title-group p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.bujo-matrix-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bujo-stat-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--text-main);
}

.year-matrix-scroll-wrapper {
  overflow-x: auto;
  padding: 8px 2px 14px 2px;
}

/* Divided Ribbon Layout */
.year-matrix-ribbon-layout {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 100%;
}

.matrix-days-col {
  display: flex;
  flex-direction: column;
  padding-top: 24px; /* offset for month label */
  gap: 3.5px;
  user-select: none;
  flex-shrink: 0;
}

.matrix-day-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  height: 11px;
  line-height: 11px;
  width: 26px;
  text-align: right;
  padding-right: 4px;
}

.matrix-months-container {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
}

.matrix-month-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.matrix-month-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-align: center;
  user-select: none;
}

.matrix-month-block.is-current-month .matrix-month-name {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.matrix-month-columns {
  display: flex;
  gap: 3.5px;
}

.matrix-month-separator {
  width: 1px;
  border-right: 1.5px dashed var(--border-strong);
  margin: 22px 6px 0 6px;
  align-self: stretch;
  opacity: 0.65;
  flex-shrink: 0;
}

/* 12-Month Calendar Grid Layout */
.year-matrix-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
  width: 100%;
  padding: 4px 0;
}

.matrix-month-card {
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.matrix-month-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.matrix-month-card.is-current-month {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.matrix-month-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 4px;
}

.matrix-month-card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.matrix-month-card-stat {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.matrix-month-card-body {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* Quarterly View Layout */
.year-matrix-quarter-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.matrix-quarter-block {
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.matrix-quarter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 6px;
}

.matrix-quarter-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.matrix-quarter-stat {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.matrix-quarter-months {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* Segmented View Toggle Buttons */
.matrix-view-toggle {
  display: inline-flex;
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.matrix-view-btn {
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.matrix-view-btn:hover {
  color: var(--text-main);
}

.matrix-view-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.year-matrix-grid {
  display: inline-flex;
  gap: 3.5px;
  min-width: 100%;
}

.matrix-week-col {
  display: flex;
  flex-direction: column;
  gap: 3.5px;
}

.matrix-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
  position: relative;
}

.matrix-cell:hover {
  transform: scale(1.35);
  z-index: 10;
  border-color: var(--text-main);
}

.matrix-cell.level-0 {
  background: var(--bg-paper-alt);
  border-color: var(--border-subtle);
}

.matrix-cell.level-1 {
  background: var(--accent-primary-light);
  border-color: rgba(200, 90, 50, 0.25);
  opacity: 0.85;
}

.matrix-cell.level-2 {
  background: var(--accent-primary);
  opacity: 0.55;
  border-color: transparent;
}

.matrix-cell.level-3 {
  background: var(--accent-primary);
  opacity: 0.82;
  border-color: transparent;
}

.matrix-cell.level-4 {
  background: var(--accent-primary);
  opacity: 1;
  border-color: transparent;
  box-shadow: 0 0 6px rgba(200, 90, 50, 0.4);
}

.matrix-cell.cell-today {
  outline: 2px solid var(--accent-mustard);
  outline-offset: 1px;
}

.matrix-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===================================================================
   MONTHLY HABIT TRACKER GRID
   =================================================================== */
.bujo-habits-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-paper);
  margin-bottom: var(--space-lg);
}

.habit-table-wrapper {
  overflow-x: auto;
  margin-top: var(--space-sm);
  padding-bottom: 8px;
}

.habit-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.habit-table th {
  padding: 6px 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.habit-table th.habit-col-name {
  text-align: left;
  min-width: 190px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
}

.habit-table th.habit-col-streak {
  min-width: 60px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
}

.habit-table th.habit-col-day.day-today {
  color: var(--accent-primary);
  font-weight: 700;
}

.habit-table td {
  padding: 7px 3px;
  border-bottom: 1px dashed var(--border-subtle);
  vertical-align: middle;
}

.habit-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-main);
  padding-right: 12px !important;
}

.habit-category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.habit-category-dot.cat-health { background: #10B981; }
.habit-category-dot.cat-work { background: #3B82F6; }
.habit-category-dot.cat-study { background: #F59E0B; }
.habit-category-dot.cat-personal { background: #8B5CF6; }

.habit-score-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-paper-alt);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--accent-primary);
}

.habit-cell {
  text-align: center;
}

.habit-cell.cell-today {
  background: rgba(200, 90, 50, 0.04);
}

.habit-dot-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition-fast);
}

.habit-dot-btn:hover {
  border-color: var(--accent-primary);
  transform: scale(1.15);
}

.habit-dot-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.habit-dot-btn.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 6px rgba(200, 90, 50, 0.35);
}

.habit-dot-btn.checked .habit-dot-inner {
  background: #FFFFFF;
  width: 5px;
  height: 5px;
}

/* ===================================================================
   BUJO RAPID LOGGING
   =================================================================== */
.bujo-rapid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-paper);
}

.bujo-key-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-paper-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-md);
  font-size: 0.78rem;
  color: var(--text-body);
}

.bujo-key-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}

.bujo-glyph {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
}

.glyph-task { color: var(--text-main); }
.glyph-done { color: var(--accent-sage); }
.glyph-event { color: var(--accent-secondary); }
.glyph-note { color: var(--text-muted); }
.glyph-migrated { color: var(--accent-mustard); }

.bujo-log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px dashed var(--border-subtle);
  transition: background var(--transition-fast);
}

.bujo-log-row:hover {
  background: var(--bg-paper-alt);
}

.bujo-glyph-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bujo-glyph-btn:hover {
  background: var(--bg-card);
}

.bujo-log-text {
  flex: 1;
  font-size: 0.92rem;
  color: var(--text-main);
  font-family: var(--font-sans);
}

.bujo-log-row.is-completed .bujo-log-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.bujo-log-row.is-migrated .bujo-log-text {
  font-style: italic;
  color: var(--text-muted);
}

.bujo-log-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===================================================================
   PRINTABLE PAPER TWIN STYLES (@media print)
   =================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }

  .notebook-header,
  .notebook-tabs-wrapper,
  .notebook-spiral-strip,
  .todo-toolbar,
  .modal-overlay,
  .toast-container,
  .btn,
  .todo-action-btn,
  #btn-pull-todos,
  .ink-studio-wrapper,
  .washi-tape {
    display: none !important;
  }

  .notebook-app-canvas,
  .notebook-desk,
  .notebook-shell,
  .notebook-book {
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .notebook-page {
    display: block !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    page-break-after: always;
  }

  .notebook-page:not(.active) {
    display: none !important;
  }

  .bujo-matrix-card,
  .bujo-habits-card,
  .bujo-rapid-card,
  .daily-section-card {
    border: 1px solid #CCCCCC !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}

