/* ============================== HABITS MODULE STYLES ==============================
   Companion to features/habits/habits.js. The habits table toolbar/wrap/.pbar/
   .note-trigger/.ht-btn shell and habit-notes (.hn-*) grid already live in
   agenda-overlays.css (ported verbatim in sub-phase B); this file adds the
   bits specific to the columns-overlay drag-list + per-cell theming tweaks
   for the dark surface used by v3. */

/* ─── Habits table per-row classes (was inline-style in v2; promoted here
   so JSX stays clean and themeable) ────────────────────────────── */
.ht-wrap td .hab-day-label {
  width: 80px;
  border: none;
  background: transparent;
  font-weight: 500;
  color: var(--text);
}
.ht-wrap td .hab-num,
.ht-wrap td .hab-text {
  width: 60px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
  background: var(--bg);
  color: var(--text);
}
.ht-wrap td.hab-media {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.ht-wrap td.hab-progress-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ht-wrap td.hab-idx {
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}
.ht-wrap td.hab-day-cell {
  text-align: left;
}

/* ─── Column list (columns-overlay) ──────────────────────────────── */
.co-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin: 4px 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  font-size: 13px;
  transition: border-color .12s, background .12s;
}
.co-item:hover {
  border-color: var(--primary);
}
.co-item.builtin {
  opacity: .85;
}
.clo-drag-handle {
  cursor: grab;
  opacity: .3;
  font-size: 14px;
  margin-right: 2px;
  user-select: none;
}
.clo-type-badge {
  font-size: 8px;
  text-transform: uppercase;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.clo-label {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}
.clo-edit {
  margin-left: auto;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  opacity: .4;
  transition: opacity .12s;
}
.clo-edit:hover { opacity: 1; }
.clo-del {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  opacity: .4;
  transition: opacity .12s;
}
.clo-del:hover { opacity: 1; }

/* ─── Edit-in-place inputs (label + type select) ────────────────── */
.clo-edit-input {
  width: 100px;
  padding: 4px 6px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.clo-edit-type {
  padding: 3px 4px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  font-size: 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

/* ─── Legacy single-note overlay (#note-overlay) — ported from v2 for
   the noteOpen()/noteClose() hooks. The new per-habit notes grid uses
   .hn-* (in agenda-overlays.css). ──────────────────────────────── */
#note-overlay .omodal {
  max-width: 520px;
}
#note-overlay .omodal-body textarea {
  min-height: 200px;
}

/* ============================== LIGHT-MODE CONTRAST — HÁBITOS REGISTER ==============================
   Scoped fix for the "📋 Seguimiento Diario" weekly register only (the
   ht-* shell defined in agenda-overlays.css + the hab-*/pct-* row classes
   defined above). In light mode the empty checkboxes, table borders,
   separators and labels were too faint on the cream paper background.
   Everything here is gated under html[data-theme="light"], so the default
   dark / retro theme is untouched. No layout or JS changes. */

/* 1) Table shell + row separators: solid medium-gray lines on cream */
html[data-theme="light"] .ht-wrap {
  border: 1.5px solid #8a8578;
}
html[data-theme="light"] .ht-wrap td {
  border-bottom: 1px solid #b3ad9d;
  color: #2f2f35;
}

/* 2) Header row: slightly darker paper + strong ink text so it stands out */
html[data-theme="light"] .ht-wrap th {
  background: #e2ded0;
  color: #2f2f35;
  font-weight: 700;
  border-bottom: 1.5px solid #8a8578;
}

/* 3) Cell inputs + labels readable (dark ink on light paper) */
html[data-theme="light"] .ht-wrap td .hab-num,
html[data-theme="light"] .ht-wrap td .hab-text {
  border: 1px solid #8a8578;
  background: #fffdf6;
  color: #2f2f35;
}
html[data-theme="light"] .ht-wrap td .hab-day-label {
  color: #2f2f35;
  font-weight: 600;
}
html[data-theme="light"] .ht-wrap td.hab-idx,
html[data-theme="light"] .ht-wrap td.hab-media {
  color: #4a463c;
}

/* 4) % counter + progress track readable on the light background */
html[data-theme="light"] .ht-wrap .pct-label {
  color: #2f6f4f;
  font-weight: 700;
}
html[data-theme="light"] .ht-wrap .pbar {
  background: #d8d4c8;
}

/* 5) Checkboxes: visible empty box (medium-gray border) and a strong green
   check when ticked. appearance:none is required for the border and the SVG
   checkmark to render consistently; size stays 15px so layout is unchanged. */
html[data-theme="light"] .ht-wrap td input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid #8a8578;
  border-radius: 3px;
  background: #fffdf6;
  cursor: pointer;
  vertical-align: middle;
}
html[data-theme="light"] .ht-wrap td input[type="checkbox"]:checked {
  background-color: #2f6f4f;
  border-color: #2f6f4f;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

/* 6) Toolbar label ("📋 Registro") + note trigger readable */
html[data-theme="light"] .ht-toolbar .ht-label,
html[data-theme="light"] .ht-wrap .note-trigger {
  color: #2f2f35;
}