*, *::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;
}

/* ── ACENTOS (color de acento personalizable, ver cambiarAcento() en app.js) ── */
[data-theme="claro"][data-acento="azul"] {
  --accent: #2563a8; --accent-hover: #1d4e87; --accent-light: #e7f0fa; --accent-text: #1d4e87; --border-focus: #2563a8;
  --bg-page: #f6f8fa; --bg-card: #ffffff; --bg-secondary: #eef2f6; --bg-hover: #e4ebf2; --bg-input: #ffffff;
  --sidebar-bg: #16243a; --topbar-bg: #ffffff;
}
[data-theme="oscuro"][data-acento="azul"] {
  --accent: #4d9de0; --accent-hover: #3d84c2; --accent-light: #142838; --accent-text: #4d9de0; --border-focus: #4d9de0;
  --bg-page: #0d131c; --bg-card: #141f2c; --bg-secondary: #182534; --bg-hover: #1e2e40; --bg-input: #141f2c;
  --sidebar-bg: #0a121c; --topbar-bg: #141f2c;
}
[data-acento="azul"] { --sidebar-accent: #4d9de0; }

[data-theme="claro"][data-acento="violeta"] {
  --accent: #6a4fc7; --accent-hover: #5540a3; --accent-light: #efecfb; --accent-text: #5540a3; --border-focus: #6a4fc7;
  --bg-page: #f8f7fb; --bg-card: #ffffff; --bg-secondary: #f1eef8; --bg-hover: #e8e3f3; --bg-input: #ffffff;
  --sidebar-bg: #241e3a; --topbar-bg: #ffffff;
}
[data-theme="oscuro"][data-acento="violeta"] {
  --accent: #9885e8; --accent-hover: #8170cc; --accent-light: #241f3d; --accent-text: #9885e8; --border-focus: #9885e8;
  --bg-page: #14121e; --bg-card: #1e1a2c; --bg-secondary: #241f36; --bg-hover: #2b2540; --bg-input: #1e1a2c;
  --sidebar-bg: #120f1c; --topbar-bg: #1e1a2c;
}
[data-acento="violeta"] { --sidebar-accent: #9885e8; }

[data-theme="claro"][data-acento="rosa"] {
  --accent: #c34a76; --accent-hover: #a13b60; --accent-light: #fbebf1; --accent-text: #a13b60; --border-focus: #c34a76;
  --bg-page: #fbf7f8; --bg-card: #ffffff; --bg-secondary: #f8eef1; --bg-hover: #f3e3e9; --bg-input: #ffffff;
  --sidebar-bg: #3a1e29; --topbar-bg: #ffffff;
}
[data-theme="oscuro"][data-acento="rosa"] {
  --accent: #e2789f; --accent-hover: #c96186; --accent-light: #351c26; --accent-text: #e2789f; --border-focus: #e2789f;
  --bg-page: #1a1216; --bg-card: #261a20; --bg-secondary: #2e1f26; --bg-hover: #38252d; --bg-input: #261a20;
  --sidebar-bg: #170f13; --topbar-bg: #261a20;
}
[data-acento="rosa"] { --sidebar-accent: #e2789f; }

[data-theme="claro"][data-acento="naranja"] {
  --accent: #c46a1f; --accent-hover: #a2560f; --accent-light: #faeee0; --accent-text: #a2560f; --border-focus: #c46a1f;
  --bg-page: #fbf8f5; --bg-card: #ffffff; --bg-secondary: #f8f0e6; --bg-hover: #f3e6d3; --bg-input: #ffffff;
  --sidebar-bg: #3a2a16; --topbar-bg: #ffffff;
}
[data-theme="oscuro"][data-acento="naranja"] {
  --accent: #e8963f; --accent-hover: #cc7f2e; --accent-light: #35250f; --accent-text: #e8963f; --border-focus: #e8963f;
  --bg-page: #1a140d; --bg-card: #261d13; --bg-secondary: #2e2417; --bg-hover: #382c1b; --bg-input: #261d13;
  --sidebar-bg: #17110a; --topbar-bg: #261d13;
}
[data-acento="naranja"] { --sidebar-accent: #e8963f; }

[data-theme="claro"][data-acento="turquesa"] {
  --accent: #1a8a8a; --accent-hover: #12706f; --accent-light: #e2f5f5; --accent-text: #12706f; --border-focus: #1a8a8a;
  --bg-page: #f5f9f9; --bg-card: #ffffff; --bg-secondary: #e9f4f4; --bg-hover: #ddeeee; --bg-input: #ffffff;
  --sidebar-bg: #163a3a; --topbar-bg: #ffffff;
}
[data-theme="oscuro"][data-acento="turquesa"] {
  --accent: #3dd6d6; --accent-hover: #2eb8b8; --accent-light: #0f2e2e; --accent-text: #3dd6d6; --border-focus: #3dd6d6;
  --bg-page: #0d1717; --bg-card: #142222; --bg-secondary: #182a2a; --bg-hover: #1e3434; --bg-input: #142222;
  --sidebar-bg: #0a1414; --topbar-bg: #142222;
}
[data-acento="turquesa"] { --sidebar-accent: #3dd6d6; }

.acento-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; flex: none; transition: transform 0.12s, border-color 0.12s; }
.acento-swatch:hover { transform: scale(1.1); }
.acento-swatch.activo { border-color: var(--text); }
.acento-swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ── DENSIDAD (modo compacto, ver cambiarDensidad() en app.js) ──────────────
   Reduce paddings/gaps de los contenedores mas repetidos de la app para que
   entre mas contenido en pantalla sin scroll. No toca tipografia base (los
   textos siguen siendo legibles), solo el "aire" alrededor de tarjetas,
   filas de listas y secciones. */
html[data-densidad="compacto"] .page { padding: 0.85rem; }
html[data-densidad="compacto"] .card,
html[data-densidad="compacto"] .settings-section,
html[data-densidad="compacto"] .meta-card,
html[data-densidad="compacto"] .habit-card {
  padding: 0.7rem 0.85rem; margin-bottom: 0.6rem;
}
html[data-densidad="compacto"] .row-item { padding: 5px 6px; }
html[data-densidad="compacto"] .row-sub { margin-top: 1px; }
html[data-densidad="compacto"] .dash-widgets { gap: 0.65rem; }
html[data-densidad="compacto"] .kanban-board { gap: 8px; padding: 8px; }
html[data-densidad="compacto"] .kanban-col { padding: 7px; }
html[data-densidad="compacto"] .sidebar-user { padding: 0.5rem 1rem; }
html[data-densidad="compacto"] .nav-item { padding-top: 6px; padding-bottom: 6px; }
html[data-densidad="compacto"] .nav-section { padding: 0.4rem 1rem 0.15rem; }

/* ── SECCIONES COLEGABLES (Configuración, Finanzas) ──────────────────────────
   Header clickeable con chevron que rota; el body se oculta con display:none
   cuando la sección está colapsada. El estado se persiste por sección en
   localStorage (ver toggleSeccion()/initSeccionesColapsables() en app.js),
   asi que colapsar algo no se pierde al cambiar de pagina. */
.collapsible-header { cursor: pointer; display: flex; align-items: center; gap: 6px; -webkit-tap-highlight-color: transparent; }
.collapse-chevron { font-size: 15px; transition: transform 0.15s ease; flex-shrink: 0; }
[data-sid].collapsed .collapse-chevron { transform: rotate(-90deg); }
[data-sid].collapsed .collapsible-body { display: none; }

/* ── 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;
}
/* 100vh en mobile no descuenta la barra de direcciones del navegador (a
   diferencia de instalada como PWA, sin esa barra) y el layout queda mas
   alto que lo realmente visible, cortando contenido antes de llegar al
   final. 100dvh si la descuenta; queda como mejora progresiva sobre el
   100vh de arriba (los navegadores que no soportan dvh ignoran la linea). */
@supports (height: 100dvh) {
  body { height: 100dvh; }
}
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ── LAYOUT ── */
.app { display: flex; height: 100vh; }
@supports (height: 100dvh) {
  .app { height: 100dvh; }
}

/* ── 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; }

/* Contenedor de tarjetas del dashboard personalizable: auto-fit hace que al
   ocultar una tarjeta o reordenarlas (moviendo los nodos .dash-widget en el
   DOM, ver aplicarOrdenDashboard() en app.js) el resto se acomode solo, sin
   dejar huecos ni depender de una grilla de pares fija. Las tarjetas "full"
   (metricas, medicacion, habitos, actividad) ocupan todo el ancho porque
   suelen tener mas contenido; el resto se empareja de a 2 en pantallas anchas. */
.dash-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
/* Sin esto, un item de grid puede negarse a encogerse por debajo del ancho
   minimo de su contenido (min-width:auto por default en grid items) y
   termina agrandando toda la fila mas alla de la pantalla en celu, cortando
   el borde derecho — mismo bug de fondo que el min-height:0 del menu, pero
   en el eje horizontal. */
.dash-widget { min-width: 0; }
.dash-widget-full { grid-column: 1 / -1; }
@media (max-width: 700px) { .dash-widgets { grid-template-columns: 1fr; } }
.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; }
/* Modal de detalle del día (click en una celda del calendario mensual) */
.dia-cal-lista { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.dia-cal-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-radius: 8px; font-size: 13px;
}
.dia-cal-item.clickable { cursor: pointer; }
.dia-cal-item.clickable:hover { background: var(--bg-hover); }
.dia-cal-hora { font-size: 11px; color: var(--text-tertiary); min-width: 38px; }
.dia-cal-icono { font-size: 15px; }
.dia-cal-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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-examen { background: var(--purple-bg); color: var(--purple-text); }
.ce-repaso { background: var(--amber-bg); color: var(--amber-text); }
.ce-alimentacion { background: var(--teal-bg); color: var(--teal-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; }

/* Perfil expandido (click en la foto del menú lateral) */
.perfil-expandido { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 8px 4px; gap: 18px; }
.perfil-expandido-avatar .user-avatar { width: 140px; height: 140px; font-size: 52px; }
.perfil-expandido-avatar .avatar-img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.perfil-expandido-frase { font-size: 15px; font-style: italic; color: var(--text-secondary); line-height: 1.5; max-width: 340px; }

/* ── 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;
  }
  @supports (height: 100dvh) {
    .sidebar { height: 100dvh; }
  }
  /* 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-examen { background:#8e44ad; }
.ce-repaso { background:#c98a1b; }
.ce-alimentacion { background:#1a7070; }
.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-examen.cal-event { background:#8e44ad; 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); }
.ce-examen { background:#8e44ad; }
.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); }
.repaso-dot { background:var(--amber-text); }
.ali-dot { background:var(--teal-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; }

/* Lista de "Personalizar dashboard": checkbox de visibilidad + nombre +
   flechas para subir/bajar. Mismo espiritu visual que .cfg-modulo-toggle
   de arriba, pero en filas completas (necesitan lugar para las flechas). */
.cfg-dashboard-lista { display: flex; flex-direction: column; gap: 6px; }
.cfg-dashboard-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--bg-secondary); border-radius: 8px;
}
.cfg-dashboard-item input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.cfg-dashboard-item span { flex: 1; font-size: 13px; }
.cfg-dash-mover { display: flex; gap: 4px; flex-shrink: 0; }
.cfg-dash-mover button {
  background: none; border: 1px solid var(--border-md); border-radius: 6px;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer; transition: background 0.12s, color 0.12s;
}
.cfg-dash-mover button:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.cfg-dash-mover button:disabled { opacity: 0.35; cursor: default; }

/* ── CALENDARIO: vista semanal ─────────────────────────────────── */
#cal-vista-mes.active, #cal-vista-semana.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal-week-wrap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; overflow-x: auto; }
.cal-week-day { min-width: 130px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; min-height: 160px; }
.cal-week-day.today { border-color: var(--accent); background: var(--accent-light); }
.cal-week-day-head { font-size: 11px; font-weight: 600; text-align: center; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.cal-week-day.today .cal-week-day-head { color: var(--accent-text); }
.cal-week-item { padding: 3px 5px; border-radius: 4px; font-size: 10.5px; margin-bottom: 4px; cursor: pointer; color: #fff; font-weight: 500; line-height: 1.35; }
.cal-week-item:hover { opacity: .85; }
.cal-week-item .cal-week-hora { font-weight: 700; display: block; }
.cal-week-empty { font-size: 10px; color: var(--text-tertiary); text-align: center; padding-top: 10px; }
@media (max-width: 768px) {
  .cal-week-wrap { grid-template-columns: repeat(7, minmax(110px,1fr)); }
}

/* ── Atajos de teclado (Configuración) ─────────────────────────── */
.cfg-atajos-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 12.5px; align-items: center; }
.cfg-atajos-grid > div:nth-child(odd) { color: var(--text-secondary); }
.cfg-atajos-grid kbd, .cfg-atajos-grid b { font-family: inherit; }

/* ── ESTUDIO: modo foco (pantalla completa con fondo animado) ──── */
.foco-overlay {
  position: fixed; inset: 0; z-index: 1500; display: none;
  align-items: center; justify-content: center; background: #05020f;
}
.foco-overlay.open { display: flex; }
.foco-overlay canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.foco-content {
  position: relative; z-index: 1; text-align: center; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 20px; animation: fadeInPage .35s ease;
}
.foco-fase {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(255,255,255,.6);
}
.foco-fase.descanso { color: #7ee0ff; }
.foco-timer {
  font-size: 104px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 50px rgba(150,100,255,.55);
}
.foco-materia { font-size: 14px; color: rgba(255,255,255,.55); min-height: 18px; }
.foco-controls { display: flex; gap: 12px; margin-top: 8px; }
.foco-controls .btn-primary {
  background: #7c5cff; border-color: #7c5cff;
}
.foco-controls .btn-primary:hover { background: #6a4ae8; }
.foco-controls .btn-secondary {
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25);
}
.foco-controls .btn-secondary:hover { background: rgba(255,255,255,.18); }
@media (max-width: 768px) {
  .foco-timer { font-size: 62px; }
}

/* ── Estudio: diario ampliado (setiembre 2026) ─────────────────────────── */
.est-heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 3px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.est-heatmap-cell { width: 10px; height: 10px; border-radius: 2px; background: var(--bg-secondary); }
.est-heatmap-cell.h1 { background: var(--green-bg); }
.est-heatmap-cell.h2 { background: #9fd8a6; }
.est-heatmap-cell.h3 { background: #5cb85c; }
.est-heatmap-cell.h4 { background: var(--green-text); }
.est-materia-card { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.est-materia-card:last-child { border-bottom: none; }
.est-materia-color { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.est-materia-info { flex: 1; min-width: 0; }
.est-materia-nombre { font-weight: 600; font-size: 14px; }
.est-materia-sub { font-size: 12px; color: var(--text-tertiary); }
.est-rating { color: #e1a800; font-size: 12px; letter-spacing: 1px; }
.est-repaso-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.est-repaso-item:last-child { border-bottom: none; }

/* ── Bienvenida (onboarding de cuentas nuevas) ──────────────────────────── */
.bienvenida-modal { max-width: 460px; max-height: 88vh; overflow-y: auto; }
.bienvenida-frase { font-size: 13.5px; color: var(--text-secondary); font-style: italic; margin-top: 6px; line-height: 1.5; }
.bienvenida-seccion { margin-top: 18px; }
.bienvenida-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin: 0 0 8px; }
.bienvenida-sublabel { font-size: 11.5px; color: var(--text-tertiary); margin: -4px 0 8px; }

/* ── Alimentación: base mínima (setiembre 2026) ─────────────────────────── */
.ali-agua-nota { font-size: 11.5px; color: var(--text-tertiary); text-align: center; margin: 0 0 4px; }
.ali-agua-box { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 6px 0; }
.ali-agua-valor { font-size: 20px; font-weight: 700; color: var(--accent-text); min-width: 150px; text-align: center; }
.ali-agua-ml { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-tertiary); }
.ali-agua-meta { margin-top: 14px; cursor: pointer; }
.ali-agua-meta-texto { font-size: 11.5px; color: var(--text-secondary); text-align: center; margin-top: 6px; }

/* ── Alimentación: metas diarias, catálogo (setiembre 2026, 2da pasada) ── */
.ali-meta-fila { margin-top: 10px; }
.ali-meta-fila:first-child { margin-top: 0; }
.ali-meta-fila-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 4px; }
.ali-meta-fila-label span { font-weight: 600; color: var(--text-primary); }

/* ── Alimentación: chips de frecuentes (setiembre 2026, 3ra pasada) ── */
.ali-chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ali-chips-row:empty { display: none; margin-bottom: 0; }
.ali-chip { border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.ali-chip:hover { border-color: var(--accent); color: var(--accent-text); }


/* ══════════════════════════════════════════════════════════════════════
   MÓVIL (octubre 2026) — pulido para uso en celular.
   Todo va dentro de media queries: en escritorio no cambia nada.
   ══════════════════════════════════════════════════════════════════════ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
.main-content, .page { max-width: 100vw; }

@media (max-width: 640px) {
  /* Barra superior: la fecha y el reloj no entran junto al título. */
  .topbar { padding-left: 10px; padding-right: 10px; gap: 6px; }
  .topbar-left { gap: 6px; min-width: 0; flex: 1; }
  .topbar-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar-right { gap: 4px; flex-shrink: 0; }
  .topbar-date { display: none; }
  .clock { font-size: 12.5px; white-space: nowrap; }

  /* Área de contenido */
  .page { padding: 0.85rem 0.75rem calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

  /* Objetivos táctiles de ~40px */
  .btn-icon { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { padding: 8px 12px; min-height: 36px; }
  .row-actions button, .row-actions .btn-icon { min-width: 36px; min-height: 36px; }
  .nav-item { min-height: 44px; }

  /* Inputs a 16px: evita el zoom automático de iOS al enfocar un campo. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
  select, textarea { font-size: 16px !important; min-height: 42px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }

  /* Filas de listas: el título pasa a 2 líneas en lugar de "L..." */
  .row-item { flex-wrap: wrap; row-gap: 6px; padding: 10px 4px; }
  .row-text { flex: 1 1 60%; }
  .row-title { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; font-size: 14px; }
  .row-sub { font-size: 12px; }
  .row-actions { margin-left: auto; }

  /* Racha de hábitos: nombre arriba, puntos y datos debajo. */
  .streak-row { flex-wrap: wrap; row-gap: 6px; }
  .streak-habit-name { flex: 1 1 100%; white-space: normal; }
  .streak-dots { flex: 1 1 auto; justify-content: flex-start; flex-wrap: wrap; min-width: 0; }
  .streak-info { flex: 0 0 auto; margin-left: auto; }

  /* Grillas que no colapsaban */
  .dash-widgets, .dash-grid, .dash-grid-3, .dash-focus-row { grid-template-columns: 1fr; }
  .card, .dash-card { min-width: 0; }
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  img, canvas, video, svg { max-width: 100%; }
  pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }

  /* Botón "+" flotante: sin pisar el contenido ni la barra del sistema. */
  #fab {
    width: 52px; height: 52px;
    right: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* Modales como hoja inferior a casi pantalla completa */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%; max-width: 100%;
    max-height: 92vh; border-radius: 16px 16px 0 0;
    padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  }
  @supports (height: 100dvh) { .modal { max-height: 92dvh; } }
  .modal-footer { position: sticky; bottom: 0; background: var(--bg-card); flex-wrap: wrap; }
  .modal-footer button { flex: 1 1 auto; min-height: 42px; }
  .bienvenida-modal { max-width: 100%; max-height: 92vh; }

  /* Calendario: botones Mes/Semana y navegación en columnas parejas */
  #cal-vista-mes, #cal-vista-semana { flex: 1; min-height: 38px; }
  .cal-week-wrap { grid-template-columns: repeat(7, minmax(120px, 1fr)); -webkit-overflow-scrolling: touch; }

  /* Configuración: foto y formulario apilados */
  .cfg-perfil-grid { flex-direction: column; align-items: stretch; }
  .cfg-modulos-grid { grid-template-columns: 1fr 1fr; }

  /* Banner de notificaciones/avisos fijos */
  .toast, #toast { max-width: calc(100vw - 24px); }

  /* Modo foco */
  .foco-timer { font-size: 56px; }
  .foco-controls { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 380px) {
  .page { padding-left: 0.6rem; padding-right: 0.6rem; }
  .cfg-modulos-grid { grid-template-columns: 1fr; }
  .pomodoro-timer { font-size: 38px; }
}

/* Pantallas táctiles sin hover: acciones siempre visibles ya está resuelto
   arriba (hover: none). Acá solo evitamos el "doble toque" por :hover. */
@media (hover: none) {
  .row-item:hover { background: transparent; }
}

/* ══════════════════════════════════════════════════════════════════════
   BARRA INFERIOR, ESQUELETOS Y ESTADOS VACÍOS (octubre 2026)
   ══════════════════════════════════════════════════════════════════════ */
.bottom-nav { display: none; }

@media (max-width: 640px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: var(--bg-card); border-top: 1px solid var(--border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 18px rgba(0,0,0,.07);
  }
  .bottom-nav button {
    flex: 1; min-width: 0; min-height: 52px; background: none; border: none; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--text-tertiary); font: inherit; font-size: 10.5px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: color .12s, background .12s;
  }
  .bottom-nav button i { font-size: 22px; line-height: 1; }
  .bottom-nav button.active { color: var(--accent); background: var(--accent-light); font-weight: 600; }
  .bottom-nav button:active { transform: scale(.96); }
  /* El contenido y el "+" dejan lugar a la barra */
  .page { padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px)); }
  #fab { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .sidebar-overlay { z-index: 99; }
}

/* Tareas: el gesto de deslizar es horizontal; el scroll vertical sigue andando */
[data-swipe-tarea] { touch-action: pan-y; will-change: transform; }

/* Esqueletos de carga */
@keyframes lh-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row {
  height: 54px; border-radius: 10px; margin: 8px 0;
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%; animation: lh-shimmer 1.4s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-row { animation: none; }
  [data-swipe-tarea] { will-change: auto; }
}

/* Estados vacíos: más amables que una línea gris suelta */
.empty {
  text-align: center; color: var(--text-tertiary); font-size: 13px;
  padding: 1.6rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty > i { font-size: 30px; color: var(--accent); opacity: .55; }

/* ══════════════════════════════════════════════════════════════════════════
   ESCRITORIO (octubre 2026): bienvenida, tarjetas parejas, panel de tareas,
   menú con grupos plegables, escala para pantallas grandes, paleta de comandos.
   Todo vive en media queries de ≥1100px o en componentes nuevos: el celular
   no cambia.
   ══════════════════════════════════════════════════════════════════════════ */
kbd { font: 600 11px/1 inherit; font-family: inherit; padding: 2px 6px; border: 1px solid var(--border-md); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-secondary); color: var(--text-secondary); }

/* Barra de progreso fina en las tarjetas de métricas */
.metric-bar { height: 4px; border-radius: 3px; background: var(--border); margin-top: 8px; overflow: hidden; }
.metric-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .6s ease; }

/* Bienvenida del dashboard */
.dash-hero { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; margin-bottom: 1rem; }
.hero-main {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: var(--sidebar-bg); color: var(--sidebar-active);
  border-radius: 16px; padding: 1.5rem 1.75rem; position: relative; overflow: hidden;
}
.hero-main::after { content: ""; position: absolute; right: -50px; top: -70px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(61,186,112,.28), transparent 70%); pointer-events: none; }
.hero-text { position: relative; z-index: 1; min-width: 0; }
.hero-saludo { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.hero-frase { margin-top: 8px; font-size: 14px; color: var(--sidebar-text); max-width: 52ch; }
.hero-acciones { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.hero-acciones .btn-secondary { background: rgba(255,255,255,.1); color: var(--sidebar-active); border-color: rgba(255,255,255,.18); }
.hero-acciones .btn-secondary:hover { background: rgba(255,255,255,.18); }
.hero-acciones .btn-icon { color: var(--sidebar-text); }
.hero-acciones kbd { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: var(--sidebar-text); margin-left: 4px; }
.hero-anillo { position: relative; width: 130px; flex-shrink: 0; z-index: 1; text-align: center; }
.hero-anillo:empty { display: none; }
.anillo-fondo { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 12; }
.anillo-valor { fill: none; stroke: var(--sidebar-accent); stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.anillo-centro { position: absolute; top: 0; left: 0; width: 130px; height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.anillo-centro b { font-size: 26px; line-height: 1; }
.anillo-centro span { font-size: 11px; color: var(--sidebar-text); margin-top: 3px; }
.anillo-leyenda { font-size: 11px; color: var(--sidebar-text); margin-top: 6px; }
.hero-proximo {
  background: var(--accent-light); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.25rem 1.4rem; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  transition: border-color .15s, transform .1s;
}
.hero-proximo:hover { border-color: var(--accent); transform: translateY(-1px); }
.hp-label { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.hp-titulo { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.hp-sub { font-size: 13px; color: var(--text-secondary); }
.hp-tipo { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* Tarjetas del mismo alto dentro de cada fila */
.dash-widget { display: flex; flex-direction: column; }
.dash-widget > .card { flex: 1; }
.dash-widget > .metrics-grid { margin-bottom: 0; }

/* Tareas: alta rápida, grupos por fecha y panel lateral */
.qa-mas { margin-top: 8px; }
.qa-mas summary { font-size: 12px; color: var(--text-secondary); cursor: pointer; width: fit-content; }
.qa-mas summary:hover { color: var(--accent-text); }
.grupo-fecha { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 14px 6px 6px; }
.grupo-fecha:first-child { padding-top: 2px; }
.grupo-fecha em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--text-tertiary); background: var(--bg-secondary); border-radius: 99px; padding: 1px 8px; }
.grupo-venc { color: var(--red-text); }
.tarea-fila.seleccionada { background: var(--accent-light); box-shadow: inset 3px 0 0 var(--accent); }
.tarea-panel { display: none; }
@media (min-width: 1100px) {
  .tareas-layout.con-panel { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1rem; align-items: start; }
  .tareas-layout.con-panel .tarea-panel {
    display: flex; flex-direction: column; position: sticky; top: 0; max-height: calc(100vh - 52px - 2.5rem);
    background: var(--bg-card); border: 1px solid var(--border-md); border-radius: 12px; box-shadow: var(--shadow-card); overflow: hidden;
    animation: panelEntra .18s ease;
  }
  .tp-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: 14px; }
  .tp-body { padding: 1rem; overflow-y: auto; flex: 1; }
  .tp-foot { display: flex; gap: 8px; padding: .75rem 1rem; border-top: 1px solid var(--border); align-items: center; }
  .tp-foot .btn-icon { margin-left: auto; }
}
@keyframes panelEntra { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* Atajos */
.atajos-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; align-items: center; font-size: 13px; }

/* Menú lateral: grupos plegables */
.nav-section.plegable { cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; }
.nav-section.plegable::after { content: "\ea5f"; font-family: "tabler-icons"; font-size: 12px; opacity: .55; transition: transform .15s; }
.nav-section.plegable.plegada::after { transform: rotate(-90deg); }
.nav-item.oculto-grupo { display: none; }
.sidebar.collapsed .nav-item.oculto-grupo { display: flex; }
.sidebar.collapsed .nav-section.plegable::after { display: none; }

/* Escala y ancho máximo en pantallas grandes */
@media (min-width: 1360px) {
  .page { zoom: 1.08; }
  .topbar-title { font-size: 16px; }
}
@media (min-width: 1700px) {
  .page { zoom: 1.18; }
}
@media (min-width: 1100px) {
  .page { padding-left: max(1.5rem, calc((100% - 1500px) / 2)); padding-right: max(1.5rem, calc((100% - 1500px) / 2)); padding-top: 1.5rem; }
  .dash-widgets { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
  .metrics-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 1099px) { .dash-hero { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .hero-main { padding: 1.1rem 1.1rem; }
  .hero-anillo { display: none; }
  .hero-saludo { font-size: 21px; }
  .hero-acciones .btn-secondary { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tareas-layout .tarea-panel, .anillo-valor, .metric-bar i { animation: none; transition: none; } }
@media (min-width: 1100px) { #dash-metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.tarea-alta-rapida .form-row { align-items: stretch; }
.tarea-alta-rapida .form-row input, .tarea-alta-rapida .form-row select, .tarea-alta-rapida .form-row .btn-primary { min-height: 40px; }
@media (max-width: 700px) {
  .tarea-alta-rapida .form-row { flex-direction: column; align-items: stretch; }
  .tarea-alta-rapida .form-row > * { flex: 0 0 auto !important; width: 100%; }
  .hero-proximo { padding: .9rem 1.1rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
   LOOK RENOVADO (octubre 2026) — "Bricolage + verde bosque + sol"
   Se apoya en los mismos tokens de siempre (así siguen funcionando los
   acentos personalizables y el modo oscuro): cambia la paleta base verde,
   la tipografía de títulos y cifras, los radios y la calma visual.
   ══════════════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../vendor/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("../vendor/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root { --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --r-card: 20px; --r-ctl: 12px; --sun: #f4b942; --sun-text: #4a3200; }

:root, [data-theme="claro"] {
  --bg-page: #eceff0;  --bg-card: #ffffff;  --bg-secondary: #f3f6f4;  --bg-hover: #e6ece8;  --bg-input: #ffffff;
  --border: rgba(18,35,26,0.09);  --border-md: rgba(18,35,26,0.16);  --border-focus: #228b52;
  --text: #12231a;  --text-secondary: #566a5e;  --text-tertiary: #7f9186;  --text-muted: #a3b0a8;
  --accent: #228b52;  --accent-hover: #1a6e41;  --accent-light: #e2f3ea;  --accent-text: #166a3b;
  --sidebar-bg: #0f2a1d;  --sidebar-text: #a9c7b6;  --sidebar-hover: rgba(255,255,255,0.07);  --sidebar-accent: #4cd98a;
  --topbar-bg: transparent;
  --shadow: none;  --shadow-card: 0 1px 2px rgba(18,35,26,0.04);
}
[data-theme="oscuro"] {
  --bg-page: #0b130f;  --bg-card: #13201a;  --bg-secondary: #19291f;  --bg-hover: #213428;  --bg-input: #13201a;
  --border: rgba(255,255,255,0.08);  --border-md: rgba(255,255,255,0.14);
  --text: #e6f0ea;  --text-secondary: #92ad9b;  --text-tertiary: #62796a;
  --accent: #3fc77c;  --accent-hover: #34ab69;  --accent-light: #173325;  --accent-text: #4cd98a;  --border-focus: #3fc77c;
  --sidebar-bg: #08140d;  --sidebar-accent: #4cd98a;
  --topbar-bg: transparent;
  --shadow: none;  --shadow-card: none;
  --sun-text: #f6d78b;
}

/* Títulos y cifras con la tipografía de marca */
.topbar-title, .card-title, .metric-value, .logo-text, .hero-saludo, .hp-titulo, .anillo-centro b,
.modal-title, #modal-title, .weekly-title, h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; }
.metric-value { font-weight: 700; font-size: 30px; letter-spacing: -.02em; }
.card-title { font-weight: 600; font-size: 15px; }
.topbar-title { font-weight: 700; font-size: 18px; }

/* Superficies: más aire, radios generosos, sin sombras pesadas */
.page { background: transparent; }
.topbar { background: transparent; border-bottom: none; box-shadow: none; height: 60px; }
.card { border-radius: var(--r-card); padding: 1.25rem 1.5rem; box-shadow: var(--shadow-card); }
.card:hover { border-color: var(--border); }
.clickable-card:hover { border-color: var(--border-md) !important; box-shadow: 0 6px 20px rgba(18,35,26,0.07); transform: translateY(-1px); }
.metric-card, .metric-card.accent { background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 1rem 1.15rem; }
.metric-card[class*="mc-"] { border-top: 1px solid var(--border) !important; }
.metric-card.accent { border-left: 1px solid var(--border); }
.metric-label { font-size: 12px; font-weight: 500; }
.dash-widgets, .metrics-grid { gap: 1rem; }
.modal { border-radius: 24px; }
.modal-overlay { backdrop-filter: blur(3px); }

/* Controles */
input[type=text], input[type=number], input[type=date], input[type=email],
input[type=month], input[type=time], input[type=password], select, textarea { border-radius: var(--r-ctl); padding: 9px 12px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.btn-primary { border-radius: var(--r-ctl); font-weight: 600; }
.btn-secondary { border-radius: var(--r-ctl); }
.btn-sm { border-radius: 9px; }
.btn-icon { border-radius: 10px; }
.btn-primary:hover { box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.filter-btn { border-radius: 99px; }
.tag { border-radius: 99px; }
.checkbox { border-radius: 7px; }
.progress-bar, .progress-fill { border-radius: 99px; }
.row-item { padding: 11px 6px; }

/* Menú lateral: píldoras redondeadas en vez de barra con borde */
.sidebar-logo { border-bottom: none; padding: 1.4rem 1.2rem 1rem; }
.logo-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--sidebar-accent); color: var(--sidebar-bg); display: grid; place-items: center; font-size: 20px; }
.logo-text { font-size: 18px; font-weight: 700; }
.sidebar-user { border-bottom: none; background: rgba(255,255,255,0.05); margin: 0 .75rem .5rem; border-radius: 14px; padding: .6rem .75rem; }
.user-avatar { color: var(--sidebar-bg); font-weight: 700; }
nav { padding: .25rem .6rem; }
.nav-section { padding: .85rem .6rem .25rem; font-size: 10px; letter-spacing: .1em; }
.nav-item { border-left: none; border-radius: 12px; padding: 9px .75rem; margin: 1px 0; }
.nav-item.active { background: rgba(76,217,138,0.16); border-left: none; color: #fff; }
.nav-item.active i { color: var(--sidebar-accent); }
.sidebar.collapsed .nav-item { padding: 10px 0; border-right: none; margin: 2px 0; }
.sidebar.collapsed .nav-item.active { border-right: none; background: rgba(76,217,138,0.18); }
.sidebar.collapsed .sidebar-user { margin: 0 .4rem .5rem; padding: .4rem 0; justify-content: center; }
.sidebar.collapsed .sidebar-logo { padding: 1.2rem 0 .8rem; justify-content: center; }
.sidebar-footer button { border-radius: 12px; }

/* Bienvenida: "Lo próximo" en color sol, como en el mockup */
.hero-main { border-radius: 24px; padding: 1.9rem 2.1rem; background: var(--sidebar-bg); }
.hero-saludo { font-size: 32px; font-weight: 700; line-height: 1.05; letter-spacing: -.025em; }
.hero-frase { font-size: 15px; }
.hero-proximo { background: var(--sun); border: none; border-radius: 24px; padding: 1.5rem 1.6rem; color: var(--sun-text); justify-content: space-between; }
.hero-proximo:hover { border: none; transform: translateY(-2px); }
.hp-label { color: var(--sun-text); opacity: .75; font-size: 13px; }
.hp-titulo { font-size: 24px; color: var(--sun-text); line-height: 1.12; }
.hp-sub, .hp-tipo { color: var(--sun-text); opacity: .8; }
[data-theme="oscuro"] .hero-proximo { background: #3a2c0c; }
[data-theme="oscuro"] .hp-label, [data-theme="oscuro"] .hp-titulo, [data-theme="oscuro"] .hp-sub, [data-theme="oscuro"] .hp-tipo { color: var(--sun); opacity: 1; }
[data-theme="oscuro"] .hp-sub, [data-theme="oscuro"] .hp-tipo { opacity: .8; }
.metric-card .metric-value { font-size: 32px; }
.metric-bar { height: 5px; }
.metric-bar i { background: var(--accent); }

/* Panel de tareas con la misma piel */
@media (min-width: 1100px) { .tareas-layout.con-panel .tarea-panel { border-radius: var(--r-card); } }
.tarea-fila.seleccionada { border-radius: 10px; }
#fab { box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
[data-theme="oscuro"] .hero-main { background: linear-gradient(135deg, #123222, #0d2318); border: 1px solid var(--border); }
@media (max-width: 640px) {
  .hero-main { padding: 1.25rem 1.3rem; border-radius: 20px; }
  .hero-saludo { font-size: 24px; }
  .hero-proximo { border-radius: 20px; padding: 1.1rem 1.3rem; }
  .hp-titulo { font-size: 20px; }
  .card { padding: 1rem 1.1rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
   FINANZAS (octubre 2026): portada con "plata libre", asistente de gastos y
   secciones como tarjetas.
   ══════════════════════════════════════════════════════════════════════════ */
.fin-titulo { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.fin-resumen-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

.fin-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; margin-bottom: 1rem; }
.fh-main { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; background: var(--sidebar-bg); color: var(--sidebar-active); border-radius: 24px; padding: 1.8rem 2.1rem; position: relative; overflow: hidden; min-height: 170px; }
.fh-main::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(76,217,138,.25), transparent 70%); pointer-events: none; }
[data-theme="oscuro"] .fh-main { background: linear-gradient(135deg, #123222, #0d2318); border: 1px solid var(--border); }
.fh-texto { position: relative; z-index: 1; min-width: 0; }
.fh-label { font-size: 13px; color: var(--sidebar-text); }
.fh-cifra { font-family: var(--font-display); font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.fh-cifra.neg { color: #ff9b8f; }
.fh-sub { font-size: 14px; color: var(--sidebar-text); max-width: 46ch; }
.fh-anillo { position: relative; width: 120px; height: 120px; flex-shrink: 0; z-index: 1; }
.anillo-valor.alerta { stroke: #ffb4a8; }
.fh-prox { background: var(--sun); color: var(--sun-text); border-radius: 24px; padding: 1.5rem 1.6rem; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
[data-theme="oscuro"] .fh-prox { background: #3a2c0c; color: var(--sun); }
.fh-prox .hp-label, .fh-prox .hp-titulo, .fh-prox .hp-sub, .fh-prox .hp-tipo { color: inherit; }

/* Asistente de gastos */
.asistente-gasto { border: 1px solid var(--border-md); }
.asg-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.asg-form .btn-primary { min-height: 40px; padding: 0 20px; }
.asg-urgencia { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.asg-res { display: flex; gap: 1.1rem; margin-top: 1.1rem; padding: 1.2rem 1.3rem; border-radius: 18px; border: 1px solid var(--border); animation: panelEntra .22s ease; }
.asg-verde { background: var(--green-bg); border-color: color-mix(in srgb, var(--green-text) 30%, transparent); }
.asg-amarillo { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber-text) 30%, transparent); }
.asg-rojo { background: var(--red-bg); border-color: color-mix(in srgb, var(--red-text) 30%, transparent); }
.asg-gris { background: var(--bg-secondary); }
.asg-semaforo { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; flex-shrink: 0; color: #fff; background: var(--text-tertiary); }
.asg-verde .asg-semaforo { background: var(--green-text); }
.asg-amarillo .asg-semaforo { background: var(--amber-text); }
.asg-rojo .asg-semaforo { background: var(--red-text); }
.asg-cuerpo { min-width: 0; flex: 1; }
.asg-titulo { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.asg-verde .asg-titulo { color: var(--green-text); } .asg-amarillo .asg-titulo { color: var(--amber-text); } .asg-rojo .asg-titulo { color: var(--red-text); }
.asg-resumen { font-size: 14px; color: var(--text); margin-top: 3px; max-width: 70ch; }
.asg-impacto { display: flex; align-items: center; gap: 14px; margin: 12px 0 4px; flex-wrap: wrap; }
.asg-impacto div { display: flex; flex-direction: column; }
.asg-impacto span { font-size: 11px; color: var(--text-secondary); }
.asg-impacto b { font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }
.asg-impacto b.neg { color: var(--red-text); }
.asg-impacto > i { color: var(--text-tertiary); }
.asg-motivos { list-style: none; margin: 10px 0 0; display: grid; gap: 7px; }
.asg-motivos li { display: flex; gap: 9px; font-size: 13px; line-height: 1.45; max-width: 80ch; }
.asg-motivos i { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.asg-motivos .m-ok i { color: var(--green-text); } .asg-motivos .m-warn i { color: var(--amber-text); } .asg-motivos .m-bad i { color: var(--red-text); }
.asg-sug { margin-top: 12px; font-size: 13px; }
.asg-sug b { font-family: var(--font-display); font-size: 14px; }
.asg-sug ul { margin: 4px 0 0 18px; display: grid; gap: 4px; max-width: 80ch; }
.asg-acciones { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.asg-aviso { font-size: 11px; color: var(--text-tertiary); margin-top: 10px; }

/* Secciones inferiores (registrar, cuentas, tarjetas, categorías, créditos, movimientos) como tarjetas */
#page-finanzas > [data-sid] {
  background: var(--bg-card); border: 1px solid var(--border) !important; border-radius: var(--r-card);
  padding: 1.1rem 1.4rem !important; margin-top: 1rem !important;
}
#page-finanzas > [data-sid] > h2 { font-family: var(--font-display); font-size: 16px !important; font-weight: 600 !important; }
#page-finanzas > [data-sid] .tw-bg-\[var\(--bg-card\)\] { background: var(--bg-secondary); border-radius: 16px; }
.fin-historial-row { padding: 11px 6px; }

@media (max-width: 1099px) { .fin-hero { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .asg-form { grid-template-columns: 1fr 1fr; }
  .asg-form #asg-desc { grid-column: 1 / -1; }
  .asg-form .btn-primary { grid-column: 1 / -1; min-height: 44px; }
  .asg-res { flex-direction: column; gap: .7rem; padding: 1rem; }
  .fh-main { padding: 1.3rem; flex-direction: column; align-items: flex-start; }
  .fh-cifra { font-size: 36px; }
  .fh-anillo { align-self: flex-end; margin-top: -4.5rem; }
}
.asg-sug ul { list-style: disc; }
.dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dash-grid > *, .chart-wrap { min-width: 0; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .fh-anillo { display: none; } }

/* ═══════════════════════════════════════════════════════════════════════════
   SALUD (octubre 2026): portada "Tu día de salud", tomas, métricas, turnos
   ══════════════════════════════════════════════════════════════════════════ */
.salud-hero { margin-top: .25rem; }
.salud-avisos { display: grid; gap: 8px; margin-bottom: 1rem; }
.salud-aviso { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; font-size: 13px; border: 1px solid var(--border); background: var(--bg-card); }
.salud-aviso i { font-size: 18px; flex-shrink: 0; }
.salud-aviso.av-warn { background: var(--amber-bg); color: var(--amber-text); border-color: color-mix(in srgb, var(--amber-text) 25%, transparent); }
.salud-aviso.av-bad { background: var(--red-bg); color: var(--red-text); border-color: color-mix(in srgb, var(--red-text) 25%, transparent); }

.salud-tomas-card { padding-bottom: .6rem; }
.toma-grupo + .toma-grupo { margin-top: 10px; }
.toma-grupo-t { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text-secondary); margin: 4px 2px 6px; }
.toma-fila { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; border: 1px solid transparent; }
.toma-fila + .toma-fila { margin-top: 4px; }
.toma-fila:hover { background: var(--bg-secondary); }
.toma-check { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border-md); background: transparent; color: var(--text-tertiary); display: grid; place-items: center; font-size: 20px; cursor: pointer; flex-shrink: 0; transition: background .15s, border-color .15s, color .15s; }
.toma-check:hover { border-color: var(--accent); color: var(--accent); }
.toma-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toma-tomada .toma-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.toma-tomada .toma-nombre { text-decoration: line-through; color: var(--text-tertiary); }
.toma-atrasada .toma-check { border-color: var(--amber-text); color: var(--amber-text); }
.toma-atrasada .toma-det { color: var(--amber-text); }
.toma-ahora { background: var(--green-bg); }
.toma-ahora .toma-check { border-color: var(--accent); color: var(--accent); }
.toma-info { min-width: 0; }
.toma-nombre { font-weight: 600; font-size: 14px; }
.toma-nombre span { font-weight: 400; color: var(--text-secondary); font-size: 12px; margin-left: 4px; }
.toma-det { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

/* Métricas: tarjetas con mini gráfico y tendencia (sin juzgar el valor) */
.met-resumen { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.met-resumen:empty { display: none; }
.met-card { text-align: left; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 16px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, transform .15s; }
.met-card:hover { border-color: var(--accent); }
.met-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.met-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.met-card-t { font-size: 12px; color: var(--text-secondary); }
.met-card-v { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.met-card-v small { font-size: 12px; font-weight: 400; color: var(--text-secondary); letter-spacing: 0; }
.met-card-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--accent); min-height: 28px; }
.met-tend { font-size: 11px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.met-card-d { font-size: 11px; color: var(--text-tertiary); }

/* Turnos como línea de tiempo */
.turnos-linea { position: relative; padding-left: 18px; margin-bottom: 1.2rem; }
.turnos-linea::before { content: ""; position: absolute; left: 5px; top: 26px; bottom: 6px; width: 2px; background: var(--border-md); border-radius: 2px; }
.turnos-linea-t { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.turnos-linea .turno-card { position: relative; }
.turnos-linea .turno-card::before { content: ""; position: absolute; left: -18px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-page); border: 2px solid var(--border-md); }
.turnos-linea .turno-prox::before { border-color: var(--accent); background: var(--accent); }
.turno-pasado { opacity: .85; }
.turno-cuando { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--bg-secondary); color: var(--text-secondary); margin-left: 8px; white-space: nowrap; }
.turno-cuando.cerca { background: var(--sun); color: var(--sun-text); }

@media (max-width: 760px) {
  .salud-hero .fh-main { padding: 1.3rem; }
  .met-resumen { grid-template-columns: 1fr 1fr; }
  .toma-check { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .toma-check, .met-card { transition: none; } }

/* ═══════════════════════════════════════════════════════════════════════════
   HOY y HÁBITOS (octubre 2026)
   ══════════════════════════════════════════════════════════════════════════ */
.hoy-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.hoy-cols > .hidden { display: none; }
.hoy-cols:has(#hoy-habitos-wrap.hidden) { grid-template-columns: minmax(0, 1fr); }
.hoy-fila { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--border); border-radius: 14px; }
.hoy-fila:first-child { border-top: 0; }
.hoy-fila.ahora { background: var(--green-bg); border-top-color: transparent; }
.hoy-hora { width: 46px; font-size: 13px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.hoy-punto { width: 28px; height: 28px; flex-shrink: 0; position: relative; }
.hoy-punto::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--border-md); }
.hoy-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-md); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; padding: 0; font-size: 15px; transition: background .15s, border-color .15s; }
.hoy-check:hover { border-color: var(--accent); }
.hoy-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hoy-check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hoy-tx { flex: 1; min-width: 0; font-size: 14px; }
.hoy-tx b { font-weight: 600; }
.hoy-tx small { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.hoy-fila.done .hoy-tx b { text-decoration: line-through; color: var(--text-tertiary); font-weight: 500; }
.hoy-sep { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text-secondary); margin: 12px 8px 2px; }
.hoy-hab { display: flex; align-items: center; gap: 12px; padding: 8px 2px; font-size: 14px; }
.hoy-hab.done span { color: var(--text-tertiary); }
.hoy-hab span i { color: var(--accent); margin-right: 4px; }

.hab-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.hab-lado { display: grid; gap: 1rem; min-width: 0; }
.hg { display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(7, minmax(34px, 1fr)) 104px; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.hg-head { border-top: 0; padding-top: 0; font-size: 12px; color: var(--text-secondary); text-align: center; }
.hg-head span:first-child { text-align: left; }
.hg-head .hoy { color: var(--accent); font-weight: 700; }
.hn { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; min-width: 0; }
.hn > i { color: var(--accent); font-size: 18px; flex-shrink: 0; }
.hn small { display: block; font-weight: 400; font-size: 12px; color: var(--text-secondary); }
.hd { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border-md); background: transparent; margin: 0 auto; padding: 0; cursor: pointer; display: grid; place-items: center; color: transparent; font-size: 16px; transition: background .15s; }
.hd:hover:not(:disabled) { border-color: var(--accent); }
.hd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hd.hoy { border-color: var(--accent); }
.hd.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hd.off { border: 2px dashed var(--border); cursor: default; }
.hr { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--amber-text); text-align: right; position: relative; padding-right: 2px; }
.hr small { font: 400 11px var(--font-body, inherit); color: var(--text-secondary); margin-left: 3px; }
.hr .hacts { display: none; position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: var(--bg-card); gap: 0; }
.hg:hover .hr .hacts, .hg:focus-within .hr .hacts { display: flex; }
.hab-heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; }
.hab-heat i { aspect-ratio: 1; border-radius: 5px; background: var(--bg-secondary); min-width: 0; }
.hab-heat i.a { background: #bfe3cc; } .hab-heat i.b { background: #7cc79b; } .hab-heat i.c { background: var(--accent); }
[data-theme="oscuro"] .hab-heat i.a { background: #2a5a3f; } [data-theme="oscuro"] .hab-heat i.b { background: #3a8a5c; } [data-theme="oscuro"] .hab-heat i.c { background: #4cd98a; }

@media (max-width: 1099px) { .hoy-cols, .hab-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .hoy-hora { width: 40px; font-size: 12px; }
  .hoy-fila .tag { display: none; }
  .hoy-check, .hoy-punto { width: 32px; height: 32px; }
  .hg { grid-template-columns: minmax(0, 1fr) repeat(7, 30px); gap: 3px; }
  .hg .hn { grid-column: 1 / -1; }
  .hg .hr { grid-column: 1 / -1; text-align: left; }
  .hg-head { display: none; }
  .hd { width: 34px; height: 34px; }
  .hr .hacts { display: flex; position: static; transform: none; float: right; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   METAS (octubre 2026)
   ══════════════════════════════════════════════════════════════════════════ */
.metas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 1rem; }
.metas-grid .meta-card { display: flex; flex-direction: column; gap: 12px; margin: 0; border-radius: var(--r-card); }
.metas-grid .meta-card.riesgo { border-color: color-mix(in srgb, var(--amber-text) 40%, transparent); }
.metas-grid .meta-header { align-items: flex-start; gap: 12px; }
.metas-grid .meta-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.meta-pct { font-family: var(--font-display); font-weight: 700; font-size: 36px; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.meta-pct.riesgo { color: var(--amber-text); }
.progress-fill.riesgo { background: var(--amber-text); }
.meta-kr { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.meta-kr > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-kr .progress-bar { width: 110px; flex-shrink: 0; }
.meta-kr b { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.meta-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.meta-chips:empty { display: none; }
.metas-grid .meta-actions { opacity: .6; } .metas-grid .meta-card:hover .meta-actions, .metas-grid .meta-actions:focus-within { opacity: 1; }
@media (max-width: 760px) { .meta-pct { font-size: 28px; } .meta-kr .progress-bar { width: 70px; } .metas-grid .meta-actions { opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDARIO (octubre 2026): mes + agenda lateral
   ══════════════════════════════════════════════════════════════════════════ */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.cal-agenda-card { position: sticky; top: 1rem; }
.ag-dia { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.ag-dia:first-of-type { border-top: 0; }
.ag-f { width: 50px; flex-shrink: 0; text-align: center; border-radius: 14px; background: var(--bg-secondary); padding: 6px 0; align-self: flex-start; }
.ag-dia.hoy .ag-f { background: var(--accent); color: #fff; }
.ag-f b { display: block; font-family: var(--font-display); font-size: 21px; line-height: 1; }
.ag-f span { font-size: 11px; }
.ag-items { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ag-it { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.35; }
.ag-it .tag { flex-shrink: 0; margin-top: 1px; }
@media (max-width: 1099px) { .cal-layout { grid-template-columns: minmax(0, 1fr); } .cal-agenda-card { position: static; } }

/* DEPORTE (octubre 2026) */
.dep-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.dep-dia { border-radius: 16px; border: 1px solid var(--border); padding: 10px 6px; text-align: center; background: var(--bg-card); font-size: 12px; color: var(--text-secondary); min-width: 0; }
.dep-dia b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--text); margin: 4px 0 2px; }
.dep-dia small { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-dia.on { background: var(--green-bg); border-color: color-mix(in srgb, var(--green-text) 30%, transparent); }
.dep-dia.on b { color: var(--green-text); }
.dep-dia.hoy { border: 2px solid var(--accent); }
@media (max-width: 760px) { .dep-semana { gap: 4px; } .dep-dia { padding: 8px 2px; } .dep-dia b { font-size: 16px; } .dep-dia small { display: none; } }

/* ALIMENTACIÓN (octubre 2026) */
.ali-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; align-items: stretch; }
.ali-duo > .card { margin: 0 !important; }
.fh-de { font-size: 22px; font-weight: 500; color: var(--sidebar-text); letter-spacing: 0; }
@media (max-width: 900px) { .ali-duo { grid-template-columns: minmax(0, 1fr); } }

/* PROYECTOS (octubre 2026): tablero */
.kan { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 14px; align-items: start; }
.kc { background: var(--bg-secondary); border-radius: var(--r-card); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kc > h3 { font-family: var(--font-display); font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; margin: 0; }
.kc > h3 span { font: 600 12px var(--font-body, inherit); background: var(--bg-card); border-radius: 20px; padding: 1px 9px; color: var(--text-secondary); }
.kc-vacio { font-size: 12px; color: var(--text-tertiary); text-align: center; padding: 14px 4px; border: 1px dashed var(--border-md); border-radius: 14px; }
.pc { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 13px 14px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.pc.rie { border-color: color-mix(in srgb, var(--amber-text) 45%, transparent); }
.pc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pc-top b { font-size: 14px; line-height: 1.3; }
.pc-acts { display: flex; opacity: 0; flex-shrink: 0; margin: -4px -6px 0 0; }
.pc:hover .pc-acts, .pc:focus-within .pc-acts { opacity: 1; }
.pc-m { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
@media (max-width: 1099px) { .kan { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kan { grid-template-columns: minmax(0, 1fr); } .pc-acts { opacity: 1; } }

/* SUSCRIPCIONES (octubre 2026) */
.sub-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.sub-lado { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sub-fila { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--border); }
.sub-fila:first-child { border-top: 0; }
.sub-fila.off { opacity: .55; }
.sub-lg { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 700 16px var(--font-display); color: #fff; flex-shrink: 0; }
.sub-n { flex: 1; min-width: 0; }
.sub-n b { display: block; font-size: 14px; }
.sub-n small, .sub-pr small { display: block; font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-cu { min-width: 84px; text-align: center; }
.sub-pr { text-align: right; min-width: 96px; font-variant-numeric: tabular-nums; }
.sub-pr b { font-size: 14px; }
.sub-acts { display: flex; flex-shrink: 0; }
.sub-sep { font: 600 12px var(--font-display); color: var(--text-tertiary); margin: 14px 0 2px; }
.sub-stack { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 4px 0 8px; }
.sub-stack i { display: block; height: 100%; }
.sub-cat { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-top: 10px; }
.sub-cat i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sub-cat span { flex: 1; }
.sub-cat b { font-variant-numeric: tabular-nums; }
@media (max-width: 1099px) { .sub-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .sub-fila { flex-wrap: wrap; row-gap: 6px; }
  .sub-n { flex-basis: calc(100% - 56px); }
  .sub-cu { order: 3; min-width: 0; }
  .sub-pr { order: 4; text-align: left; flex: 1; }
  .sub-acts { order: 5; }
}

/* NOTAS (octubre 2026) */
.notas-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.notas-busq { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border-md); border-radius: 14px; padding: 0 14px; min-height: 44px; flex: 1; max-width: 520px; color: var(--text-tertiary); }
.notas-busq input { border: 0; background: transparent; flex: 1; min-width: 0; padding: 10px 0; font-size: 14px; color: var(--text); outline: none; }
.notas-busq:focus-within { border-color: var(--accent); }
.notas-sec { font: 600 13px var(--font-display); color: var(--text-secondary); margin: 14px 2px 8px; display: flex; align-items: center; gap: 6px; }
.nota-card { border-radius: 18px; }
.nota-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nota-card.pinned { border-style: solid; }

/* CONFIGURACIÓN (octubre 2026): menú lateral por grupos */
.cfg-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.cfg-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 12px; }
.cfg-nav button { text-align: left; padding: 10px 14px; border-radius: 12px; font: 500 14px var(--font-body, inherit); color: var(--text-secondary); background: transparent; border: 1px solid transparent; cursor: pointer; min-height: 44px; }
.cfg-nav button:hover { background: var(--bg-secondary); }
.cfg-nav button.on { background: var(--bg-card); border-color: var(--border); color: var(--text); font-weight: 600; }
.cfg-contenido { min-width: 0; }
@media (max-width: 760px) {
  .cfg-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cfg-nav { flex-direction: row; overflow-x: auto; position: static; gap: 6px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .cfg-nav button { white-space: nowrap; border-color: var(--border); flex-shrink: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   ARREGLOS NOV 2026 (etapa 1). Este bloque va al final a proposito: las
   reglas de arriba estan repetidas en varios lugares y se pisaban.
   ═══════════════════════════════════════════════════════════════════ */

/* Desplegables y cuadros de texto: tailwind.css (que se carga despues)
   les dejaba padding 0 y sin borde, porque "select"/"textarea" solos tienen
   la misma prioridad que su reset. "html select" pesa un poco mas. */
html select, html textarea {
  background: var(--bg-input); border: 1px solid var(--border-md);
  border-radius: var(--r-ctl, 8px); padding: 9px 12px; font-size: 13px;
  color: var(--text); font-family: inherit; width: 100%;
}
html select { min-height: 40px; }
html textarea { line-height: 1.6; }

/* Calendario mensual: 7 columnas iguales aunque un evento tenga texto largo
   (antes el sabado y el domingo quedaban afuera). */
.cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid > * { min-width: 0; }
/* Eventos del mes y de la semana: un solo juego de colores, con los tokens
   del tema (se ven bien en claro y en oscuro). */
.cal-grid .cal-event, .cal-week-item {
  background: var(--green-bg); color: var(--green-text);
  border-left: 3px solid var(--accent); font-weight: 500;
}
.cal-grid .cal-event.ce-tarea, .cal-week-item.ce-tarea { background: var(--amber-bg); color: var(--amber-text); border-left-color: var(--amber-text); }
.cal-grid .cal-event.ce-turno, .cal-week-item.ce-turno { background: var(--red-bg); color: var(--red-text); border-left-color: var(--red-text); }
.cal-grid .cal-event.ce-examen, .cal-week-item.ce-examen { background: var(--purple-bg); color: var(--purple-text); border-left-color: var(--purple-text); }
.cal-week-item.ce-deporte { background: var(--blue-bg); color: var(--blue-text); border-left-color: var(--blue-text); }
.cal-week-item.ce-estudio, .cal-week-item.ce-repaso { background: var(--teal-bg); color: var(--teal-text); border-left-color: var(--teal-text); }
.cal-week-item.ce-alimentacion { background: var(--teal-bg); color: var(--teal-text); border-left-color: var(--teal-text); }
.cal-grid .cal-event.ce-trabajo { background: var(--blue-bg); color: var(--blue-text); border-left-color: var(--blue-text); }
.cal-grid .cal-event.ce-social { background: var(--teal-bg); color: var(--teal-text); border-left-color: var(--teal-text); }
.cal-grid .cal-event.ce-tarea_done { background: var(--bg-secondary); color: var(--text-tertiary); border-left-color: var(--border-md); text-decoration: line-through; }
/* Referencias (los puntitos de la leyenda), mismos colores que los eventos */
.cal-dot.ce-evento { background: var(--accent); }
.cal-dot.ce-tarea { background: var(--amber-text); }
.cal-dot.ce-turno { background: var(--red-text); }
.cal-dot.ce-deporte { background: var(--blue-text); }
.cal-dot.ce-estudio { background: var(--teal-text); }
.cal-dot.ce-examen { background: var(--purple-text); }

/* "Sistema personal" debajo del nombre: se perdia sobre el verde oscuro. */
.sidebar .user-role { opacity: 1; color: rgba(255, 255, 255, 0.72); }

/* Tarjetas plegadas ("Nuevo habito", "Nueva nota"...): sin el aire de abajo. */
[data-sid].collapsed > .card-header { margin-bottom: 0; }

/* Horario de un recordatorio: solo si el recordatorio esta activado. */
.form-group:has(> label input[type=checkbox]:not(:checked)) > input[type=time] { display: none; }

/* Selector de mes completo ("noviembre de 2026") y controles nativos
   (calendario, reloj) legibles en el tema oscuro. */
input[type=month] { min-width: 180px; }
[data-theme="oscuro"] { color-scheme: dark; }

/* Que el boton + no tape lo ultimo de la pagina en la compu. */
@media (min-width: 769px) {
  .page { padding-bottom: 6rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   ARREGLOS NOV 2026 (etapa 2): celular, toques y teclado
   ═══════════════════════════════════════════════════════════════════ */

/* Teclado: se ve donde esta parado el foco (antes varios outline:none lo
   escondian). Solo con teclado, no al tocar con el mouse o el dedo. */
:where(button, a, [role=button], [onclick], .hd, .checkbox, summary):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Lo recien marcado se ve hecho enseguida (ver _alInstante en app.js). */
.hoy-fila.done .hoy-tx b { color: var(--text-tertiary); text-decoration: line-through; }
.focus-item.done { opacity: .5; text-decoration: line-through; }

@media (max-width: 760px) {
  /* Habitos: 7 columnas iguales para los dias (antes los circulos se
     pisaban) y la fila de dias (Lu ... Do) visible arriba. */
  .hg { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .hg-head { display: grid; padding-bottom: 2px; }
  .hg-head span:first-child, .hg-head span:last-child { display: none; }
  .hd { width: 38px; height: 38px; }

  /* Tarjetas grandes de arriba mas compactas: lo util aparece antes. */
  .fh-main { min-height: 0; padding: 1.1rem 1.2rem; gap: .5rem; }
  .fh-cifra { font-size: 32px; margin: 2px 0 4px; }
  .fh-prox { padding: 1rem 1.2rem; }

  /* Toques: 40 px como minimo en botones chicos y filtros. */
  .btn-icon { min-width: 40px; min-height: 40px; }
  .filter-btn, .chip { min-height: 38px; }
  .hoy-check, .hoy-punto { width: 36px; height: 36px; }
  .cal-event { font-size: 9px; }
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD (reordenado nov 2026)
   ═══════════════════════════════════════════════════════════════════ */
/* Rachas de habitos: nombre | 7 dias | racha | check de hoy */
.dwh { display: grid; grid-template-columns: minmax(150px, 1.4fr) repeat(7, minmax(26px, .35fr)) 64px 36px; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid var(--border); }
.dwh.dwh-cab { border-top: 0; padding: 0 0 2px; font-size: 11px; color: var(--text-tertiary); text-align: center; }
.dwh.dwh-cab .hoy { color: var(--accent-text); font-weight: 700; }
.dwh-nombre { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; min-width: 0; }
.dwh-nombre span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dwh-nombre i { color: var(--accent); font-size: 16px; flex-shrink: 0; }
.dwh-dia { width: 22px; height: 22px; border-radius: 50%; margin: 0 auto; border: 2px solid var(--border-md); box-sizing: border-box; }
.dwh-dia.on { background: var(--accent); border-color: var(--accent); }
.dwh-dia.hoy:not(.on) { border-color: var(--accent); }
.dwh-racha { font-size: 12px; font-weight: 600; color: var(--amber-text); text-align: right; white-space: nowrap; }
.dwh-racha i { font-size: 13px; }
.dwh .hoy-check { margin-left: auto; }

/* "Ver mas" plegable (actividad reciente) */
.dw-mas > summary { cursor: pointer; list-style: none; padding: 10px 6px 2px; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.dw-mas > summary::-webkit-details-marker { display: none; }
.dw-mas > summary::before { content: "▸ "; }
.dw-mas[open] > summary::before { content: "▾ "; }

@media (max-width: 760px) {
  .dwh { grid-template-columns: repeat(7, minmax(0, 1fr)) 56px 40px; }
  .dwh .dwh-nombre { grid-column: 1 / -1; }
  .dwh.dwh-cab > span:first-child { display: none; }
}

/* ── Configuracion > Sonidos (nov 2026) ───────────────────────────── */
.snd { display: flex; flex-direction: column; gap: 10px; }
.snd label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.snd label small { color: var(--text-secondary); font-weight: 400; }
.snd .snd-titulo { font-weight: 600; font-size: 14px; }
.snd-fila { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.snd-fila input[type=range] { flex: 1; max-width: 260px; accent-color: var(--accent); }
.snd-grupo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.snd-grupo > label { flex: 1 1 240px; }
html .snd-grupo select { width: auto; min-width: 140px; }
.snd-horas { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.snd-horas input[type=time] { width: auto; }
/* Sin "Sonidos" activado, el resto queda apagado a la vista. */
.snd:has(#snd-activo:not(:checked)) > :not(.snd-titulo) { opacity: .45; }

