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

/* ── TEMAS ─────────────────────────────────────────────────────────────────── */
:root, [data-theme="claro"] {
  --bg-page:       #f8f8f6;
  --bg-card:       #ffffff;
  --bg-secondary:  #f2f1ed;
  --bg-hover:      #eae9e4;
  --bg-input:      #ffffff;
  --border:        rgba(0,0,0,0.09);
  --border-md:     rgba(0,0,0,0.14);
  --border-focus:  #2d7a4f;
  --text:          #1a1a1a;
  --text-secondary:#5a5a5a;
  --text-tertiary: #9a9a9a;
  --text-muted:    #b0b0b0;
  --accent:        #2d7a4f;
  --accent-hover:  #235f3d;
  --accent-light:  #e8f5ee;
  --accent-text:   #235f3d;
  --sidebar-bg:    #1e2d24;
  --sidebar-text:  #c8d9cc;
  --sidebar-active:#ffffff;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-accent:#3dba70;
  --topbar-bg:     #ffffff;
  --shadow:        0 1px 4px rgba(0,0,0,0.07);
  --shadow-card:   0 2px 8px rgba(0,0,0,0.06);
  --green-bg:#e8f5ee;  --green-text:#1a5c35;
  --amber-bg:#fef3dc;  --amber-text:#92580a;
  --red-bg:#fdecea;    --red-text:#b53a3a;
  --blue-bg:#e6f0fb;   --blue-text:#1e5fa0;
  --gray-bg:#f2f1ed;   --gray-text:#5a5a5a;
  --purple-bg:#f0eeff; --purple-text:#5440cc;
  --teal-bg:#e4f5f5;   --teal-text:#1a7070;
}

[data-theme="oscuro"] {
  --bg-page:       #111714;
  --bg-card:       #1a2420;
  --bg-secondary:  #1f2d28;
  --bg-hover:      #253228;
  --bg-input:      #1a2420;
  --border:        rgba(255,255,255,0.08);
  --border-md:     rgba(255,255,255,0.13);
  --border-focus:  #3dba70;
  --text:          #e8f0eb;
  --text-secondary:#8faa96;
  --text-tertiary: #5a7060;
  --text-muted:    #3d5043;
  --accent:        #3dba70;
  --accent-hover:  #32a05e;
  --accent-light:  #1a3328;
  --accent-text:   #3dba70;
  --sidebar-bg:    #0e1912;
  --sidebar-text:  #7a9980;
  --sidebar-active:#e8f0eb;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-accent:#3dba70;
  --topbar-bg:     #1a2420;
  --shadow:        0 1px 4px rgba(0,0,0,0.3);
  --shadow-card:   0 2px 8px rgba(0,0,0,0.25);
  --green-bg:#1a3328;  --green-text:#3dba70;
  --amber-bg:#2e2010;  --amber-text:#d4952a;
  --red-bg:#2e1414;    --red-text:#e07070;
  --blue-bg:#0f2040;   --blue-text:#6aabf0;
  --gray-bg:#1f2d28;   --gray-text:#8faa96;
  --purple-bg:#1e1a40; --purple-text:#9080f0;
  --teal-bg:#0f2a2a;   --teal-text:#3dbaba;
}

/* ── BASE ── */
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg-page); color: var(--text);
  line-height: 1.5; height: 100vh; overflow: hidden;
  transition: background 0.25s, color 0.25s;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ── LAYOUT ── */
.app { display: flex; height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px; min-width: 220px;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  transition: width 0.22s ease, min-width 0.22s ease;
  overflow: hidden; z-index: 100; flex-shrink: 0;
}
.sidebar.collapsed { width: 56px; min-width: 56px; }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 1.1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  white-space: nowrap;
}
.logo-icon { font-size: 22px; color: var(--sidebar-accent); flex-shrink: 0; }
.logo-text { font-size: 16px; font-weight: 600; color: var(--sidebar-active); }
.logo-sub  { font-size: 10px; color: var(--sidebar-text); display: block; margin-top: 1px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-sub { display: none; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 0.7rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.07);
  white-space: nowrap;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sidebar-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.user-name { font-size: 12px; color: var(--sidebar-text); }
.sidebar.collapsed .user-name { display: none; }

nav { flex: 1; min-height: 0; overflow-y: auto; padding: 0.5rem 0; }
nav::-webkit-scrollbar { width: 3px; }
nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section {
  padding: 0.65rem 1rem 0.2rem;
  font-size: 9px; color: var(--sidebar-text);
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap; opacity: 0.6;
}
.sidebar.collapsed .nav-section { height: 14px; visibility: hidden; padding: 0.35rem 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 1rem; color: var(--sidebar-text);
  border-left: 3px solid transparent;
  transition: all 0.12s; white-space: nowrap; position: relative;
}
.nav-item i { font-size: 18px; flex-shrink: 0; }
.nav-item span { font-size: 13px; }
.sidebar.collapsed .nav-item span { display: none; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-active); }
.nav-item.active {
  background: rgba(61,186,112,0.12); color: var(--sidebar-active);
  border-left-color: var(--sidebar-accent); font-weight: 500;
}
.nav-item.active i { color: var(--sidebar-accent); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; border-left: none; border-right: 3px solid transparent; }
.sidebar.collapsed .nav-item.active { border-right-color: var(--sidebar-accent); background: rgba(61,186,112,0.12); }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; gap: 6px;
}
.sidebar-footer button {
  flex: 1; background: rgba(255,255,255,0.07);
  border: none; border-radius: 6px; padding: 7px 6px;
  color: var(--sidebar-text); font-size: 11px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background 0.12s;
}
.sidebar-footer button:hover { background: rgba(255,255,255,0.13); color: var(--sidebar-active); }
.sidebar-footer button i { font-size: 15px; }
.sidebar.collapsed .sidebar-footer { flex-direction: column; }
.sidebar.collapsed .sidebar-footer button span { display: none; }

/* ── TOPBAR ── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; min-height: 0; }
.topbar {
  height: 52px; background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem; flex-shrink: 0; box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 15px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.clock { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.topbar-date { font-size: 11px; color: var(--text-tertiary); }

/* ── PAGES ── */
.page { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem; }
.page.active { display: block; }
.page::-webkit-scrollbar { width: 5px; }
.page::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 3px; }

/* ── CARDS ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.25rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-md); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title { font-size: 14px; font-weight: 500; }
.card-subtitle { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }

/* ── MÉTRICAS ── */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 1rem; }
.metric-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.875rem 1rem;
  transition: transform 0.1s;
}
.metric-card:hover { transform: translateY(-1px); }
.metric-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.metric-label i { font-size: 13px; }
.metric-value { font-size: 26px; font-weight: 600; line-height: 1.1; }
.metric-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.metric-card.accent { background: var(--bg-secondary); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.metric-card.accent .metric-value { color: var(--accent-text); }

/* ── DASH GRID ── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dash-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 7px; padding: 7px 14px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: background 0.12s, transform 0.08s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-md); border-radius: 7px;
  padding: 7px 14px; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.12s;
}
.btn-secondary:hover { background: var(--bg-secondary); }
.btn-icon {
  background: transparent; border: none; padding: 5px 6px;
  color: var(--text-secondary); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s; font-size: 15px;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--red-bg); color: var(--red-text); border: none; border-radius: 7px; padding: 6px 12px; font-size: 12px; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 5px; }

/* ── FORMS ── */
input[type=text], input[type=number], input[type=date], input[type=email],
input[type=month], input[type=time], input[type=password], select, textarea {
  background: var(--bg-input); border: 1px solid var(--border-md);
  border-radius: 7px; padding: 7px 10px; font-size: 13px;
  color: var(--text); font-family: inherit; width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(45,122,79,0.15);
}
select { cursor: pointer; }
textarea { resize: vertical; line-height: 1.6; }
.form-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 90px; }
.form-row .btn-primary { flex: 0 0 auto; align-self: flex-start; margin-top: 0; padding: 8px 16px; }
.form-group { margin-bottom: 0.875rem; }
.form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.form-row-modal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=range] { accent-color: var(--accent); cursor: pointer; padding: 0; height: 6px; border: none; background: transparent; box-shadow: none; }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 6px; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-btn {
  background: transparent; border: 1px solid var(--border-md);
  border-radius: 20px; padding: 4px 14px; font-size: 12px;
  color: var(--text-secondary); transition: all 0.12s; white-space: nowrap;
}
.filter-btn:hover { background: var(--bg-secondary); color: var(--text); }
.filter-btn.active {
  background: var(--accent-light); color: var(--accent-text);
  border-color: var(--accent); font-weight: 500;
}

/* ── TAGS ── */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.tag-green  { background: var(--green-bg);  color: var(--green-text); }
.tag-amber  { background: var(--amber-bg);  color: var(--amber-text); }
.tag-red    { background: var(--red-bg);    color: var(--red-text); }
.tag-blue   { background: var(--blue-bg);   color: var(--blue-text); }
.tag-gray   { background: var(--gray-bg);   color: var(--gray-text); }
.tag-purple { background: var(--purple-bg); color: var(--purple-text); }
.tag-teal   { background: var(--teal-bg);   color: var(--teal-text); }

/* ── ROWS / LIST ITEMS ── */
.row-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 6px; border-bottom: 1px solid var(--border); font-size: 13px;
  transition: background 0.1s; border-radius: 0;
}
.row-item:last-child { border-bottom: none; }
.row-item:hover { background: var(--bg-secondary); border-radius: 6px; }
.row-text { flex: 1; min-width: 0; }
.row-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.row-actions { display: flex; gap: 3px; align-items: center; opacity: 0; transition: opacity 0.12s; flex-shrink: 0; }
.row-item:hover .row-actions { opacity: 1; }

/* En touch (celular/tablet) no hay :hover real, así que los botones de
   acción de cada fila (eliminar, editar, pagar, etc.) quedaban invisibles
   e imposibles de tocar en toda la app. Se muestran siempre en touch, y
   también por debajo de 640px por las dudas (Windows angosto sin mouse
   fino, etc.). */
@media (hover: none), (max-width: 640px) {
  .row-actions { opacity: 1 !important; }
  /* Objetivo táctil un poco más generoso (los 5px/6px de desktop quedan
     chicos para un dedo). */
  .btn-icon { padding: 8px; }
}

/* ── CHECKBOX ── */
.checkbox {
  width: 18px; height: 18px; border: 1.5px solid var(--border-md);
  border-radius: 5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.12s;
}
.checkbox:hover { border-color: var(--accent); }
.checkbox.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.checkbox i { font-size: 11px; }
.text-done { text-decoration: line-through; color: var(--text-tertiary); }

/* ── PROGRESS ── */
.progress-bar { background: var(--bg-secondary); border-radius: 6px; height: 7px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: var(--accent); transition: width 0.4s ease; }
.progress-fill.danger  { background: #e05c5c; }
.progress-fill.warning { background: #d4952a; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-pct { font-size: 12px; font-weight: 600; min-width: 38px; text-align: right; color: var(--accent-text); }

/* ── HABITS ── */
.habits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.habit-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.habit-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.habit-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.habit-name i { font-size: 18px; color: var(--accent); }
.habit-days { display: flex; gap: 4px; margin-bottom: 8px; }
.habit-day {
  flex: 1; min-width: 0; aspect-ratio: 1;
  border-radius: 6px; border: 1px solid var(--border-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-tertiary); cursor: pointer;
  transition: all 0.12s; padding: 2px;
}
.habit-day .dl { font-size: 8px; color: var(--text-muted); margin-top: 1px; }
.habit-day.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.habit-day.done .dl { color: rgba(255,255,255,0.75); }
.habit-day:hover:not(.done) { background: var(--bg-secondary); border-color: var(--border-focus); }
.habit-footer { display: flex; justify-content: space-between; align-items: center; }
.habit-streak { font-size: 11px; color: var(--text-secondary); }
.streak-fire { color: #e67e22; }

.habit-heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 2px; margin-top: 10px; }
.habit-heatmap-cell { width: 8px; height: 8px; border-radius: 2px; background: var(--bg-secondary); }
.habit-heatmap-cell.done { background: var(--accent); }
.habit-record { font-size: 11px; color: var(--text-tertiary); }

.kanban-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; overflow-x: auto; }
.kanban-col { background: var(--bg-secondary); border-radius: 10px; padding: 10px; min-width: 220px; }
.kanban-col-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; display: flex; justify-content: space-between; }
.kanban-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 12px; }
.kanban-card-title { margin-bottom: 6px; }
.kanban-card-actions { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 720px) { .kanban-board { grid-template-columns: 1fr; } }

/* ── META / PROYECTO CARD ── */
.meta-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 0.875rem; transition: border-color 0.15s; }
.meta-card:hover { border-color: var(--border-md); }
.meta-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; gap: 10px; }
.meta-title { font-size: 14px; font-weight: 500; }
.meta-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.6; }
.meta-actions { display: flex; gap: 4px; flex-shrink: 0; }
.meta-progress-row { display: flex; align-items: center; gap: 10px; }
.meta-progress-row input[type=range] { width: 100px; }
.meta-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.meta-footer-info { font-size: 11px; color: var(--text-tertiary); display: flex; gap: 10px; }

/* ── CALENDAR ── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-label { text-align: center; font-size: 11px; color: var(--text-tertiary); padding: 5px 0; font-weight: 500; }
.cal-day {
  min-height: 75px; background: var(--bg-secondary);
  border-radius: 8px; padding: 5px 6px; font-size: 12px;
  border: 1px solid transparent; cursor: pointer;
  transition: border-color 0.12s, background 0.1s;
}
.cal-day:hover { border-color: var(--border-md); background: var(--bg-hover); }
.cal-day.today { border-color: var(--accent) !important; background: var(--accent-light); }
.cal-num { font-weight: 500; margin-bottom: 3px; }
.cal-day.today .cal-num { color: var(--accent-text); }
.cal-event {
  font-size: 10px; padding: 2px 5px; border-radius: 4px;
  margin-top: 2px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; cursor: pointer;
}
.ce-deporte { background: var(--amber-bg); color: var(--amber-text); }
.ce-estudio { background: var(--green-bg);  color: var(--green-text); }
.ce-personal{ background: var(--purple-bg); color: var(--purple-text); }
.ce-trabajo { background: var(--blue-bg);   color: var(--blue-text); }
.ce-social  { background: var(--teal-bg);   color: var(--teal-text); }

/* ── NOTAS ── */
.notas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.nota-card {
  border-radius: 12px; padding: 1rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.nota-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.nota-card.pinned { border-style: dashed; }
.nota-green  { background: var(--green-bg);  border-color: #9ad4b0; }
.nota-amber  { background: var(--amber-bg);  border-color: #f0c070; }
.nota-blue   { background: var(--blue-bg);   border-color: #90c0f0; }
.nota-purple { background: var(--purple-bg); border-color: #b0a0f0; }
.nota-red    { background: var(--red-bg);    border-color: #f0a0a0; }
.nota-title  { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: flex-start; }
.nota-content { font-size: 12px; white-space: pre-line; line-height: 1.65; }
.nota-green .nota-title, .nota-green .nota-content   { color: var(--green-text); }
.nota-amber .nota-title, .nota-amber .nota-content   { color: var(--amber-text); }
.nota-blue .nota-title, .nota-blue .nota-content     { color: var(--blue-text); }
.nota-purple .nota-title, .nota-purple .nota-content { color: var(--purple-text); }
.nota-red .nota-title, .nota-red .nota-content       { color: var(--red-text); }
.nota-footer { margin-top: 10px; font-size: 10px; opacity: 0.6; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border-radius: 14px;
  padding: 1.5rem; width: 520px; max-width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: modal-in 0.18s ease;
}
@keyframes modal-in { from { transform: scale(0.95) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ── COMMAND PALETTE / BUSCADOR GLOBAL ── */
.cmdk-modal {
  width: 560px; max-width: 100%; padding: 0; overflow: hidden;
  align-self: flex-start; margin-top: 10vh;
}
.cmdk-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.cmdk-input-wrap i { font-size: 18px; color: var(--text-secondary); }
#cmdk-input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 15px; color: var(--text);
}
.cmdk-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.cmdk-group-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-tertiary); padding: 8px 10px 4px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.cmdk-item i { font-size: 15px; color: var(--accent); width: 18px; text-align: center; }
.cmdk-item-title { flex: 1; }
.cmdk-item-extra { font-size: 11px; color: var(--text-tertiary); }
.cmdk-item:hover, .cmdk-item.active { background: var(--bg-hover); }
.cmdk-empty { padding: 24px 10px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
@media(max-width:700px){
  .cmdk-modal { width: 100%; margin-top: 4vh; }
}

/* ── TOAST ── */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: 8px; z-index: 2000; pointer-events: none; }
.toast {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border-md);
  padding: 10px 16px; border-radius: 9px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: toast-in 0.2s ease; pointer-events: auto;
}
.toast-success { border-left: 3px solid var(--accent); }
.toast-error   { border-left: 3px solid var(--red-text); }
.toast-info    { border-left: 3px solid var(--blue-text); }
.toast i { font-size: 16px; }
.toast-success i { color: var(--accent); }
.toast-error i   { color: var(--red-text); }
.toast-info i    { color: var(--blue-text); }
@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── EMPTY ── */
.empty { padding: 2rem; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.empty i { font-size: 32px; display: block; margin-bottom: 8px; opacity: 0.4; }

/* ── INCOME / EXPENSE ── */
.income { color: var(--green-text); font-weight: 500; }
.expense { color: var(--red-text); font-weight: 500; }

/* ── BUDGET BAR ── */
.budget-item { margin-bottom: 12px; }
.budget-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.budget-bar { background: var(--bg-secondary); border-radius: 6px; height: 8px; overflow: hidden; }
.budget-fill { height: 100%; border-radius: 6px; background: var(--accent); transition: width 0.4s; }
.budget-fill.over { background: var(--red-text); }
.budget-fill.warn { background: var(--amber-text); }

/* ── SECTION SPACING ── */
.section-gap { margin-bottom: 1rem; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-title { font-size: 17px; font-weight: 600; margin-bottom: 1.25rem; }

/* ── SETTINGS ── */
.settings-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.settings-title { font-size: 13px; font-weight: 600; margin-bottom: 1rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; }
.theme-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px; border: 2px solid var(--border-md);
  background: var(--bg-secondary); font-size: 13px; transition: all 0.12s;
}
.theme-btn:hover { border-color: var(--accent); }
.theme-btn.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent-text); font-weight: 500; }
.theme-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.1); }
.td-claro  { background: linear-gradient(135deg, #fff 50%, #2d7a4f 50%); }
.td-oscuro { background: linear-gradient(135deg, #1a2420 50%, #3dba70 50%); }

/* ── SPORT INTENSITY ── */
.intensity-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.intensity-alta { background: #e05c5c; }
.intensity-media { background: var(--accent); }
.intensity-baja { background: var(--blue-text); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid-3 { grid-template-columns: 1fr; }
  .sidebar { width: 56px; min-width: 56px; }
  .sidebar .logo-text, .sidebar .logo-sub, .sidebar .user-name,
  .sidebar .nav-section span, .sidebar .nav-item span { display: none; }
}

/* Celulares (<=640px): el rail angosto de íconos fijos no alcanza como
   navegación usable; el sidebar pasa a ser un drawer oculto que se abre
   como overlay encima del contenido, sin robarle ancho al layout. */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 99;
}
@media (max-width: 640px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    width: 220px; min-width: 220px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 100;
  }
  /* En este breakpoint el sidebar solo se abre a demanda como drawer
     completo: aunque quede la clase .collapsed de desktop, se ignora
     el rail angosto de 56px y siempre se muestra con texto. */
  .sidebar.collapsed { width: 220px; min-width: 220px; }
  /* El drawer de celu siempre muestra texto, tenga o no la clase .collapsed
     de desktop: sin este selector sin calificar, la regla general de la
     media query de 900px (.sidebar .nav-item span { display:none }) seguia
     ganando y el drawer quedaba solo con iconos, sin nombre de modulo. */
  .sidebar .logo-text, .sidebar .logo-sub,
  .sidebar .user-name, .sidebar .nav-section,
  .sidebar .nav-item span { display: revert; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
}

/* Auditoría de responsive (mobile-first, mismo breakpoint que el resto de la
   app): filas/grillas de ancho fijo que no colapsaban y podían generar
   scroll horizontal en pantallas angostas. */
@media (max-width: 700px) {
  /* Formularios de dos columnas dentro de modales y de Finanzas: se apilan
     en vez de forzar columnas angostas con inputs/selects recortados. */
  .form-row-modal { grid-template-columns: 1fr; }
  .fin-form-grid { grid-template-columns: 1fr; }

  /* Config > foto de perfil + formulario: sin flex-wrap se empujaban uno
     contra el otro en pantallas chicas; ahora la foto queda arriba. */
  .cfg-perfil-grid { flex-wrap: wrap; }

  /* Lista de "Métricas de salud": fila plana sin contenedor con
     min-width:0 (a diferencia de .row-text que usan el resto de listas),
     forzaba scroll horizontal. Se permite wrap. */
  .metrica-row { flex-wrap: wrap; row-gap: 4px; }
  .metrica-tipo { min-width: 0; }

  /* Formularios .form-row (tareas, hábitos, deporte, estudio, medicamentos,
     etc.): con varios campos de min-width:90px no entran en ~300-320px
     útiles y quedan apretados/cortados. Se apilan en columna. */
  .form-row { flex-direction: column; }
  .form-row > * { min-width: 0; width: 100%; }
  .form-row .btn-primary { width: 100%; }

  /* Calendario: los ítems de grid tienen min-width:auto por default, así
     que un .cal-event ancho (white-space:nowrap) desborda las 7 columnas
     y, como .main-content tiene overflow:hidden, el desborde se recorta
     en vez de scrollear. Se permite encoger + se achica el contenido. */
  .cal-day { min-width: 0; min-height: 52px; padding: 3px 4px; font-size: 10px; }
  .cal-event { font-size: 8px; padding: 1px 3px; }
  /* Red de seguridad: si aun así no entra perfecto, se puede swipear en
     vez de que se corte contenido invisible. */
  .cal-grid-wrap { overflow-x: auto; }
}

/* ── SALUD ───────────────────────────────────────────────────────────────────── */
.salud-tabs { display:flex; gap:6px; margin-bottom:1rem; flex-wrap:wrap; }
.salud-tab {
  display:flex; align-items:center; gap:7px; padding:9px 18px;
  background:var(--bg-secondary); border:1px solid var(--border-md);
  border-radius:9px; font-size:13px; color:var(--text-secondary);
  cursor:pointer; transition:all 0.12s; font-weight:500;
}
.salud-tab i { font-size:17px; }
.salud-tab:hover { background:var(--bg-hover); color:var(--text); }
.salud-tab.active { background:var(--accent-light); color:var(--accent-text); border-color:var(--accent); }
.salud-panel { display:none; }
.salud-panel.active { display:block; }

/* Medication cards */
.med-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; }
.med-card {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:14px; padding:1.1rem 1.25rem;
  transition:transform 0.12s, box-shadow 0.12s;
  position:relative; overflow:hidden;
}
.med-card::before {
  content:''; position:absolute; left:0; top:0; bottom:0;
  width:4px; border-radius:14px 0 0 14px;
}
.med-card.color-blue::before { background:#185FA5; }
.med-card.color-green::before { background:var(--accent); }
.med-card.color-purple::before { background:#5440cc; }
.med-card.color-amber::before { background:#92580a; }
.med-card.color-red::before { background:#b53a3a; }
.med-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-card); }
.med-time {
  font-size:32px; font-weight:700; line-height:1;
  margin-bottom:4px; letter-spacing:-1px;
}
.med-name { font-size:14px; font-weight:600; margin-bottom:2px; }
.med-dosis { font-size:12px; color:var(--text-secondary); margin-bottom:10px; }
.med-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.med-check-btn {
  flex:1; padding:8px 12px; border-radius:8px; border:none; font-size:13px;
  font-weight:500; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px;
  transition:all 0.15s;
}
.med-check-btn.pending { background:var(--bg-secondary); color:var(--text-secondary); border:1px solid var(--border-md); }
.med-check-btn.pending:hover { background:var(--accent-light); color:var(--accent-text); border-color:var(--accent); }
.med-check-btn.taken { background:var(--accent); color:#fff; }
.med-check-btn.taken:hover { background:var(--accent-hover); }
.med-racha { font-size:11px; color:var(--text-tertiary); }
.med-inactive { opacity:0.5; }
.med-hora-tomada { font-size:11px; color:var(--green-text); font-weight:500; }

/* Alert banner */
.med-alert-banner {
  position:fixed; top:0; left:0; right:0; z-index:9999;
  background:var(--accent); color:#fff;
  display:flex; align-items:center; justify-content:center; gap:12px;
  padding:10px 20px; font-size:14px; font-weight:500;
  box-shadow:0 2px 12px rgba(0,0,0,0.2);
  animation:slide-down 0.3s ease;
}
.med-alert-banner.hidden { display:none; }
@keyframes slide-down { from{transform:translateY(-100%)} to{transform:translateY(0)} }
.med-alert-banner button {
  background:rgba(255,255,255,0.25); border:none; border-radius:5px;
  padding:4px 10px; color:#fff; cursor:pointer; font-size:12px;
}
.med-alert-banner button:hover { background:rgba(255,255,255,0.4); }

/* Nav badge */
.nav-badge {
  background:#e05c5c; color:#fff; font-size:10px; font-weight:700;
  border-radius:10px; padding:1px 6px; margin-left:auto;
}
.nav-badge.hidden { display:none; }

/* Turnos */
.turno-card {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:12px; padding:1rem 1.25rem; margin-bottom:10px;
  display:flex; align-items:flex-start; gap:16px;
}
.turno-date {
  background:var(--accent-light); border:1px solid var(--accent);
  border-radius:10px; padding:8px 12px; text-align:center;
  min-width:60px; flex-shrink:0;
}
.turno-date-day { font-size:22px; font-weight:700; color:var(--accent-text); line-height:1; }
.turno-date-mes { font-size:10px; color:var(--accent-text); text-transform:uppercase; font-weight:600; }
.turno-body { flex:1; min-width:0; }
.turno-esp { font-size:14px; font-weight:600; }
.turno-prof { font-size:12px; color:var(--text-secondary); }
.turno-motivo { font-size:12px; color:var(--text-tertiary); margin-top:3px; }
.turno-actions { display:flex; gap:4px; flex-shrink:0; }

/* Análisis */
.ana-row { display:flex; align-items:center; gap:10px; padding:10px 6px; border-bottom:1px solid var(--border); }
.ana-row:last-child { border-bottom:none; }
.ana-icon { width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }

/* Métricas salud */
.metrica-row { display:flex; align-items:center; gap:10px; padding:9px 6px; border-bottom:1px solid var(--border); font-size:13px; }
.metrica-row:last-child { border-bottom:none; }
.metrica-tipo { min-width:150px; font-weight:500; display:flex; align-items:center; gap:6px; }
.metrica-valor { font-size:16px; font-weight:700; color:var(--accent-text); }
.metrica-unidad { font-size:11px; color:var(--text-tertiary); }

/* Deporte tabs */
.dep-panel { display:none; }
.dep-panel.active { display:block; }

/* Bitácora */
.bit-entry {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:10px; padding:1rem 1.25rem; margin-bottom:8px;
  display:flex; gap:14px; align-items:flex-start;
}
.bit-type-icon {
  width:38px; height:38px; border-radius:9px; display:flex; align-items:center;
  justify-content:center; font-size:18px; flex-shrink:0;
}
.bit-cardio { background:var(--amber-bg); color:var(--amber-text); }
.bit-fuerza { background:var(--blue-bg); color:var(--blue-text); }
.bit-tecnica { background:var(--green-bg); color:var(--green-text); }
.bit-flexibilidad { background:var(--purple-bg); color:var(--purple-text); }
.bit-hiit { background:var(--red-bg); color:var(--red-text); }
.bit-otro { background:var(--gray-bg); color:var(--gray-text); }
.bit-body { flex:1; min-width:0; }
.bit-name { font-size:14px; font-weight:600; }
.bit-stats { display:flex; gap:12px; margin-top:5px; flex-wrap:wrap; }
.bit-stat { display:flex; align-items:center; gap:4px; font-size:12px; color:var(--text-secondary); }
.bit-stat i { font-size:13px; color:var(--accent); }
.bit-pace { font-size:11px; color:var(--green-text); font-weight:600; background:var(--green-bg); padding:2px 7px; border-radius:10px; }
.bit-notas-text { font-size:11px; color:var(--text-tertiary); margin-top:4px; font-style:italic; }

/* Finanzas resumen */
.fin-resumen-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:1rem; gap:16px; flex-wrap:wrap; }
.fin-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.fin-historial-row { display:flex; align-items:center; justify-content:space-between; padding:9px 6px; border-bottom:1px solid var(--border); font-size:13px; }
.fin-historial-row:last-child { border-bottom:none; }

/* Settings */
.settings-section { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:1rem 1.25rem; margin-bottom:1rem; }
.settings-title { font-size:11px; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:0.05em; margin-bottom:1rem; }
.theme-picker { display:flex; gap:10px; flex-wrap:wrap; }
.theme-btn { display:flex; align-items:center; gap:8px; padding:8px 16px; border-radius:8px; border:2px solid var(--border-md); background:var(--bg-secondary); font-size:13px; cursor:pointer; transition:all 0.12s; }
.theme-btn:hover { border-color:var(--accent); }
.theme-btn.active { border-color:var(--accent); background:var(--accent-light); color:var(--accent-text); font-weight:500; }
.theme-dot { width:16px; height:16px; border-radius:50%; border:2px solid rgba(0,0,0,0.1); }
.td-claro { background:linear-gradient(135deg,#fff 50%,#2d7a4f 50%); }
.td-oscuro { background:linear-gradient(135deg,#1a2420 50%,#3dba70 50%); }

/* ── ANIMACIONES ──────────────────────────────────────────────────────────────── */
/* Page transitions */
.page { animation: pageFadeIn 0.22s ease; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Metric cards entrance */
.metric-card {
  animation: cardPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes cardPop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.metric-card:nth-child(1) { animation-delay: 0.00s; }
.metric-card:nth-child(2) { animation-delay: 0.05s; }
.metric-card:nth-child(3) { animation-delay: 0.10s; }
.metric-card:nth-child(4) { animation-delay: 0.15s; }
.metric-card:nth-child(5) { animation-delay: 0.20s; }
.metric-card:nth-child(6) { animation-delay: 0.25s; }

/* Progress bar animated fill */
.progress-fill {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Button ripple effect */
.btn-primary, .btn-secondary {
  position: relative; overflow: hidden;
}
.btn-primary::after, .btn-secondary::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.3);
  opacity: 0; border-radius: inherit;
  transition: opacity 0.15s;
}
.btn-primary:active::after, .btn-secondary:active::after { opacity: 1; }

/* Input focus ring */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(45,122,79,0.15);
  transform: none;
}

/* Input validation error */
.input-error {
  border-color: var(--red-text) !important;
  box-shadow: 0 0 0 3px rgba(176,58,58,0.15) !important;
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%,100%{ transform:translateX(0); }
  25%     { transform:translateX(-5px); }
  75%     { transform:translateX(5px); }
}

/* Row item hover smooth */
.row-item { transition: background 0.12s; }
.row-item:hover { background: var(--bg-hover); }

/* Toast improved */
.toast { animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.8); }
  to   { opacity: 1; transform: translateX(0)   scale(1); }
}

/* Sidebar nav hover effect */
.nav-item { transition: all 0.12s ease; }
.nav-item:hover { transform: translateX(3px); }
.nav-item.active { transform: translateX(0); }

/* Med card hover */
.med-card { transition: all 0.18s cubic-bezier(0.4,0,0.2,1); }
.med-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

/* Bitácora entry hover */
.bit-entry { transition: transform .12s ease; }
.bit-entry:hover { border-color: var(--border-md); transform: translateX(3px); }

/* Habit day hover */
.habit-day { transition: all 0.12s; }
.habit-day:not(.done):hover { background: var(--accent-light); color: var(--accent-text); transform: scale(1.05); }

/* Turno card hover */
.turno-card { transition: all 0.15s; }
.turno-card:hover { border-color: var(--accent); }

/* ── PERFIL ────────────────────────────────────────────────────────────────── */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 8px; 
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
}
.user-avatar-wrap {
  position: relative; flex-shrink: 0;
}
.user-avatar-wrap img.avatar-img {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,0.3);
  display: block;
}
.user-role {
  display: block; font-size: 10px; opacity: 0.55;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.collapsed .user-role, .collapsed .user-name { display: none; }

/* Config foto */
.cfg-perfil-grid { display: flex; gap: 24px; align-items: flex-start; }
.cfg-foto-section {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; min-width: 110px;
}
.cfg-foto-preview {
  width: 90px; height: 90px; border-radius: 50%;
  border: 3px solid var(--accent); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.cfg-foto-preview img {
  width: 100%; height: 100%; object-fit: cover;
}

/* ── TURNOS: HISTORIAL + FRECUENCIA ──────────────────────────────────────── */
.turno-frecuencia-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-bg); color: var(--green-text);
  border-radius: 6px; padding: 2px 8px; font-size: 10px; font-weight: 600;
}
.btn-completar {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--accent); color: #fff;
  border: none; border-radius: 7px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.12s;
}
.btn-completar:hover { background: var(--accent-hover); transform: scale(1.02); }
.historial-turno-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.historial-turno-item:last-child { border-bottom: none; }

/* ── ARQUERÍA ─────────────────────────────────────────────────────────────── */
.bit-arco-stats {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px;
}
.bit-arco-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-bg); color: var(--green-text);
  border-radius: 8px; padding: 3px 9px; font-size: 12px; font-weight: 600;
}
.bit-arco-badge.puntaje { background: var(--amber-bg); color: var(--amber-text); }
.bit-distancias-text {
  font-size: 11px; color: var(--text-secondary);
  margin-top: 3px; font-family: monospace;
  background: var(--bg-secondary); padding: 3px 8px;
  border-radius: 5px; display: inline-block;
}

/* Count-up animation for metric values */
.metric-value { transition: opacity 0.2s; }
.metric-value.counting { opacity: 0.6; }

/* Scroll to top button */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: all 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 100;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-2px); }

/* ── SALUD BITÁCORA ────────────────────────────────────────────────────────── */
.sb-row-label { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; margin-bottom:4px; }
.sb-emoji { font-size:22px; line-height:1; }
.sb-val { font-size:14px; font-weight:700; color:var(--accent-text); background:var(--accent-light); padding:2px 8px; border-radius:20px; min-width:28px; text-align:center; }
.sb-slider { width:100%; height:6px; border-radius:10px; -webkit-appearance:none; appearance:none; outline:none; cursor:pointer; }
.sb-slider.sb-slider-green { background:linear-gradient(to right,#e74c3c,#e67e22,#2ecc71); }
.sb-slider.sb-slider-amber { background:linear-gradient(to right,#bdc3c7,#f39c12,#e74c3c); }
.sb-slider::-webkit-slider-thumb { -webkit-appearance:none; width:20px; height:20px; border-radius:50%; background:var(--accent); border:2px solid #fff; cursor:pointer; box-shadow:0 2px 6px rgba(0,0,0,0.2); transition:transform 0.1s; }
.sb-slider::-webkit-slider-thumb:hover { transform:scale(1.2); }

.symptom-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.chip { display:inline-flex; align-items:center; gap:4px; padding:5px 12px; border-radius:20px; font-size:12px; font-weight:500; background:var(--bg-secondary); border:1.5px solid var(--border-md); cursor:pointer; transition:all 0.15s; user-select:none; }
.chip:hover { border-color:var(--accent); color:var(--accent-text); }
.chip.active { background:var(--accent-light); border-color:var(--accent); color:var(--accent-text); transform:scale(1.04); }

/* Timeline bitácora salud */
.sb-timeline-entry { display:flex; gap:14px; padding:12px 6px; border-bottom:1px solid var(--border); position:relative; }
.sb-timeline-entry:last-child { border-bottom:none; }
.sb-timeline-line { position:absolute; left:22px; top:36px; bottom:0; width:2px; background:var(--border); }
.sb-timeline-dot { width:12px; height:12px; border-radius:50%; border:2px solid var(--accent); background:var(--bg-card); flex-shrink:0; margin-top:4px; }
.sb-timeline-body { flex:1; min-width:0; }
.sb-timeline-date { font-size:11px; font-weight:600; color:var(--text-secondary); margin-bottom:4px; }
.sb-mood-bar { display:flex; gap:3px; align-items:center; margin:4px 0; }
.sb-mood-dot { width:8px; height:8px; border-radius:50%; }
.sb-sintomas-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.sb-sintoma { font-size:10px; padding:2px 7px; border-radius:8px; background:var(--bg-secondary); color:var(--text-secondary); }

/* ── BITÁCORA DEPORTE DINÁMICO ──────────────────────────────────────────────── */
.bit-dynamic-form { background:var(--bg-secondary); border-radius:10px; padding:12px; margin-top:8px; border:1px solid var(--border); animation:fadeIn 0.2s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.pace-preview { display:flex; align-items:center; gap:8px; margin-top:8px; padding:8px 12px; background:var(--green-bg); border-radius:8px; font-size:13px; font-weight:500; color:var(--green-text); border:1px solid var(--accent); }
.pace-preview.hidden { display:none; }
.smartwatch-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; }
.sw-hr { background:#ffe0de; color:#c0392b; }
.sw-cal { background:#fff3cd; color:#856404; }

/* ── QUICK ADD FAB ────────────────────────────────────────────────────────── */
.fab { position:fixed; bottom:28px; right:28px; width:52px; height:52px; border-radius:50%; background:var(--accent); color:#fff; border:none; font-size:24px; display:flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:0 4px 20px rgba(45,122,79,0.4); z-index:200; transition:all 0.2s cubic-bezier(0.34,1.56,0.64,1); }
.fab:hover { transform:scale(1.12) rotate(45deg); box-shadow:0 6px 28px rgba(45,122,79,0.5); }
.fab:active { transform:scale(0.95) rotate(45deg); }
.quick-add-tabs { display:flex; gap:0; border-bottom:1px solid var(--border); margin:-1.2rem -1.2rem 1rem; }
.quick-add-tab { flex:1; padding:10px; font-size:13px; font-weight:500; text-align:center; border:none; background:transparent; cursor:pointer; color:var(--text-secondary); border-bottom:2px solid transparent; transition:all 0.15s; }
.quick-add-tab.active { color:var(--accent-text); border-bottom-color:var(--accent); background:var(--accent-light); }
.quick-add-panel { display:none; }
.quick-add-panel.active { display:block; }

/* ── WEEKLY SUMMARY ───────────────────────────────────────────────────────── */
.modal-weekly { max-width:560px; }
.weekly-stats-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; margin-bottom:16px; }
.weekly-stat { background:var(--bg-secondary); border-radius:10px; padding:12px; text-align:center; }
.weekly-stat-val { font-size:24px; font-weight:700; color:var(--accent-text); }
.weekly-stat-lbl { font-size:11px; color:var(--text-secondary); margin-top:2px; }
.habit-week-row { display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid var(--border); font-size:13px; }
.habit-week-row:last-child { border-bottom:none; }
.habit-dots { display:flex; gap:3px; }
.habit-dot { width:10px; height:10px; border-radius:50%; background:var(--border-md); transition:background 0.2s; }
.habit-dot.done { background:var(--accent); }
.habit-dot.today { ring:2px solid var(--accent); }
.weekly-section-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-secondary); margin:14px 0 8px; }

/* ── CALENDARIO MAESTRO ───────────────────────────────────────────────────── */
.cal-leyenda { display:flex; gap:12px; padding:0 0 10px; flex-wrap:wrap; }
.cal-ley-item { display:flex; align-items:center; gap:4px; font-size:11px; color:var(--text-secondary); }
.cal-ley-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.cal-event.ce-turno { background:#ffe0de; color:#922b21; border-left:3px solid #e74c3c; }
.cal-event.ce-tarea { background:#fff3cd; color:#7d6608; border-left:3px solid #f39c12; }
.cal-event.ce-actividad { background:var(--green-bg); color:var(--green-text); font-size:9px; padding:1px 4px; }
[data-theme="oscuro"] .cal-event.ce-turno { background:#3d1a19; color:#f1948a; }
[data-theme="oscuro"] .cal-event.ce-tarea { background:#3d3019; color:#f0b27a; }

/* ── METAS CON PROYECTOS VINCULADOS ─────────────────────────────────────── */
.meta-proyectos { margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }
.meta-proyectos-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-secondary); margin-bottom:6px; }
.meta-proyecto-row { display:flex; align-items:center; gap:8px; font-size:12px; padding:4px 0; }
.meta-proyecto-bar { flex:1; height:4px; background:var(--border-md); border-radius:2px; overflow:hidden; }
.meta-proyecto-fill { height:100%; background:var(--accent); border-radius:2px; transition:width 0.4s; }

/* ── DASHBOARD FOCUS + HABITS 7D ─────────────────────────────────────────── */
.focus-bar-wrap { margin:12px 0; }
.focus-bar-label { display:flex; justify-content:space-between; font-size:12px; color:var(--text-secondary); margin-bottom:5px; }
.focus-bar { height:12px; background:var(--border-md); border-radius:6px; overflow:hidden; }
.focus-bar-fill { height:100%; background:linear-gradient(90deg,var(--accent),#3dba70); border-radius:6px; transition:width 0.8s cubic-bezier(0.4,0,0.2,1); }
.focus-score { font-size:36px; font-weight:800; color:var(--accent-text); line-height:1; }
.focus-score-sub { font-size:12px; color:var(--text-secondary); margin-top:2px; }
.habit7-row { display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--border); font-size:13px; }
.habit7-row:last-child { border-bottom:none; }
.habit7-name { min-width:140px; display:flex; align-items:center; gap:6px; font-weight:500; }
.habit7-dots { display:flex; gap:4px; margin-left:auto; }
.h7d { width:12px; height:12px; border-radius:50%; background:var(--border-md); position:relative; }
.h7d.done { background:var(--accent); }
.h7d.today { box-shadow:0 0 0 2px var(--accent); }
.habit7-racha { font-size:11px; color:var(--green-text); min-width:32px; text-align:right; }

/* ── ANIMACIONES PREMIUM ────────────────────────────────────────────────────── */
/* Page fade-slide */
.page { animation:pageFadeIn 0.25s cubic-bezier(0.4,0,0.2,1) both; }
@keyframes pageFadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* Cards entrada escalonada */
.metrics-grid .metric-card { animation:cardPop 0.3s cubic-bezier(0.34,1.56,0.64,1) both; }
.metrics-grid .metric-card:nth-child(1){animation-delay:.00s}
.metrics-grid .metric-card:nth-child(2){animation-delay:.06s}
.metrics-grid .metric-card:nth-child(3){animation-delay:.12s}
.metrics-grid .metric-card:nth-child(4){animation-delay:.18s}
.metrics-grid .metric-card:nth-child(5){animation-delay:.24s}
.metrics-grid .metric-card:nth-child(6){animation-delay:.30s}
@keyframes cardPop { from{opacity:0;transform:scale(0.88) translateY(14px)} to{opacity:1;transform:scale(1) translateY(0)} }

/* Checkbox completion animation */
.checkbox.completing { animation:checkBounce 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes checkBounce { 0%{transform:scale(1)} 40%{transform:scale(1.3)} 70%{transform:scale(0.9)} 100%{transform:scale(1)} }
.text-done { text-decoration:line-through; color:var(--text-tertiary); transition:all 0.3s; }

/* Button ripple */
.btn-primary,.btn-secondary { position:relative; overflow:hidden; }
.btn-ripple { position:absolute; border-radius:50%; background:rgba(255,255,255,0.35); transform:scale(0); animation:ripple 0.5s linear; pointer-events:none; }
@keyframes ripple { to{transform:scale(4);opacity:0} }

/* Input focus ring */
input:focus,select:focus,textarea:focus { outline:none; border-color:var(--accent)!important; box-shadow:0 0 0 3px rgba(45,122,79,0.15); }
.input-error { border-color:var(--red-text)!important; box-shadow:0 0 0 3px rgba(176,58,58,0.15)!important; animation:shake 0.35s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* Row hover smooth */
.row-item { transition:background 0.12s; border-radius:8px; }
.row-item:hover { background:var(--bg-hover); }

/* Nav item slide */
.nav-item { transition:all 0.12s ease; }
.nav-item:hover { transform:translateX(3px); }
.nav-item.active { transform:translateX(0); }

/* Progress bar animated */
.progress-fill { transition:width 0.7s cubic-bezier(0.4,0,0.2,1); }

/* Toast premium */
.toast { animation:toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes toastIn { from{opacity:0;transform:translateX(110%) scale(0.8)} to{opacity:1;transform:translateX(0) scale(1)} }

/* Med card hover */
.med-card:hover { transform:translateY(-3px); box-shadow:0 10px 28px rgba(0,0,0,0.12); }

/* Habit day */
.habit-day { transition:all 0.12s; }
.habit-day:not(.done):hover { background:var(--accent-light); color:var(--accent-text); transform:scale(1.08); }

/* ── FOTO DE PERFIL ────────────────────────────────────────────────────────── */
.sidebar-user { display:flex; align-items:center; gap:10px; padding:10px 14px; margin:8px; border-radius:10px; background:rgba(255,255,255,0.07); }
.user-avatar-wrap { position:relative; flex-shrink:0; }
.user-avatar-wrap img.avatar-img { width:38px; height:38px; border-radius:50%; object-fit:cover; border:2px solid rgba(255,255,255,0.3); display:block; }
.user-role { display:block; font-size:10px; opacity:0.55; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.collapsed .user-role,.collapsed .user-name { display:none; }
.cfg-perfil-grid { display:flex; gap:24px; align-items:flex-start; }
.cfg-foto-section { display:flex; flex-direction:column; align-items:center; gap:8px; min-width:110px; }
.cfg-foto-preview { width:90px; height:90px; border-radius:50%; border:3px solid var(--accent); overflow:hidden; display:flex; align-items:center; justify-content:center; background:var(--bg-secondary); box-shadow:0 4px 16px rgba(0,0,0,0.15); }
.cfg-foto-preview img { width:100%; height:100%; object-fit:cover; }

/* ── SETTINGS ──────────────────────────────────────────────────────────────── */
.settings-section { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:1rem 1.25rem; margin-bottom:1rem; }
.settings-title { font-size:11px; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.05em; margin-bottom:1rem; }
.theme-picker { display:flex; gap:10px; flex-wrap:wrap; }
.theme-btn { display:flex; align-items:center; gap:8px; padding:8px 16px; border-radius:8px; border:2px solid var(--border-md); background:var(--bg-secondary); font-size:13px; cursor:pointer; transition:all 0.12s; }
.theme-btn:hover,.theme-btn.active { border-color:var(--accent); background:var(--accent-light); color:var(--accent-text); font-weight:500; }
.theme-dot { width:16px; height:16px; border-radius:50%; border:2px solid rgba(0,0,0,0.1); }
.td-claro { background:linear-gradient(135deg,#fff 50%,#2d7a4f 50%); }
.td-oscuro { background:linear-gradient(135deg,#1a2420 50%,#3dba70 50%); }

/* ── SALUD TABS, TURNOS, ANÁLISIS ─────────────────────────────────────────── */
.salud-tabs { display:flex; gap:6px; margin-bottom:1rem; flex-wrap:wrap; }
.salud-tab { display:flex; align-items:center; gap:7px; padding:9px 18px; background:var(--bg-secondary); border:1px solid var(--border-md); border-radius:9px; font-size:13px; color:var(--text-secondary); cursor:pointer; transition:all 0.12s; font-weight:500; }
.salud-tab i { font-size:17px; }
.salud-tab:hover { background:var(--bg-hover); color:var(--text); }
.salud-tab.active { background:var(--accent-light); color:var(--accent-text); border-color:var(--accent); }
.salud-panel { display:none; }
.salud-panel.active { display:block; }
.med-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; }
.med-card { background:var(--bg-card); border:1px solid var(--border); border-radius:14px; padding:1.1rem 1.25rem; transition:all 0.18s; position:relative; overflow:hidden; }
.med-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; border-radius:14px 0 0 14px; }
.med-card.color-blue::before{background:#185FA5}.med-card.color-green::before{background:var(--accent)}.med-card.color-purple::before{background:#5440cc}.med-card.color-amber::before{background:#92580a}.med-card.color-red::before{background:#b53a3a}
.med-time { font-size:32px; font-weight:700; line-height:1; margin-bottom:4px; letter-spacing:-1px; }
.med-name { font-size:14px; font-weight:600; margin-bottom:2px; }
.med-dosis { font-size:12px; color:var(--text-secondary); margin-bottom:10px; }
.med-check-btn { flex:1; padding:8px 12px; border-radius:8px; border:none; font-size:13px; font-weight:500; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; transition:all 0.15s; }
.med-check-btn.pending { background:var(--bg-secondary); color:var(--text-secondary); border:1px solid var(--border-md); }
.med-check-btn.pending:hover { background:var(--accent-light); color:var(--accent-text); border-color:var(--accent); }
.med-check-btn.taken { background:var(--accent); color:#fff; }
.turno-card { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:1rem 1.25rem; margin-bottom:10px; display:flex; align-items:flex-start; gap:16px; transition:all 0.15s; }
.turno-card:hover { border-color:var(--accent); }
.turno-date { background:var(--accent-light); border:1px solid var(--accent); border-radius:10px; padding:8px 12px; text-align:center; min-width:60px; flex-shrink:0; }
.turno-date-day { font-size:22px; font-weight:700; color:var(--accent-text); line-height:1; }
.turno-date-mes { font-size:10px; color:var(--accent-text); text-transform:uppercase; font-weight:600; }
.turno-frecuencia-badge { display:inline-flex; align-items:center; gap:4px; background:var(--green-bg); color:var(--green-text); border-radius:6px; padding:2px 8px; font-size:10px; font-weight:600; }
.btn-completar { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; background:var(--accent); color:#fff; border:none; border-radius:7px; font-size:12px; font-weight:500; cursor:pointer; transition:all 0.12s; }
.btn-completar:hover { background:var(--accent-hover); transform:scale(1.02); }
.historial-turno-item { display:flex; align-items:center; gap:8px; font-size:12px; padding:6px 0; border-bottom:1px solid var(--border); color:var(--text-secondary); }
.historial-turno-item:last-child { border-bottom:none; }
.ana-row { display:flex; align-items:center; gap:10px; padding:10px 6px; border-bottom:1px solid var(--border); }
.ana-row:last-child { border-bottom:none; }
.ana-icon { width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.metrica-row { display:flex; align-items:center; gap:10px; padding:9px 6px; border-bottom:1px solid var(--border); font-size:13px; }
.metrica-row:last-child { border-bottom:none; }
.metrica-valor { font-size:16px; font-weight:700; color:var(--accent-text); }

/* ── DEPORTE BITÁCORA ────────────────────────────────────────────────────── */
.dep-panel { display:none; }
.dep-panel.active { display:block; }
.bit-entry { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:1rem 1.25rem; margin-bottom:8px; display:flex; gap:14px; align-items:flex-start; }
.bit-type-icon { width:38px; height:38px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.bit-cardio{background:var(--amber-bg);color:var(--amber-text)}.bit-fuerza{background:var(--blue-bg);color:var(--blue-text)}.bit-tecnica{background:var(--green-bg);color:var(--green-text)}.bit-flexibilidad{background:var(--purple-bg);color:var(--purple-text)}.bit-hiit{background:var(--red-bg);color:var(--red-text)}.bit-otro{background:var(--gray-bg);color:var(--gray-text)}
.bit-body { flex:1; min-width:0; }
.bit-name { font-size:14px; font-weight:600; }
.bit-stats { display:flex; gap:10px; margin-top:5px; flex-wrap:wrap; }
.bit-stat { display:flex; align-items:center; gap:4px; font-size:12px; color:var(--text-secondary); }
.bit-stat i { font-size:13px; color:var(--accent); }
.bit-pace { font-size:11px; color:var(--green-text); font-weight:600; background:var(--green-bg); padding:2px 7px; border-radius:10px; }
.bit-arco-badge { display:inline-flex; align-items:center; gap:4px; background:var(--green-bg); color:var(--green-text); border-radius:8px; padding:3px 9px; font-size:12px; font-weight:600; }
.bit-arco-badge.puntaje { background:var(--amber-bg); color:var(--amber-text); }
.bit-distancias-text { font-size:11px; color:var(--text-secondary); margin-top:3px; font-family:monospace; background:var(--bg-secondary); padding:3px 8px; border-radius:5px; display:inline-block; }

/* ── FINANZAS ─────────────────────────────────────────────────────────────── */
.fin-resumen-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:1rem; gap:16px; flex-wrap:wrap; }
.fin-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.fin-historial-row { display:flex; align-items:center; justify-content:space-between; padding:9px 6px; border-bottom:1px solid var(--border); font-size:13px; }
.fin-historial-row:last-child { border-bottom:none; }

/* ── NAV BADGE ────────────────────────────────────────────────────────────── */
.nav-badge { background:#e05c5c; color:#fff; font-size:10px; font-weight:700; border-radius:10px; padding:1px 6px; margin-left:auto; }
.nav-badge.hidden { display:none; }

/* ── MED ALERT BANNER ────────────────────────────────────────────────────── */
.med-alert-banner { position:fixed; top:0; left:0; right:0; z-index:9999; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; gap:12px; padding:10px 20px; font-size:14px; font-weight:500; box-shadow:0 2px 12px rgba(0,0,0,0.2); animation:slide-down 0.3s ease; }
.med-alert-banner.hidden { display:none; }
@keyframes slide-down { from{transform:translateY(-100%)} to{transform:translateY(0)} }
.med-alert-banner button { background:rgba(255,255,255,0.25); border:none; border-radius:5px; padding:4px 10px; color:#fff; cursor:pointer; font-size:12px; }

/* ══════════════════════════════════════════════════════════════════════
   LIFE HUB v2.3 — NUEVOS ESTILOS
   ══════════════════════════════════════════════════════════════════════ */

/* ── FAB ──────────────────────────────────────────────────────────────── */
/* fab consolidated */
#fab:hover { transform:scale(1.12) rotate(90deg); box-shadow:0 6px 28px rgba(45,122,79,0.55); }
#fab:active { transform:scale(0.95); }

/* ── QUICK ADD MODAL ──────────────────────────────────────────────────── */
.qa-modal { max-width:460px; }
.qa-tabs { display:flex; gap:6px; margin-bottom:16px; padding:4px; background:var(--bg-secondary); border-radius:10px; }
.qa-tab {
  flex:1; padding:8px; border:none; border-radius:8px; font-size:13px;
  background:transparent; color:var(--text-secondary); cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:6px; font-weight:500;
  transition:all 0.15s;
}
.qa-tab.active { background:var(--bg-card); color:var(--accent-text); box-shadow:var(--shadow); }
.qa-panel { display:none; }
.qa-panel.active { display:block; }
.qa-input { font-size:16px !important; padding:12px !important; }

/* ── WEEKLY SUMMARY MODAL ─────────────────────────────────────────────── */
.weekly-modal {
  max-width:520px; border-top:4px solid var(--accent);
}
.weekly-header {
  text-align:center; padding-bottom:1.25rem;
  border-bottom:1px solid var(--border); margin-bottom:1.25rem;
}
.weekly-emoji { font-size:48px; margin-bottom:8px; }
.weekly-header h2 { font-size:20px; font-weight:700; color:var(--accent-text); }
.weekly-stats-grid {
  display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px;
}
.weekly-stat {
  background:var(--bg-secondary); border-radius:12px;
  padding:12px 16px; text-align:center;
}
.weekly-stat-val { font-size:26px; font-weight:700; color:var(--accent-text); }
.weekly-stat-label { font-size:11px; color:var(--text-secondary); margin-top:2px; }
.weekly-habits-list { display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.weekly-habit-row { display:flex; align-items:center; gap:8px; font-size:13px; }
.weekly-habit-dots { display:flex; gap:3px; }
.wh-dot { width:8px; height:8px; border-radius:50%; }
.wh-dot.done { background:var(--accent); }
.wh-dot.miss { background:var(--border-md); }

/* ── DASHBOARD VISUAL ─────────────────────────────────────────────────── */
.dash-focus-row { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
@media(max-width:700px){ .dash-focus-row { grid-template-columns:1fr; } }
.focus-card { padding:1.25rem; background:var(--bg-card); border:1px solid var(--border); border-top:3px solid var(--accent); position:relative; }
.focus-card::before { content:none; }
.focus-title { font-size:12px; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.05em; margin-bottom:.75rem; }
.focus-bar-wrap { background:var(--bg-secondary); border-radius:99px; height:10px; overflow:hidden; }
.focus-bar-fill { height:100%; background:var(--accent); border-radius:99px; transition:width .8s cubic-bezier(.4,0,.2,1); }
.focus-pct { font-size:28px; font-weight:700; color:var(--accent-text); margin-top:6px; }
.focus-sub { font-size:11px; color:var(--text-secondary); }

/* Habit streak dots */
.habit-streak-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 4px; border-bottom:1px solid var(--border);
}
.habit-streak-row:last-child { border-bottom:none; }
.hsr-name { font-size:13px; font-weight:500; flex:1; display:flex; align-items:center; gap:6px; }
.hsr-dots { display:flex; gap:4px; }
.hsr-dot {
  width:10px; height:10px; border-radius:50%;
  transition:transform .15s;
}
.hsr-dot.done { background:var(--accent); }
.hsr-dot.miss { background:var(--border-md); }
.hsr-dot.today-done { background:var(--accent); box-shadow:0 0 0 2px rgba(45,122,79,0.3); transform:scale(1.2); }
.hsr-dot.today-miss { background:var(--border-md); border:1.5px solid var(--accent); }
.hsr-racha { font-size:11px; color:var(--accent-text); font-weight:600; min-width:40px; text-align:right; }

/* Financial health widget */
.fin-health-widget { padding:1.25rem; }
.fin-health-bar { background:var(--bg-secondary); border-radius:99px; height:12px; overflow:hidden; margin:8px 0; }
.fin-health-fill { height:100%; border-radius:99px; transition:width .8s cubic-bezier(.4,0,.2,1); }
.fin-health-ok { background:var(--accent); }
.fin-health-warn { background:#e89c0e; }
.fin-health-danger { background:#b53a3a; }

/* ── SALUD BITÁCORA ───────────────────────────────────────────────────── */
.salud-bit-form { padding:4px 0; }
.mood-row { display:flex; gap:16px; flex-wrap:wrap; margin-top:12px; }
.mood-group { flex:1; min-width:180px; }
.mood-group label { font-size:12px; font-weight:500; color:var(--text-secondary); display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.mood-emoji { font-size:18px; }
.mood-slider { width:100%; accent-color:var(--accent); cursor:pointer; }
.mood-slider.energy { accent-color:#e89c0e; }
.mood-scale-labels { display:flex; justify-content:space-between; font-size:10px; color:var(--text-muted); margin-top:3px; }

/* Bitácora salud timeline */
.bsalud-entry {
  display:flex; gap:12px; align-items:flex-start;
  padding:12px 6px; border-bottom:1px solid var(--border);
}
.bsalud-entry:last-child { border-bottom:none; }
.bsalud-mood-circle {
  width:44px; height:44px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:22px; font-weight:700; color:#fff;
}
.bsalud-body { flex:1; min-width:0; }
.bsalud-fecha { font-size:11px; color:var(--text-muted); }
.bsalud-indicators { display:flex; gap:8px; margin-top:4px; flex-wrap:wrap; }
.bsalud-ind { font-size:11px; padding:2px 8px; border-radius:10px; }
.bsalud-sintomas { font-size:11px; color:var(--red-text); background:var(--red-bg); padding:3px 8px; border-radius:8px; margin-top:4px; display:inline-block; }
.bsalud-notas-text { font-size:12px; color:var(--text-secondary); margin-top:4px; font-style:italic; }

/* ── DEPORTE DYNAMIC FIELDS ───────────────────────────────────────────── */
.bit-dynamic-fields {
  background:var(--bg-secondary); border-radius:10px;
  padding:12px 14px; margin-top:10px;
  border-left:3px solid var(--accent);
  animation:fadeInDown .2s ease;
}
.bit-dynamic-fields.hidden { display:none; }
@keyframes fadeInDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.dynamic-fields-title {
  font-size:11px; font-weight:600; color:var(--accent-text);
  text-transform:uppercase; letter-spacing:.05em;
  margin-bottom:8px; margin-top:6px;
  display:flex; align-items:center; gap:5px;
}
.dynamic-fields-title:first-child { margin-top:0; }

/* ── CALENDARIO UNIFICADO ─────────────────────────────────────────────── */
.cal-legend { display:flex; gap:12px; flex-wrap:wrap; padding:0 4px 12px; }
.cal-leg-item { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-secondary); }
.cal-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.ce-evento { background:var(--accent); }
.ce-tarea { background:#1e5fa0; }
.ce-turno { background:#b53a3a; }
.ce-deporte { background:#92580a; }
.ce-estudio { background:#5440cc; }
.ce-tarea_done { background:var(--border-md); }

/* Cal items improvements */
.cal-event { padding:2px 5px; border-radius:4px; font-size:10px; margin-top:2px; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#fff; font-weight:500; transition:opacity .12s; }
.cal-event:hover { opacity:.85; }
.ce-evento.cal-event { background:var(--accent); }
.ce-tarea.cal-event { background:#1e5fa0; }
.ce-turno.cal-event { background:#b53a3a; }
.ce-deporte.cal-event { background:#92580a; font-size:9px; }
.ce-estudio.cal-event { background:#5440cc; font-size:9px; }
.ce-tarea_done.cal-event { background:var(--border-md); color:var(--text-secondary); text-decoration:line-through; }

/* ── MICRO-INTERACCIONES ──────────────────────────────────────────────── */
/* Checkbox completion effect */
.checkbox { position:relative; overflow:hidden; }
.checkbox.completing::after {
  content:''; position:absolute; inset:0;
  background:var(--accent); border-radius:inherit;
  animation:checkPop .3s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes checkPop { 0%{transform:scale(0);opacity:0} 100%{transform:scale(1);opacity:1} }

/* Row item done style */
.text-done { text-decoration:line-through; opacity:.5; transition:all .3s; }

/* Habit day done animation */
.habit-day.done {
  background:var(--accent); color:#fff;
  transform:scale(1); transition:all .25s cubic-bezier(.34,1.56,.64,1);
}
.habit-day.done.just-toggled { animation:habitBounce .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes habitBounce { 0%{transform:scale(.6)} 60%{transform:scale(1.2)} 100%{transform:scale(1)} }

/* ── PROYECTOS CON JERARQUÍA ──────────────────────────────────────────── */
.proyecto-meta-link {
  display:inline-flex; align-items:center; gap:4px;
  font-size:11px; color:var(--accent-text); background:var(--green-bg);
  border-radius:6px; padding:2px 8px; margin-top:4px;
}

/* ── PAGE TRANSITIONS MEJORADAS ──────────────────────────────────────── */
.page {
  animation:pageReveal .25s cubic-bezier(.4,0,.2,1) both;
}
@keyframes pageReveal {
  from { opacity:0; transform:translateY(12px) scale(.99); }
  to   { opacity:1; transform:translateY(0)    scale(1); }
}

/* ── VALIDACIÓN ───────────────────────────────────────────────────────── */
.input-error {
  border-color:var(--red-text) !important;
  box-shadow:0 0 0 3px rgba(181,58,58,.15) !important;
  animation:shakeInput .35s ease;
}
@keyframes shakeInput { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* ── METRIC CARDS ANIMADAS ────────────────────────────────────────────── */
.metric-card { animation:cardIn .3s cubic-bezier(.34,1.56,.64,1) both; }
.metric-card:nth-child(1){animation-delay:.02s}.metric-card:nth-child(2){animation-delay:.06s}
.metric-card:nth-child(3){animation-delay:.10s}.metric-card:nth-child(4){animation-delay:.14s}
.metric-card:nth-child(5){animation-delay:.18s}.metric-card:nth-child(6){animation-delay:.22s}
@keyframes cardIn { from{opacity:0;transform:translateY(16px) scale(.94)} to{opacity:1;transform:none} }

/* Progress bar smooth fill */
.progress-fill { transition:width .7s cubic-bezier(.4,0,.2,1); }

/* Med card hover elevation */
.med-card { transition:all .2s cubic-bezier(.4,0,.2,1); }
.med-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.12); }

/* Nav item slide */
.nav-item { transition:all .15s ease; }
.nav-item:not(.active):hover { transform:translateX(3px); }

/* Button hover lift */
.btn-primary { transition:all .15s; }
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(45,122,79,.3); }
.btn-primary:active { transform:translateY(0); }

/* Turno recurring badge */
.turno-frecuencia-badge { display:inline-flex;align-items:center;gap:3px;background:var(--green-bg);color:var(--green-text);border-radius:6px;padding:2px 7px;font-size:10px;font-weight:600; }
.btn-completar { display:inline-flex;align-items:center;gap:5px;padding:5px 12px;background:var(--accent);color:#fff;border:none;border-radius:7px;font-size:12px;font-weight:500;cursor:pointer;transition:all .12s; }
.btn-completar:hover { background:var(--accent-hover); }
.historial-turno-item { display:flex;align-items:center;gap:8px;font-size:12px;padding:6px 0;border-bottom:1px solid var(--border);color:var(--text-secondary); }
.historial-turno-item:last-child{border-bottom:none;}

/* ── SETTINGS ─────────────────────────────────────────────────────────── */
.cfg-perfil-grid { display:flex;gap:24px;align-items:flex-start; }
.cfg-foto-section { display:flex;flex-direction:column;align-items:center;gap:8px;min-width:110px; }
.cfg-foto-preview { width:90px;height:90px;border-radius:50%;border:3px solid var(--accent);overflow:hidden;display:flex;align-items:center;justify-content:center;background:var(--bg-secondary); }
.cfg-foto-preview img { width:100%;height:100%;object-fit:cover; }
.settings-section{background:var(--bg-card);border:1px solid var(--border);border-radius:12px;padding:1rem 1.25rem;margin-bottom:1rem;}
.settings-title{font-size:11px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.05em;margin-bottom:1rem;}
.theme-picker{display:flex;gap:10px;flex-wrap:wrap;}
.theme-btn{display:flex;align-items:center;gap:8px;padding:8px 16px;border-radius:8px;border:2px solid var(--border-md);background:var(--bg-secondary);font-size:13px;cursor:pointer;transition:all .12s;}
.theme-btn:hover{border-color:var(--accent);}
.theme-btn.active{border-color:var(--accent);background:var(--accent-light);color:var(--accent-text);font-weight:500;}
.theme-dot{width:16px;height:16px;border-radius:50%;border:2px solid rgba(0,0,0,.1);}
.td-claro{background:linear-gradient(135deg,#fff 50%,#2d7a4f 50%);}
.td-oscuro{background:linear-gradient(135deg,#1a2420 50%,#3dba70 50%);}

/* ═══════════════════════════════════════════════════════════════════
   LIFE HUB v2.2 — Additions: Animations, new components, fixes
   ═══════════════════════════════════════════════════════════════════ */

/* ── PAGE TRANSITIONS ───────────────────────────────────────────── */
@keyframes fadeInPage {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes slideInToast {
  from { opacity:0; transform:translateX(110%); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes checkBounce {
  0%  { transform:scale(1); }
  40% { transform:scale(1.35); }
  70% { transform:scale(0.88); }
  100%{ transform:scale(1); }
}
@keyframes slideDown {
  from { transform:translateY(-100%); opacity:0; }
  to   { transform:translateY(0); opacity:1; }
}
@keyframes pulse {
  0%,100%{ transform:scale(1); }
  50%    { transform:scale(1.06); }
}
@keyframes shimmer {
  0%  { background-position:-200% center; }
  100%{ background-position:200% center; }
}

.animate-in {
  animation: fadeInPage .22s ease both;
}
.page { animation: none; }
.page.active { animation: fadeInPage .22s ease; }

/* ── CHECKBOX ANIMATION ─────────────────────────────────────────── */
.checkbox { transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.checkbox:hover { transform:scale(1.08); }
.checkbox.done { animation: checkBounce .4s cubic-bezier(.34,1.56,.64,1); }
.text-done { text-decoration:line-through; color:var(--text-tertiary); transition:all .3s ease; }

/* ── USER PHOTO ─────────────────────────────────────────────────── */
.user-photo {
  width:36px; height:36px; border-radius:50%;
  object-fit:cover; border:2px solid var(--accent);
  display:block; transition:transform .2s ease;
}
.user-photo:hover { transform:scale(1.08); }
.user-avatar-wrap { display:flex; align-items:center; flex-shrink:0; }
.cfg-foto-preview .user-photo { width:80px; height:80px; }

/* ── STREAK DOTS ────────────────────────────────────────────────── */
.streak-row {
  display:flex; align-items:center; gap:10px; padding:9px 6px;
  border-bottom:1px solid var(--border); transition: background .12s ease;
  border-radius:8px;
}
.streak-row:last-child { border-bottom:none; }
.streak-row:hover { background:var(--bg-hover); }
.streak-habit-name {
  flex:0 0 160px; font-size:13px; font-weight:500;
  display:flex; align-items:center; gap:7px; color:var(--text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.streak-habit-name i { font-size:16px; }
.streak-dots { display:flex; gap:5px; flex:1; align-items:center; justify-content:center; }
.streak-dot {
  width:9px !important; height:9px !important;
  border-radius:50%; flex-shrink:0;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.streak-dot.filled {
  background:var(--accent) !important;
  box-shadow:0 0 6px rgba(45,122,79,.5) !important;
  border:none !important;
}
.streak-dot.empty {
  background:transparent !important;
  border:2px solid rgba(255,255,255,0.28) !important;
  box-shadow:none !important;
}
[data-theme="claro"] .streak-dot.empty,
html[data-theme="claro"] .streak-dot.empty {
  border:2px solid rgba(0,0,0,0.28) !important;
  background: rgba(0,0,0,0.04) !important;
}
.streak-dot.filled:hover { transform:scale(1.35); }
.streak-dot.empty:hover  { border-color:var(--accent) !important; transform:scale(1.1); }
.streak-info { flex:0 0 74px; text-align:right; }

/* ── FOCUS DEL DÍA ──────────────────────────────────────────────── */
.focus-item {
  display:flex; align-items:center; gap:8px;
  padding:7px 0; font-size:13px; border-bottom:1px solid rgba(0,0,0,.05);
  transition: all .15s ease; cursor:pointer;
}
.focus-item:last-child { border-bottom:none; }
.focus-item:hover { padding-left:4px; }

/* ── BITÁCORA SALUD ─────────────────────────────────────────────── */
.salud-bit-form { padding:4px 0; }
.mood-row { display:flex; gap:16px; margin-top:8px; flex-wrap:wrap; }
.mood-group { flex:1; min-width:200px; }
.mood-group label { font-size:12px; font-weight:500; color:var(--text-secondary); margin-bottom:6px; display:block; }
.mood-emoji { font-size:20px; margin-left:6px; }
.mood-slider { width:100%; accent-color:var(--accent); cursor:pointer; height:4px; border-radius:4px; }
.mood-slider.energy { accent-color:var(--amber-text); }
.mood-scale-labels { display:flex; justify-content:space-between; font-size:10px; color:var(--text-tertiary); margin-top:3px; }

.bit-salud-entry {
  display:flex; align-items:flex-start; gap:12px;
  padding:12px 8px; border-bottom:1px solid var(--border);
  transition:background .12s;
}
.bit-salud-entry:hover { background:var(--bg-hover); border-radius:8px; }
.bit-salud-fecha { flex:0 0 72px; font-size:12px; color:var(--text-tertiary); font-weight:500; padding-top:2px; }
.bit-salud-body { flex:1; min-width:0; }
.bit-salud-moods { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:5px; }
.mood-badge { font-size:12px; background:var(--bg-secondary); padding:2px 8px; border-radius:8px; }
.energy-badge { font-size:12px; background:var(--amber-bg); color:var(--amber-text); padding:2px 8px; border-radius:8px; }
.sleep-badge { font-size:12px; background:var(--blue-bg); color:var(--blue-text); padding:2px 8px; border-radius:8px; display:flex;align-items:center;gap:3px; }
.bit-salud-sintomas { font-size:11px; color:var(--amber-text); margin-bottom:3px; }
.bit-salud-notas { font-size:12px; color:var(--text-secondary); }

/* ── CALENDARIO UNIFICADO ───────────────────────────────────────── */
.cal-legend { display:flex; gap:12px; flex-wrap:wrap; padding:8px 4px 0; margin-bottom:4px; }
.cal-leg-item { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-secondary); }
.cal-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.ce-evento { background:var(--accent); }
.ce-tarea { background:var(--amber-text); }
.ce-turno { background:var(--red-text); }
.ce-deporte { background:var(--blue-text); }
.ce-estudio { background:var(--green-text); }
.cal-mini-dot { width:5px; height:5px; border-radius:50%; }
.cal-dot-row { display:flex; gap:2px; flex-wrap:wrap; justify-content:center; margin-top:2px; }
.dep-dot { background:var(--blue-text); }
.est-dot { background:var(--green-text); }
.cal-day { transition:background .12s ease, transform .1s ease; }
.cal-day:hover { transform:scale(1.02); }
.cal-day.has-items { border-color:var(--accent) !important; }
.cal-empty { min-height:70px; }

/* ── TURNOS CON FRECUENCIA ──────────────────────────────────────── */
.turno-card { transition:transform .12s ease, box-shadow .12s ease; }
.turno-card:hover { transform:translateY(-1px); box-shadow:var(--shadow-card); }

/* ── WEEKLY MODAL MEJORADO ──────────────────────────────────────── */
.weekly-modal {
  max-width:580px; background:var(--bg-card);
  border:1px solid var(--border); border-radius:20px;
  padding:2rem; max-height:85vh; overflow-y:auto;
  animation:fadeInPage .3s ease;
}
.weekly-header { text-align:center; margin-bottom:1.5rem; }
.weekly-emoji { font-size:48px; margin-bottom:8px; }
.weekly-header h2 { font-size:20px; font-weight:700; color:var(--accent-text); margin:0; }
.weekly-stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:1rem; }
@media(min-width:500px){ .weekly-stats-grid{ grid-template-columns:repeat(4,1fr); } }
.weekly-stat {
  background:var(--bg-secondary); border-radius:12px;
  padding:14px 10px; text-align:center;
  border:1px solid var(--border); transition:transform .12s;
}
.weekly-stat:hover { transform:scale(1.03); }
.ws-icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; margin:0 auto 8px; }
.ws-val { font-size:20px; font-weight:700; color:var(--accent-text); }
.ws-lab { font-size:10px; color:var(--text-secondary); margin-top:2px; }
.weekly-habit-row { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13px; padding:6px 0; border-bottom:1px solid var(--border); }
.weekly-habit-row:last-child { border-bottom:none; }

/* ── QUICK ADD MODAL ────────────────────────────────────────────── */
.qa-modal { max-width:440px; border-radius:18px; padding:1.5rem; animation:fadeInPage .2s ease; }
.qa-tabs { display:flex; gap:6px; margin-bottom:1rem; }
.qa-tab { flex:1; padding:8px; border:1px solid var(--border-md); border-radius:8px; font-size:13px; background:var(--bg-secondary); color:var(--text-secondary); cursor:pointer; transition:all .12s; display:flex; align-items:center; justify-content:center; gap:6px; }
.qa-tab.active { background:var(--accent-light); color:var(--accent-text); border-color:var(--accent); font-weight:500; }
.qa-panel { display:none; }
.qa-panel.active { display:block; }
.qa-input { font-size:15px !important; padding:12px !important; font-weight:500; }

/* ── FAB BUTTON ─────────────────────────────────────────────────── */
#fab {
  position:fixed; bottom:28px; right:28px;
  width:54px; height:54px; border-radius:50%;
  background:var(--accent); color:#fff;
  border:none; font-size:22px;
  box-shadow:0 4px 20px rgba(45,122,79,.4);
  cursor:pointer; z-index:200;
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s ease;
}
#fab:hover { transform:scale(1.12) rotate(15deg); box-shadow:0 6px 28px rgba(45,122,79,.55); }
#fab:active { transform:scale(.95); }

/* ── CARDS HOVER ────────────────────────────────────────────────── */
.metric-card { transition: transform .15s ease, box-shadow .15s ease; }
.metric-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-card); }
.meta-card { transition:transform .12s ease, box-shadow .12s ease; }
.meta-card:hover { transform:translateY(-1px); box-shadow:var(--shadow-card); }
.nota-card { transition:transform .15s ease, box-shadow .15s ease, opacity .15s; }
.nota-card:hover { transform:translateY(-3px) rotate(.3deg); box-shadow:var(--shadow-card); }
/* ── BUTTONS HOVER ──────────────────────────────────────────────── */
.btn-primary { transition:all .15s ease; }
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(45,122,79,.3); }
.btn-primary:active { transform:translateY(0); }
.btn-secondary { transition:all .12s ease; }
.btn-secondary:hover { background:var(--bg-hover); }
.nav-item { transition:background .1s ease, padding-left .1s ease; }
.nav-item:hover:not(.active) { padding-left:calc(var(--sidebar-collapsed-offset, 0px) + 18px); }

/* ── PROGRESS BAR ANIMATION ─────────────────────────────────────── */
.progress-fill { transition:width .6s cubic-bezier(.25,.46,.45,.94); }

/* ── MED CARD BUTTON ────────────────────────────────────────────── */
.med-check-btn { transition:all .15s ease; }
.med-check-btn.taken { animation:checkBounce .3s ease; }

/* ── HABIT DAYS ─────────────────────────────────────────────────── */
.habit-day { transition:background .1s ease, transform .1s ease; }
.habit-day:hover { transform:scale(1.15); }
.habit-day.done { animation:checkBounce .3s ease; }

/* ── MODAL ANIMATION ────────────────────────────────────────────── */
.modal { animation:fadeInPage .2s ease; }
.modal-overlay.open .modal { animation:fadeInPage .2s ease; }

/* ── SCROLLBAR POLISH ───────────────────────────────────────────── */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border-md); border-radius:10px; }
::-webkit-scrollbar-thumb:hover { background:var(--accent); }

/* ── TOOLTIP ────────────────────────────────────────────────────── */
[title]:not(input):not(button[title=""]) {
  position:relative; cursor:help;
}

/* ── INPUT FOCUS ────────────────────────────────────────────────── */
input:focus, select:focus, textarea:focus {
  outline:none;
  border-color:var(--accent) !important;
  box-shadow:0 0 0 2.5px rgba(45,122,79,.18);
  transition:box-shadow .15s ease, border-color .15s ease;
}

/* ── RANGE SLIDER ───────────────────────────────────────────────── */
input[type=range] { accent-color:var(--accent); cursor:pointer; }

/* ── WEEKLY OVERLAY ─────────────────────────────────────────────── */
#weekly-overlay { display:none; }
#weekly-overlay.open { display:flex; }

/* ── QA OVERLAY ─────────────────────────────────────────────────── */
#qa-overlay { display:none; }
#qa-overlay.open { display:flex; }

/* ── MODAL SAVE BUTTON ──────────────────────────────────────────── */
.btn-danger {
  background:var(--red-bg); color:var(--red-text);
  border:1px solid var(--red-text); border-radius:9px;
  padding:9px 16px; font-size:13px; cursor:pointer;
  transition:all .12s ease; display:flex; align-items:center; justify-content:center; gap:6px;
}
.btn-danger:hover { background:var(--red-text); color:#fff; }

/* ── CAL EVENTS ─────────────────────────────────────────────────── */
.ce-salud { background:rgba(185,40,40,.15); color:#c0392b; border-left:2px solid #c0392b; }
.ce-tarea { background:rgba(146,88,10,.12); color:var(--amber-text); border-left:2px solid var(--amber-text); }

/* ═══════════════════════════════════════════════════════
   LIFE HUB v2.2 — Hotfix: foto, streak, sidebar collapsed
   ═══════════════════════════════════════════════════════ */

/* Foto de perfil en sidebar — usa .avatar-img (clase ya definida) */
.user-avatar-wrap .avatar-img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  display: block;
  flex-shrink: 0;
  transition: transform .2s ease;
}
.user-avatar-wrap .avatar-img:hover { transform: scale(1.08); }

/* Sidebar contraído: mostrar foto pequeña, ocultar nombre */
.sidebar.collapsed .user-avatar-wrap .avatar-img {
  width: 28px !important;
  height: 28px !important;
  border-width: 1.5px;
}
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role,
.sidebar.collapsed .sidebar-user > div:last-child { display: none; }
.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 8px 0;
}
.sidebar.collapsed .user-avatar-wrap {
  justify-content: center;
}

/* Streak check button — reemplaza el checkbox conflictivo */
.streak-check-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-md);
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  font-size: 12px;
  transition: all .15s cubic-bezier(.34,1.56,.64,1);
  outline: none;
}
.streak-check-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-text);
  transform: scale(1.12);
}
.streak-check-btn.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  animation: checkBounce .35s cubic-bezier(.34,1.56,.64,1);
}
.streak-check-btn:disabled { opacity: .6; cursor: default; transform: none !important; }

/* Arreglar overflow del sidebar que cortaba el click */
.sidebar { overflow: visible !important; }
nav { overflow-y: auto; overflow-x: hidden; }

/* ═══════════════════════════════════════════════════════════════
   LIFE HUB v2.2 — Patch 2: Streak dots, cards, notifs, polish
   ═══════════════════════════════════════════════════════════════ */

/* streak-dot rules consolidated above */

/* ── QUITAR VERDE "STUCK" de tarjetas ──────────────────────────── */
/* dash-fin-health-card: color según salud financiera del mes (se aplica por JS
   con las clases fh-ok/fh-warn/fh-danger; sin datos todavía queda neutro) */
#dash-fin-health-card {
  border: 1px solid var(--border) !important;
  border-top: 3px solid var(--border-md) !important;
}
#dash-fin-health-card.fh-ok     { border-top: 3px solid var(--accent) !important; }
#dash-fin-health-card.fh-warn   { border-top: 3px solid var(--amber-text) !important; }
#dash-fin-health-card.fh-danger { border-top: 3px solid var(--red-text) !important; }

/* ── Tarjetas de métricas del dashboard: mismo tratamiento de borde superior
   de color que ya tenían "Foco del día" y "Finanzas del mes", para que las 6
   tarjetas de arriba se vean consistentes con el resto en vez de planas. ── */
.metric-card.mc-tareas   { border-top: 3px solid var(--accent)      !important; }
.metric-card.mc-meds     { border-top: 3px solid var(--amber-text)  !important; }
.metric-card.mc-habitos  { border-top: 3px solid var(--teal-text)   !important; }
.metric-card.mc-deporte  { border-top: 3px solid var(--red-text)    !important; }
.metric-card.mc-estudio  { border-top: 3px solid var(--purple-text) !important; }
.metric-card.mc-metas    { border-top: 3px solid var(--blue-text)   !important; }

/* ── Tarjetas clickeables: llevan a la sección que representan ── */
.clickable-card { cursor: pointer; }
.clickable-card:hover {
  border-color: var(--border-md) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.09);
  transform: translateY(-2px);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* Cards sin outline al hacer click (touch devices) */
.card, .metric-card, .meta-card, .nota-card, .bit-entry, .habit-card {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}
.card:focus, .metric-card:focus, .meta-card:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* ── NOTIFICACIÓN BANNER MEJORADO ──────────────────────────────── */
#notif-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9998;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,.15);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
  transform: translateY(-100%);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  font-size: 13px;
  pointer-events: none;  /* no interceptar clicks cuando está oculto */
}
#notif-banner.visible { transform: translateY(0); pointer-events: auto; }
.notif-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-icon.task { background: var(--amber-bg); color: var(--amber-text); }
.notif-icon.habit { background: var(--blue-bg); color: var(--blue-text); }
.notif-items { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; color: var(--text); }
.notif-sub { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
.notif-actions { display: flex; gap: 6px; }
.notif-btn {
  padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .12s ease; border: 1px solid var(--border-md);
  background: var(--bg-secondary); color: var(--text);
}
.notif-btn:hover { background: var(--bg-hover); }
.notif-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.notif-btn.primary:hover { background: var(--accent-hover); }

/* ── TOAST MEJORADO ────────────────────────────────────────────── */
.toast {
  border-radius: 10px !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.18) !important;
}

/* ── MEJORAS ESTÉTICAS GENERALES ───────────────────────────────── */

/* Scrollbar más fina y elegante */
* { scrollbar-width: thin; scrollbar-color: var(--border-md) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-track { background: transparent; }

/* Selección de texto con color verde */
::selection { background: rgba(45,122,79,.25); color: inherit; }

/* Row items más limpios */
.row-item {
  transition: background .12s ease, padding-left .12s ease;
  border-radius: 8px;
}
.row-item:hover {
  background: var(--bg-hover) !important;
  padding-left: 8px;
}
.row-item:hover .row-actions { opacity: 1 !important; }
.row-actions { opacity: 0; transition: opacity .15s ease; }

/* Inputs más elegantes */
input, select, textarea {
  transition: border-color .15s ease, box-shadow .15s ease !important;
}

/* Habit cards más estilizadas */
.habit-card {
  border-left: 3px solid transparent;
  transition: border-left-color .2s ease, transform .15s ease, box-shadow .15s ease;
}
.habit-card:hover { border-left-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-card); }

/* Streak row hover más suave */
/* streak-row consolidated above */

/* Tags con mejor sombra */
.tag { letter-spacing: .01em; }

/* Animación de entrada de la página */
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.page.active { animation: pageSlideIn .2s ease both; }

/* Metric cards pop mejorado */
@keyframes metricPop {
  0%   { opacity:0; transform:scale(.92) translateY(6px); }
  60%  { transform:scale(1.03) translateY(-1px); }
  100% { opacity:1; transform:scale(1) translateY(0); }
}
.metrics-grid .metric-card { animation: metricPop .35s cubic-bezier(.34,1.56,.64,1) both; }

/* Focus del día — items animados */
@keyframes focusItemIn {
  from { opacity:0; transform:translateX(-8px); }
  to   { opacity:1; transform:translateX(0); }
}
.focus-item { animation: focusItemIn .2s ease both; }
.focus-item:nth-child(1){animation-delay:.02s}
.focus-item:nth-child(2){animation-delay:.06s}
.focus-item:nth-child(3){animation-delay:.10s}
.focus-item:nth-child(4){animation-delay:.14s}

/* Medicación — estado visual más claro */
.med-card { transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease; }
.med-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }

/* Turno card hover */
.turno-card:hover { background: var(--bg-hover); }

/* Pill de racha — glow animado cuando es alta */
.tag-green[style*="flame"] {
  animation: none;
}
.streak-check-btn.done::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ringPulse .6s ease forwards;
  pointer-events: none;
}
@keyframes ringPulse {
  from { opacity:.8; transform:scale(1); }
  to   { opacity:0; transform:scale(1.6); }
}
.streak-check-btn { position: relative; overflow: visible !important; }



/* ════════════════════════════════════════════════════════════
   STREAK DOTS — DEFINICIÓN FINAL (máxima especificidad)
   Sobreescribe cualquier regla anterior
   ════════════════════════════════════════════════════════════ */
div.streak-dots > div.streak-dot,
div.streak-dots > div.streak-dot.filled,
div.streak-dots > div.streak-dot.empty {
  width:    9px !important;
  height:   9px !important;
  min-width:  9px !important;
  min-height: 9px !important;
  max-width:  9px !important;
  max-height: 9px !important;
  border-radius: 50% !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  flex-basis: 9px !important;
  aspect-ratio: unset !important;
}
div.streak-dots > div.streak-dot.filled {
  background: var(--accent) !important;
  border: none !important;
  box-shadow: 0 0 5px rgba(45,122,79,.5) !important;
}
div.streak-dots > div.streak-dot.empty {
  background: transparent !important;
  box-shadow: none !important;
}
[data-theme="claro"] div.streak-dots > div.streak-dot.empty {
  border: 1.5px solid rgba(0,0,0,0.25) !important;
}
[data-theme="oscuro"] div.streak-dots > div.streak-dot.empty,
div.streak-dots > div.streak-dot.empty {
  border: 1.5px solid rgba(255,255,255,0.3) !important;
}

/* ── POINTER EVENTS — nada debe bloquear los clicks de hábitos ── */
#notif-banner:not(.visible) { pointer-events: none !important; }
.streak-check-btn::after   { pointer-events: none !important; }

/* ── HABIT-DAY — cursor pointer explícito para evitar confusion ── */
.habit-day { cursor: pointer !important; }
.habit-days { position: relative; z-index: 1; }

/* ── AUTH (login / configurar acceso) — mobile-first ── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, var(--accent-light) 0%, transparent 45%),
    radial-gradient(circle at 84% 88%, var(--accent-light) 0%, transparent 40%),
    var(--bg-page);
}
.auth-page::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, var(--accent) 1px, transparent 1px);
  background-size: 28px 28px; opacity: 0.05;
}
.auth-card {
  width: 100%; max-width: 360px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 24px; box-shadow: 0 8px 28px rgba(0,0,0,0.08);
  position: relative; z-index: 1;
  animation: authCardIn .55s cubic-bezier(.16,1,.3,1);
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 18px; color: var(--accent); font-size: 22px; font-weight: 600;
  animation: authCardIn .6s cubic-bezier(.16,1,.3,1);
}
.auth-logo i {
  font-size: 26px; display: inline-flex; border-radius: 50%;
  animation: authLogoGlow 2.8s ease-in-out infinite;
}
@keyframes authLogoGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(0,0,0,0)); transform: rotate(0deg); }
  50% { filter: drop-shadow(0 0 6px var(--accent)); transform: rotate(-8deg); }
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-subtitle {
  text-align: center; color: var(--text-secondary); font-size: 13px;
  margin-bottom: 22px;
}
.auth-card .form-group { margin-bottom: 1rem; }
.auth-card .btn-primary {
  width: 100%; justify-content: center; padding: 10px; margin-top: 4px;
  transition: background 0.12s, transform 0.15s, box-shadow 0.15s;
}
.auth-card .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.auth-error {
  background: var(--red-bg, #fbeaea); color: var(--red-text, #b03a3a);
  border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 6px;
}
.auth-hint { text-align: center; font-size: 11.5px; color: var(--text-tertiary); margin-top: 16px; }
.auth-hint a { color: var(--text-secondary); transition: color 0.12s; }
.auth-hint a:hover { color: var(--accent); }
@media (max-width: 420px) {
  .auth-card { padding: 22px 18px; border-radius: 12px; }
}
.pwd-field-wrap { position: relative; }
.pwd-field-wrap input[type=password], .pwd-field-wrap input[type=text] { padding-right: 40px; }
.pwd-toggle-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-tertiary); cursor: pointer;
  border-radius: 6px; font-size: 16px;
}
.pwd-toggle-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ── GRÁFICOS HISTÓRICOS (Chart.js) — Finanzas / Salud ── */
.chart-wrap { position: relative; height: 260px; width: 100%; }
@media (max-width: 640px) {
  .chart-wrap { height: 220px; }
}

/* ── ESTUDIO: POMODORO + HISTORIAL POR MATERIA ── */
.pomodoro-box { text-align: center; padding: 8px 0 4px; }
.pomodoro-timer { font-size: 54px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 2px; line-height: 1.1; }
.pomodoro-fase { font-size: 12.5px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 12px; }
.pomodoro-fase.descanso { color: var(--accent); }
.pomodoro-controls { display: flex; gap: 10px; justify-content: center; }
.est-historial-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.est-historial-row:last-child { border-bottom: none; }
.est-historial-materia { flex: 0 0 140px; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-historial-bar-wrap { flex: 1; background: var(--bg-secondary); border-radius: 6px; height: 10px; overflow: hidden; }
.est-historial-bar { height: 100%; background: var(--accent); border-radius: 6px; }
.est-historial-horas { flex: 0 0 90px; text-align: right; font-size: 12px; color: var(--text-secondary); }
@media (max-width: 480px) {
  .pomodoro-timer { font-size: 42px; }
  .est-historial-materia { flex-basis: 90px; }
}

/* ── CONFIGURACIÓN: OCULTAR MÓDULOS ── */
.cfg-modulos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; }
.cfg-modulo-toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.cfg-modulo-toggle input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
