/* Paleta clara (por defecto). El tema oscuro sólo redefine estas variables:
   ningún color vive suelto en los componentes. */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --hover: #f9fafb;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --amber: #f59e0b;
  --backdrop: rgba(17, 24, 39, 0.45);
  --toast-bg: #111827;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.15);
  --radius: 12px;
  --header-h: 60px;
  color-scheme: light;
}

/* Tema oscuro: automático si el sistema lo pide (salvo que se fuerce claro)… */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --card: #171a21;
    --hover: #1f2430;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #2a2f3a;
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --success: #34d399;
    --danger: #f87171;
    --amber: #fbbf24;
    --backdrop: rgba(0, 0, 0, 0.6);
    --toast-bg: #374151;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

/* …y forzado desde el botón de tema, en cualquier sistema. */
:root[data-theme="dark"] {
  --bg: #0f1115;
  --card: #171a21;
  --hover: #1f2430;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #2a2f3a;
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --success: #34d399;
  --danger: #f87171;
  --amber: #fbbf24;
  --backdrop: rgba(0, 0, 0, 0.6);
  --toast-bg: #374151;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button {
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}

input[type="text"], input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
input[type="color"] {
  width: 44px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

/* ---------- Cabecera ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.brand {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin: 0 auto;
}
.nav-btn {
  padding: 7px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.nav-btn.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.header-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* ---------- Botones ---------- */
.primary-btn {
  background: var(--primary);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.15s;
}
.primary-btn:hover { background: var(--primary-dark); }
.primary-btn.full { width: 100%; }

.ghost-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 500;
}
.ghost-btn:hover { background: var(--hover); }
.ghost-btn.danger { color: var(--danger); }

.danger-btn {
  background: var(--danger);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
}
.danger-btn:hover { background: #dc2626; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.mini {
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--muted);
}
.mini:hover { background: var(--bg); color: var(--text); }

/* ---------- Vistas ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

.view { display: none; }
.view.active { display: block; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.view-head h1 { margin: 0; font-size: 24px; }

.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ---------- Tareas ---------- */
.quick-add {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.quick-add input { flex: 1; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.segmented {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}
.seg {
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.seg.active { background: var(--primary); color: #fff; }
.list-filter {
  width: auto;
  min-width: 150px;
}

.task-list { display: flex; flex-direction: column; gap: 20px; }

.group-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.group-label .count {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  padding: 1px 7px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.task:hover { box-shadow: var(--shadow-lg); }
.task.completed { opacity: 0.6; }
.task.completed .task-title { text-decoration: line-through; }
.task.overdue { border-left: 4px solid var(--danger); }
.task.compact { padding: 9px 12px; }

.task-check { position: relative; margin-top: 2px; flex-shrink: 0; }
.task-check input { position: absolute; opacity: 0; width: 20px; height: 20px; cursor: pointer; }
.checkmark {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  transition: all 0.15s;
}
.task-check input:checked + .checkmark {
  background: var(--success);
  border-color: var(--success);
}
.task-check input:checked + .checkmark::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; word-break: break-word; }
.task-notes {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}
.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.task-meta .muted { color: var(--muted); }

.chip {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.prio {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}
.prio-alta { background: #fee2e2; color: #b91c1c; }
.prio-media { background: #fef3c7; color: #b45309; }
.overdue-tag { background: #fee2e2; color: #b91c1c; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }

.task-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* ---------- Calendario ---------- */
.calendar-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.calendar-wrap { flex: 1; min-width: 0; }

.calendar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.calendar-head h2 { margin: 0 8px; font-size: 20px; min-width: 170px; text-align: center; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-dow {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
}
.cal-cell {
  position: relative;
  min-height: 92px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.cal-cell:hover { box-shadow: var(--shadow); }
.cal-cell.blank { background: transparent; border: none; cursor: default; }
.cal-cell.other { opacity: 0.35; }
.cal-cell.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-cell.today .cal-day-num {
  background: var(--primary);
  color: #fff;
}
.cal-cell.selected { border-color: var(--primary-dark); box-shadow: 0 0 0 2px rgba(59,130,246,0.35); }
.cal-day-num {
  align-self: flex-end;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
  padding-top: 4px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot.done { opacity: 0.35; }
.dot-more { font-size: 10px; color: var(--muted); line-height: 8px; }

.day-panel {
  display: none;
  width: 320px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 200px;
}
.day-panel.open { display: block; }
.day-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.day-panel-head h3 { margin: 0; font-size: 17px; }
#day-panel-tasks { margin-top: 12px; }

/* ---------- Hábitos ---------- */
.habits-list { display: flex; flex-direction: column; gap: 16px; }

.habit {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.habit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.habit-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.habit-name { font-size: 17px; font-weight: 700; flex: 1; }
.habit-actions { display: flex; gap: 2px; }

.habit-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.stat-num { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.habit-week {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.habit-day {
  flex: 1;
  height: 40px;
  border-radius: 9px;
  border: 2px solid var(--border);
  background: var(--card);
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.12s;
}
.habit-day.off { background: var(--hover); color: var(--muted); border-color: var(--hover); cursor: not-allowed; opacity: .6; }
.habit-day.future { opacity: 0.5; }
.habit-day.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.habit-day:disabled { cursor: default; }

.heat-grid {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  grid-auto-flow: column;
  gap: 4px;
  justify-content: end;
}
.heat-cell {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--bg);
}
.heat-cell.none { background: #eef0f4; }
.heat-cell.off-sched { background: #dbeafe; }
.heat-cell.on { background: var(--success); }

/* ---------- Estados vacíos ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  font-size: 15px;
}
.empty.small { padding: 20px 12px; font-size: 14px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.15s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 4px;
}
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-close { font-size: 24px; line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 14px 20px 20px; }
.modal-body label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
.modal-body label input, .modal-body label select, .modal-body label textarea { margin-top: 4px; }
.form-row { display: flex; gap: 12px; }
.form-row label { flex: 1; }
.form-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.days-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.day-pick {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 600;
  color: var(--muted);
}
.day-pick.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.color-swatch { width: 16px; height: 16px; border-radius: 5px; flex-shrink: 0; }
.list-name { flex: 1; font-weight: 600; }
.list-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 1px 8px;
  border-radius: 999px;
}
.add-row { display: flex; gap: 8px; margin-top: 14px; }
.add-row input[type="text"] { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  z-index: 200;
  max-width: 90vw;
}
.toast.error { background: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .app-header { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav-btn { flex: 1; text-align: center; }
  .header-actions { margin-left: auto; }
  .brand span { display: none; }

  .calendar-layout { flex-direction: column; }
  .day-panel { width: 100%; }
  .cal-cell { min-height: 60px; padding: 4px; }
  .cal-day-num { width: 20px; height: 20px; font-size: 11px; }
  .filter-bar { gap: 8px; }
  .seg { padding: 6px 9px; font-size: 13px; }
}

/* ==========================================================================
   Componentes añadidos en Bitácora
   ========================================================================== */

/* ---------- Cabecera: estado de sync y menú ---------- */
.sync-status {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding: 0 4px;
  cursor: default;
  user-select: none;
}
.sync-status.ok { color: var(--success); }
.sync-status.pending { color: var(--amber); }
.sync-status.offline { color: var(--danger); }
.sync-status.local { color: var(--muted); }

.ghost-btn.icon { padding: 6px 9px; font-size: 15px; line-height: 1; }
.ghost-btn.small { padding: 4px 8px; font-size: 12px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 190px;
  z-index: 150;
  display: flex;
  flex-direction: column;
}
/* El display de arriba es una regla de autor y le gana al display:none que el
   navegador aplica al atributo [hidden], así que hay que apagarlo a mano. */
.menu[hidden] { display: none; }
.menu button {
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
}
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }

/* ---------- Búsqueda ---------- */
.search-wrap { position: relative; display: flex; align-items: center; }
#task-search {
  width: 240px;
  max-width: 46vw;
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
#task-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
#task-search::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  right: 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
}
.search-clear:hover { background: var(--hover); color: var(--text); }

/* ---------- Vista previa del añadir rápido ---------- */
.quick-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -6px 0 14px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.qp-title { font-weight: 600; margin-right: 4px; }
.qp-chip {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  white-space: nowrap;
}
:root[data-theme="dark"] .qp-chip { color: var(--primary); }

/* ---------- Subtareas en la lista ---------- */
.sub-chip, .rec-chip {
  border: 0;
  font-family: inherit;
  background: var(--hover);
  color: var(--muted);
  cursor: pointer;
}
.sub-chip:hover { color: var(--text); }
.sub-chip.complete { color: var(--success); }
.rec-chip { cursor: default; }

.subtasks {
  margin-top: 8px;
  padding-left: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subtask {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}
.subtask.done span { text-decoration: line-through; color: var(--muted); }
.subtask input { accent-color: var(--primary); margin: 0; }

/* ---------- Editor de subtareas en el modal ---------- */
.sub-block { margin-top: 4px; }
.sub-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.sub-edit { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sub-edit input[type="text"] {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.sub-edit input[type="text"]:focus { outline: none; border-color: var(--primary); }
.sub-edit input[type="checkbox"] { accent-color: var(--primary); }

/* ---------- Pantalla de contraseña ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-brand { font-size: 22px; font-weight: 700; text-align: center; }
.login-hint { margin: 0; color: var(--muted); font-size: 13.5px; text-align: center; }
.login-box input {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
.login-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.login-error { margin: 0; color: var(--danger); font-size: 13px; min-height: 18px; text-align: center; }

/* ---------- Responsive de lo nuevo ---------- */
@media (max-width: 760px) {
  .view-head { flex-wrap: wrap; gap: 10px; }
  .search-wrap { width: 100%; }
  #task-search { width: 100%; max-width: none; }
  .sync-status { font-size: 0; }            /* en móvil sólo el punto de color */
  .sync-status::first-letter { font-size: 14px; }
  .header-actions { gap: 4px; }
  /* Respeta el notch/barra inferior en iPhone instalado como app */
  main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ---------- Hábitos vistos como tareas ---------- */
/* Se distinguen por una barra del color del hábito, sin competir con el rojo
   de las vencidas ni con el chip de lista de las tareas normales. */
.task.habito { border-left: 4px solid var(--hc, var(--success)); }
.task.habito.futuro { opacity: 0.62; }
.task.habito.futuro .task-check { cursor: not-allowed; }
.habito-chip { font-weight: 600; }

/* Punto del calendario: hueco para diferenciarlo de las tareas */
.cal-dots .dot.habito {
  box-shadow: inset 0 0 0 2px var(--card);
}

/* Botón-interruptor (Hábitos on/off) */
.ghost-btn.toggle { opacity: 0.55; }
.ghost-btn.toggle.on {
  opacity: 1;
  border-color: var(--primary);
  color: var(--primary);
}
