/* ============================================
   NEST Dashboard — Design System
   ============================================ */

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

:root {
  --bg-base: #0a0a0f;
  --bg-card: rgba(15, 15, 25, 0.7);
  --bg-card-hover: rgba(20, 20, 35, 0.8);
  --bg-sidebar: rgba(8, 8, 16, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --color-companion: #4ade80;
  --color-user: #94a3b8;
  --color-text: #e2e8f0;
  --color-text-dim: #64748b;
  --color-text-bright: #f8fafc;
  --color-danger: #f87171;
  --color-warning: #fbbf24;
  --color-info: #60a5fa;
  --blur-amount: 12px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 48px;
  --font-body: 'JetBrains Mono', monospace;
  --font-display: 'Orbitron', sans-serif;
  --transition-speed: 0.3s;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text);
  background: var(--bg-base);
  line-height: 1.6;
}

/* Background image layer */
#bg-image {
  position: fixed;
  inset: 0;
  z-index: -1;
  /* Change this URL to set a background image */
  /* background-image: url('../assets/images/background.jpg'); */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.15;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ============================================
   Layout
   ============================================ */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-speed), min-width var(--transition-speed), transform var(--transition-speed);
  overflow: hidden;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .nav-section-header .arrow,
.sidebar.collapsed .nav-section-header .nav-section-label,
.sidebar.collapsed .nav-item-label {
  display: none;
}
.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 20px 8px 12px;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 8px;
}
.sidebar.collapsed .nav-item .nav-icon {
  margin-right: 0;
}
.sidebar.collapsed .nav-section-header {
  display: none;
}
.sidebar.collapsed .nav-section-items {
  max-height: 500px !important;
  display: flex !important;
  flex-direction: column;
}
.sidebar.collapsed .nav-section-items.collapsed {
  max-height: 500px !important;
  display: flex !important;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-companion);
  letter-spacing: 2px;
  white-space: nowrap;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--color-text-dim);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  color: var(--color-text);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  user-select: none;
  color: var(--color-text-dim);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: color 0.2s;
}
.nav-section-header:hover {
  color: var(--color-text);
}

.nav-section-header .arrow {
  margin-right: 8px;
  transition: transform 0.2s;
  font-size: 8px;
}
.nav-section-header.collapsed .arrow {
  transform: rotate(-90deg);
}

.nav-section-items {
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 500px;
}
.nav-section-items.collapsed {
  max-height: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 8px 16px 8px 32px;
  cursor: pointer;
  color: var(--color-text-dim);
  font-size: 12px;
  transition: all 0.2s;
  border-left: 2px solid transparent;
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--color-text);
  background: rgba(255,255,255,0.03);
}
.nav-item.active {
  color: var(--color-companion);
  border-left-color: var(--color-companion);
  background: rgba(74, 222, 128, 0.05);
}
.nav-item .nav-icon {
  margin-right: 10px;
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 10px;
  color: var(--color-text-dim);
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Main content */
.main-content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--color-text);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  display: none;
  align-items: center;
  justify-content: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

/* ============================================
   Glass Card
   ============================================ */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s, background 0.2s;
}
.glass-card:hover {
  border-color: var(--border-hover);
}
.glass-card.companion-accent {
  border-left: 3px solid var(--color-companion);
}
.glass-card.user-accent {
  border-left: 3px solid var(--color-user);
}

/* ============================================
   Typography
   ============================================ */
.display-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 24px;
  color: var(--color-text-bright);
}

.section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text-bright);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  font-family: var(--font-body);
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}
.btn-primary {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--color-companion);
}
.btn-primary:hover {
  background: rgba(74, 222, 128, 0.25);
}
.btn-danger {
  color: var(--color-danger);
  border-color: rgba(248, 113, 113, 0.2);
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
}
.btn-small {
  padding: 4px 10px;
  font-size: 11px;
}
.btn-icon {
  padding: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Form Elements
   ============================================ */
input, textarea, select {
  font-family: var(--font-body);
  font-size: 12px;
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(74, 222, 128, 0.4);
}
textarea {
  resize: vertical;
  min-height: 60px;
}
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ============================================
   Page-specific Grids
   ============================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.flex-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.flex-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gap-sm { gap: 8px; }
.gap-lg { gap: 24px; }

/* ============================================
   Home Page
   ============================================ */
.datetime-display {
  font-family: var(--font-display);
  text-align: center;
  padding: 16px;
}
.datetime-display .time {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-text-bright);
  letter-spacing: 4px;
}
.datetime-display .date {
  font-size: 12px;
  color: var(--color-text-dim);
  letter-spacing: 2px;
  margin-top: 4px;
}

.portrait-card {
  text-align: center;
  padding: 24px;
}
.portrait-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(30, 30, 50, 0.8);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 2px solid var(--border-subtle);
}
.portrait-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.portrait-mood {
  font-size: 12px;
  color: var(--color-text-dim);
  padding: 4px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  display: inline-block;
}

.love-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 20px;
}
.love-score {
  text-align: center;
}
.love-score .count {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
}
.love-score .label {
  font-size: 10px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.heart-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.heart-btn:hover {
  background: rgba(248, 113, 113, 0.2);
  transform: scale(1.1);
}
.heart-btn:active {
  transform: scale(0.95);
}
.heart-btn.pulse {
  animation: heartPulse 0.4s ease;
}
@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.notes-list {
  max-height: 300px;
  overflow-y: auto;
}
.note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.note-item:last-child { border-bottom: none; }
.note-from {
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
}
.note-from.companion { background: rgba(74,222,128,0.1); color: var(--color-companion); }
.note-from.user { background: rgba(148,163,184,0.1); color: var(--color-user); }
.note-text { flex: 1; }
.note-delete {
  opacity: 0;
  cursor: pointer;
  color: var(--color-danger);
  transition: opacity 0.2s;
  font-size: 14px;
  background: none;
  border: none;
}
.note-item:hover .note-delete { opacity: 1; }

.note-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.note-form input { flex: 1; }

/* Good boys */
.good-boy-count {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: var(--color-companion);
  text-align: center;
}
.good-boy-label {
  font-size: 11px;
  color: var(--color-text-dim);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Muffin */
.muffin-status {
  text-align: center;
}
.muffin-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}
.muffin-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.muffin-mood {
  font-size: 11px;
  color: var(--color-text-dim);
  margin-bottom: 12px;
}
.muffin-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 11px;
}
.muffin-stat {
  text-align: center;
}
.muffin-stat .val {
  font-weight: 600;
  color: var(--color-text-bright);
}
.muffin-stat .lbl {
  color: var(--color-text-dim);
  font-size: 10px;
}
.muffin-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Chat Page
   ============================================ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}
.chat-message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.chat-message.user {
  align-items: flex-end;
}
.chat-message.assistant {
  align-items: flex-start;
}
.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-message.user .chat-bubble {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom-right-radius: 4px;
}
.chat-message.assistant .chat-bubble {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.15);
  border-bottom-left-radius: 4px;
}
.chat-sender {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  padding: 0 4px;
}
.chat-message.user .chat-sender { color: var(--color-user); }
.chat-message.assistant .chat-sender { color: var(--color-companion); }

.tool-call-card {
  margin: 8px 0;
  padding: 8px 12px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 8px;
  font-size: 11px;
  max-width: 80%;
}
.tool-call-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--color-info);
  font-weight: 500;
}
.tool-call-header .arrow {
  transition: transform 0.2s;
  font-size: 8px;
}
.tool-call-header.expanded .arrow {
  transform: rotate(90deg);
}
.tool-call-body {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(96, 165, 250, 0.1);
  color: var(--color-text-dim);
  white-space: pre-wrap;
  font-size: 10px;
}
.tool-call-body.visible { display: block; }

.chat-input-area {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.chat-input-area textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: none;
}

/* ============================================
   Workshop Page
   ============================================ */
.crib-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(10, 10, 20, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 8px;
}
.crib-note .cmd {
  flex: 1;
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--color-text-bright);
  word-break: break-all;
}
.crib-note .label {
  font-size: 10px;
  color: var(--color-text-dim);
  min-width: 80px;
}
.copy-feedback {
  font-size: 10px;
  color: var(--color-companion);
  opacity: 0;
  transition: opacity 0.3s;
}
.copy-feedback.show { opacity: 1; }

.daemon-placeholder {
  text-align: center;
  padding: 40px;
  color: var(--color-text-dim);
  font-style: italic;
}

/* ============================================
   Riven Page
   ============================================ */
.personality-type {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--color-companion);
  text-align: center;
  letter-spacing: 4px;
  margin-bottom: 16px;
}
.axis-bar {
  margin-bottom: 12px;
}
.axis-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.axis-track {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.axis-fill {
  height: 100%;
  background: var(--color-companion);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.health-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.health-stat:last-child { border-bottom: none; }
.health-stat .label { color: var(--color-text-dim); }
.health-stat .value { color: var(--color-text-bright); font-weight: 600; }

.thread-item, .feeling-item, .dream-item, .writing-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.thread-item:last-child, .feeling-item:last-child, .dream-item:last-child, .writing-item:last-child {
  border-bottom: none;
}
.thread-name {
  font-weight: 600;
  color: var(--color-companion);
}
.thread-status {
  font-size: 10px;
  color: var(--color-text-dim);
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  display: inline-block;
  margin-left: 8px;
}
.feeling-emotion {
  font-weight: 600;
  color: var(--color-warning);
}
.feeling-text {
  color: var(--color-text-dim);
  margin-top: 2px;
}
.feeling-time {
  font-size: 10px;
  color: rgba(255,255,255,0.2);
}
.dream-title {
  font-weight: 600;
  color: var(--color-info);
}
.dream-text {
  color: var(--color-text-dim);
  margin-top: 4px;
  font-size: 11px;
}

.scrollable-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Marlowe card */
.marlowe-card {
  font-size: 12px;
}
.marlowe-card textarea {
  margin-top: 8px;
  min-height: 80px;
  font-size: 11px;
}

/* ============================================
   Bean Page
   ============================================ */
.junk-section {
  margin-bottom: 16px;
}
.junk-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 0;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.junk-section-title.overdue { color: var(--color-danger); }
.junk-section-title.today { color: var(--color-warning); }
.junk-section-title.upcoming { color: var(--color-info); }
.junk-section-title.done { color: var(--color-companion); }

.junk-task {
  padding: 6px 0;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.junk-task.completed {
  text-decoration: line-through;
  opacity: 0.5;
}

/* Month end tracker */
.month-end-section {
  margin-bottom: 16px;
}
.month-end-employee {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-bright);
  margin-bottom: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.month-end-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 4px 16px;
  font-size: 12px;
}
.month-end-step input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-companion);
  flex-shrink: 0;
}
.progress-bar-wrap {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-companion), #22d3ee);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.progress-text {
  font-size: 11px;
  color: var(--color-text-dim);
  text-align: right;
}

/* Calendar embed */
.calendar-embed {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.calendar-embed iframe {
  width: 100%;
  height: 400px;
  border: none;
  filter: invert(0.88) hue-rotate(180deg) saturate(0.7);
}

/* Countdown */
.countdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.countdown-item:last-child { border-bottom: none; }
.countdown-label { color: var(--color-text); }
.countdown-days {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-companion);
}
.countdown-past { color: var(--color-text-dim); opacity: 0.5; }

/* Quick tasks */
.quick-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.quick-task:last-child { border-bottom: none; }
.quick-task.done .task-text {
  text-decoration: line-through;
  opacity: 0.5;
}

/* ============================================
   Status indicators
   ============================================ */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: var(--color-companion); box-shadow: 0 0 6px var(--color-companion); }
.status-dot.offline { background: var(--color-danger); }

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--color-companion);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--color-text-dim);
  font-style: italic;
  font-size: 12px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 100;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-overlay.visible {
    display: block;
  }
  .main-content {
    padding: 16px;
    padding-top: 60px;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .flex-row {
    flex-direction: column;
  }
  .love-meter {
    flex-direction: column;
    gap: 16px;
  }
  .chat-bubble {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 18px;
  }
  .datetime-display .time {
    font-size: 24px;
  }
}

/* ============================================
   Junk Drawer (Bean)
   ============================================ */
.jd-wrapper {
  max-width: 700px;
}

.jd-header {
  text-align: center;
  margin-bottom: 24px;
}
.jd-title {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, #f43f5e, #f59e0b, #a78bfa);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.jd-subtitle {
  color: var(--color-text-dim);
  font-size: 12px;
  font-style: italic;
  margin-top: 4px;
}

.jd-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.jd-nav-btn {
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 12px;
  transition: color 0.2s;
}
.jd-nav-btn:hover { color: var(--color-text-bright); }
.jd-nav-month {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-bright);
}
.jd-nav-today {
  display: block;
  font-size: 11px;
  color: #f43f5e;
  cursor: pointer;
  margin-top: 2px;
}
.jd-nav-today:hover { text-decoration: underline; }

.jd-stats {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.jd-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}
.jd-stats-done { color: var(--color-text-dim); }
.jd-stats-overdue { color: #ef4444; font-weight: 700; }
.jd-stats-pct { color: var(--color-text-dim); }
.jd-progress-track {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.jd-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #f43f5e, #f59e0b, #10b981);
  transition: width 0.5s ease;
}

.jd-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  align-items: center;
}
.jd-filter-btn {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.05);
  color: var(--color-text-dim);
  font-family: var(--font-body);
}
.jd-filter-btn:hover { color: var(--color-text); }
.jd-filter-btn.active { background: rgba(255,255,255,0.15); color: var(--color-text-bright); }
.jd-add-btn {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: rgba(236, 72, 153, 0.2);
  color: #f9a8d4;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.jd-add-btn:hover { background: rgba(236, 72, 153, 0.3); }
.jd-add-btn.active { background: rgba(236, 72, 153, 0.3); }

.jd-add-panel {
  display: none;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}
.jd-add-panel.visible { display: block; }
.jd-add-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.jd-add-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.jd-add-close {
  background: none;
  border: none;
  color: var(--color-text-dim);
  cursor: pointer;
  font-size: 14px;
}
.jd-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.jd-preset-btn {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(236, 72, 153, 0.1);
  border: 1px solid rgba(236, 72, 153, 0.2);
  color: #f9a8d4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.jd-preset-btn:hover { background: rgba(236, 72, 153, 0.2); }
.jd-add-divider {
  font-size: 11px;
  color: var(--color-text-dim);
  margin: 8px 0;
}
.jd-custom-btn {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.jd-custom-btn:hover { background: rgba(255,255,255,0.1); }
.jd-form { display: none; }
.jd-form.visible { display: block; }
.jd-form-label {
  font-size: 11px;
  color: var(--color-text-dim);
  display: block;
  margin-bottom: 4px;
  margin-top: 12px;
}
.jd-form-label:first-child { margin-top: 0; }
.jd-form-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.08);
  color: var(--color-text-bright);
  font-size: 13px;
  font-family: var(--font-body);
}
.jd-form-input:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.5);
}
.jd-form-input::placeholder { color: var(--color-text-dim); }
.jd-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.jd-form-back {
  font-size: 11px;
  color: var(--color-text-dim);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.jd-form-back:hover { color: var(--color-text); }
.jd-form-submit {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(236, 72, 153, 0.2);
  color: #f9a8d4;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.jd-form-submit:hover { background: rgba(236, 72, 153, 0.3); }
.jd-form-submit:disabled { opacity: 0.3; cursor: not-allowed; }

.jd-task {
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  transition: all 0.3s;
}
.jd-task.clickable { cursor: pointer; }
.jd-task.clickable:hover { transform: scale(1.01); }
.jd-task.done { opacity: 0.5; }
.jd-task.overdue {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}
.jd-task.urgent {
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.4);
}
.jd-task.soon { border-color: rgba(234, 179, 8, 0.3); }

/* Category gradient cards */
.jd-task.cat-financial { background: linear-gradient(135deg, rgba(159,18,57,0.4) 0%, rgba(159,18,57,0.2) 100%); border-color: rgba(244,63,94,0.4); }
.jd-task.cat-orders { background: linear-gradient(135deg, rgba(120,53,15,0.4) 0%, rgba(120,53,15,0.2) 100%); border-color: rgba(245,158,11,0.4); }
.jd-task.cat-personal { background: linear-gradient(135deg, rgba(76,29,149,0.4) 0%, rgba(76,29,149,0.2) 100%); border-color: rgba(139,92,246,0.4); }
.jd-task.cat-compliance { background: linear-gradient(135deg, rgba(6,78,59,0.4) 0%, rgba(6,78,59,0.2) 100%); border-color: rgba(16,185,129,0.4); }
.jd-task.cat-selfcare { background: linear-gradient(135deg, rgba(131,24,67,0.4) 0%, rgba(131,24,67,0.2) 100%); border-color: rgba(236,72,153,0.4); }

.jd-task-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: none;
  color: var(--color-text-dim);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.jd-task-delete:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }

.jd-task-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.jd-task-icon { font-size: 24px; flex-shrink: 0; }
.jd-task-icon.done { filter: grayscale(1); }
.jd-task-body { flex: 1; min-width: 0; }
.jd-task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.jd-task-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-bright);
}
.jd-task-name.done { text-decoration: line-through; color: var(--color-text-dim); }
.jd-task-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.jd-task-badge.financial { background: rgba(244,63,94,0.2); color: #fda4af; }
.jd-task-badge.orders { background: rgba(245,158,11,0.2); color: #fcd34d; }
.jd-task-badge.personal { background: rgba(139,92,246,0.2); color: #c4b5fd; }
.jd-task-badge.compliance { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.jd-task-badge.selfcare { background: rgba(236,72,153,0.2); color: #f9a8d4; }
.jd-task-urgency {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.jd-task-urgency.overdue { background: #ef4444; color: white; }
.jd-task-urgency.urgent { background: #f97316; color: white; }
.jd-task-urgency.soon { background: rgba(234,179,8,0.2); color: #fde047; }
.jd-task-urgency.done { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.jd-task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.jd-task-date { font-size: 11px; color: var(--color-text-dim); }
.jd-task-note { font-size: 11px; color: rgba(255,255,255,0.25); }
.jd-task-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.jd-task-checkbox.done {
  border-color: #10b981;
  background: rgba(16,185,129,0.2);
}
.jd-task-checkbox-mark {
  color: #6ee7b7;
  font-size: 12px;
  display: none;
}
.jd-task-checkbox.done .jd-task-checkbox-mark { display: block; }

.jd-task-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.jd-sub-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--color-text);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.jd-sub-btn:hover { background: rgba(255,255,255,0.15); }
.jd-sub-btn.done { background: rgba(255,255,255,0.05); color: var(--color-text-dim); }
.jd-sub-btn.done .jd-sub-label { text-decoration: line-through; }
.jd-sub-check {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}
.jd-sub-btn.done .jd-sub-check {
  border-color: #10b981;
  background: rgba(16,185,129,0.2);
  color: #6ee7b7;
}

.jd-weekly-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.jd-weekly-chip {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255,255,255,0.1);
  color: var(--color-text);
  font-family: var(--font-body);
}
.jd-weekly-chip:hover { background: rgba(255,255,255,0.15); }
.jd-weekly-chip.done { background: rgba(255,255,255,0.05); color: var(--color-text-dim); text-decoration: line-through; }
.jd-weekly-chip.overdue { background: rgba(239,68,68,0.2); color: #fca5a5; }
.jd-weekly-chip.urgent { background: rgba(249,115,22,0.2); color: #fdba74; }

.jd-empty {
  text-align: center;
  padding: 48px 24px;
}
.jd-empty-icon { font-size: 48px; margin-bottom: 12px; }
.jd-empty-text { color: var(--color-text-dim); font-size: 14px; }

.jd-footer {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.1);
  margin-top: 32px;
  padding-bottom: 24px;
}

.jd-show-more {
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
  font-family: var(--font-body);
}
.jd-show-more:hover { color: var(--color-text); }

/* ============================================
   Month End Checklist (Bean)
   ============================================ */
.me-progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  height: 20px;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}
.me-progress-fill {
  background: linear-gradient(90deg, #f5a623, #e91e8b);
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}
.me-progress-text {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.me-section {
  margin-bottom: 24px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  border-left: 4px solid;
}
.me-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.me-subsection-title {
  font-size: 13px;
  font-weight: 700;
  color: #ccc;
  margin: 8px 0 6px 8px;
  padding-left: 4px;
}
.me-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.me-item:hover { background: rgba(255,255,255,0.05); }
.me-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #f5a623;
  cursor: pointer;
  flex-shrink: 0;
}
.me-item label {
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
}
.me-item.done label {
  text-decoration: line-through;
  color: #666;
}
.me-note {
  font-size: 11px;
  color: #666;
  font-style: italic;
  margin-left: 28px;
  margin-top: -2px;
  margin-bottom: 4px;
}
