:root {
  color-scheme: dark;
  --bg: #0d0b14;
  --bg-soft: #12101c;
  --surface: #18152a;
  --surface-raised: #1e1a32;
  --surface-muted: #251f3e;
  --text: #ede9f8;
  --muted: #9b90c4;
  --line: rgba(167, 139, 250, .16);
  --line-strong: rgba(167, 139, 250, .42);
  --primary: #a78bfa;
  --primary-ink: #1e0a3c;
  --accent: #f59e0b;
  --violet: #c084fc;
  --green: #34d399;
  --red: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 18px 44px rgba(0, 0, 0, .32);
  --radius: 14px;
  --sidebar-width: 254px;
}

.theme-light {
  color-scheme: light;
  --bg: #f5f3ff;
  --bg-soft: #ede9fe;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #f0ebff;
  --text: #1e1438;
  --muted: #6d5fa0;
  --line: rgba(109, 40, 217, .13);
  --line-strong: rgba(124, 58, 237, .38);
  --primary: #7c3aed;
  --primary-ink: #ffffff;
  --accent: #b45309;
  --violet: #9333ea;
  --green: #059669;
  --red: #e11d48;
  --warning: #a16207;
  --shadow: 0 18px 40px rgba(109, 40, 217, .10);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(167, 139, 250, .09), transparent 34rem),
    linear-gradient(240deg, rgba(245, 158, 11, .06), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

p,
strong,
span,
small,
a,
td,
th,
dd {
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 70%, white);
  outline-offset: 2px;
}

.mobile-menu-button,
.nav-scrim {
  display: none;
}

.sidebar {
  position: fixed;
  inset: 12px auto 12px 12px;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, black);
  box-shadow: var(--shadow);
}

.theme-light .sidebar {
  background: rgba(255, 255, 255, .94);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 8px 13px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: var(--primary-ink);
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

.brand small,
.muted,
.eyebrow,
.idea-list span,
.stack-list span,
.note-card span {
  color: var(--muted);
}

.nav-list,
.sidebar-footer,
.stack-list,
.idea-list {
  display: grid;
  gap: 6px;
}

.nav-list {
  overflow: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary) 55%, transparent) transparent;
}

.nav-list a,
.sidebar-footer a,
.sidebar-footer button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.nav-list a::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  opacity: .5;
}

.nav-list a.is-active,
.nav-list a:hover,
.sidebar-footer a:hover,
.sidebar-footer button:hover {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--text);
}

.nav-list a.is-active::before {
  opacity: 1;
  background: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-muted);
}

.user-chip span {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--avatar-color, var(--primary));
  color: #061016;
  font-size: 13px;
  font-weight: 900;
}

.main {
  width: min(100% - 28px, 1560px);
  margin-left: calc(var(--sidebar-width) + 28px);
  padding: 18px 0 30px;
  display: grid;
  gap: 16px;
}

.topbar,
.panel-head,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(260px, 500px) auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 0;
}

.topbar h1,
.auth-card h1 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.12;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.global-search {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-muted);
}

.global-search:focus-within {
  border-color: var(--line-strong);
}

.search-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-weight: 900;
}

.global-search input {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.global-search input:focus {
  background: transparent;
  box-shadow: none;
}

.global-search button {
  width: 36px;
  height: 32px;
  padding: 0;
  border-radius: 9px;
}

.panel,
.stat-card,
.idea-card,
.note-card,
.auth-card,
.snippet-card,
.goal-strip article,
.kanban-column,
.kanban-card,
.calendar-day,
.timer-box,
.empty-state,
tbody tr {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}

.panel,
.auth-card {
  padding: 18px;
  border-radius: var(--radius);
}

.panel h2,
.idea-card h2,
.note-card h2,
.snippet-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.2;
}

.panel-head h2 {
  margin-bottom: 0;
}

.narrow {
  max-width: 760px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-width: 0;
  padding: 15px;
  border-radius: var(--radius);
}

.stat-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.stat-card strong {
  display: block;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.stat-card.accent {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

.two-col,
.idea-grid,
.note-grid,
.snippet-grid,
.goal-grid,
.goal-strip,
.public-stats {
  display: grid;
  gap: 16px;
}

.two-col,
.snippet-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.idea-grid,
.note-grid,
.goal-grid,
.public-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.snippet-grid.compact,
.goal-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid {
  display: grid;
  gap: 13px;
  align-items: start;
}

.form-grid.columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea,
.custom-select-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

input:focus,
select:focus,
textarea:focus,
.custom-select.is-open .custom-select-button {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

textarea {
  min-height: 108px;
  resize: vertical;
}

select option {
  background: var(--surface-raised);
  color: var(--text);
}

.select-native {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-button {
  position: relative;
  padding-right: 38px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.custom-select-button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
}

.custom-select.is-open .custom-select-button::after {
  transform: translateY(-25%) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  inset: calc(100% + 6px) 0 auto;
  z-index: 50;
  max-height: 230px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}

.custom-select.is-open .custom-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.custom-select-option {
  width: 100%;
  display: block;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  box-shadow: none;
}

.custom-select-option:hover,
.custom-select-option[aria-selected="true"] {
  background: var(--surface-muted);
  color: var(--text);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: start;
  margin: 0 0 14px;
}

.inline-tight,
.inline-mini,
.actions-cell,
.share-box,
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.inline-tight,
.inline-mini {
  margin: 0 0 8px;
}

.inline-tight input,
.inline-tight select,
.inline-tight .custom-select,
.inline-mini input,
.inline-mini select,
.inline-mini .custom-select {
  width: auto;
  min-width: 120px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.button:hover,
button:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-muted) 78%, var(--primary));
  color: var(--text);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: var(--primary-ink);
}

.button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
}

.link-danger {
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  box-shadow: none;
}

.link-danger:hover {
  background: transparent;
  color: var(--red);
}

button:disabled,
.button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  min-width: 0;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th:first-child,
td:first-child {
  padding-left: 14px;
}

th:last-child,
td:last-child {
  padding-right: 14px;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

tbody tr {
  background: transparent;
  box-shadow: none;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--surface-muted) 60%, transparent);
}

td input[type="date"] {
  min-width: 148px;
}

.quick-edit {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.badge-online,
.badge-publicado,
.badge-hecho,
.badge-convertida {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 40%, var(--line));
}

.badge-alta,
.badge-necesita-revision,
.badge-descartada {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, var(--line));
}

.idea-card,
.note-card,
.snippet-card,
.goal-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 15px;
  border-radius: var(--radius);
}

.idea-card p,
.note-card p,
.snippet-card p,
.goal-card p,
.task-card p,
.kanban-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

.stack-list > div,
.idea-list > div {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-list button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.check-list .done {
  color: var(--green);
  text-decoration: line-through;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
}

.timer-box strong {
  min-width: 92px;
  font-variant-numeric: tabular-nums;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag-pill {
  background: color-mix(in srgb, var(--tag-color) 17%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--tag-color) 70%, var(--line));
}

.tag-check {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--tag-color) 70%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color) 14%, var(--surface-muted));
  color: var(--text);
}

.tag-check input {
  width: auto;
  min-height: 0;
}

.share-box input {
  flex: 1;
  min-width: 160px;
}

.chart-bars {
  min-height: 210px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.chart-bar {
  height: 182px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
  align-items: end;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.chart-bar i {
  width: 100%;
  height: var(--bar-height);
  min-height: 8px;
  display: block;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--primary), var(--violet));
}

.finance-meter {
  display: grid;
  gap: 15px;
}

.finance-meter div {
  display: grid;
  gap: 7px;
}

.finance-meter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-meter strong {
  font-size: 22px;
}

.finance-meter i {
  width: var(--meter-width);
  min-width: 8px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--violet));
}

.finance-meter i.danger {
  background: linear-gradient(90deg, var(--red), var(--warning));
}

.kanban-board,
.task-board {
  display: grid;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  align-items: start;
  scroll-snap-type: x proximity;
}

.kanban-board {
  grid-template-columns: repeat(6, minmax(280px, 1fr));
}

.task-board {
  grid-template-columns: repeat(4, minmax(260px, 1fr));
}

.kanban-column,
.task-column {
  min-width: 0;
  min-height: 420px;
  padding: 14px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-muted));
  scroll-snap-align: start;
}

.kanban-column.is-over {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-muted) 78%, var(--primary));
}

.kanban-column h2 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 17px;
}

.kanban-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.kanban-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 13px;
  border-radius: 13px;
  background: var(--surface-raised);
  cursor: grab;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.is-dragging {
  opacity: .58;
}

.kanban-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kanban-card-head strong {
  min-width: 0;
  font-size: 16px;
  line-height: 1.25;
}

.kanban-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.kanban-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kanban-progress {
  display: grid;
  gap: 7px;
}

.kanban-progress > span,
.kanban-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kanban-move {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress-track i {
  width: var(--progress);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--violet));
}

.public-shell {
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
}

.calendar-panel {
  overflow-x: auto;
}

.calendar-grid {
  min-width: 840px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 8px;
}

.calendar-weekdays strong {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 136px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 9px;
  border-radius: 12px;
  background: var(--surface-raised);
}

.calendar-day.is-empty {
  opacity: .35;
}

.calendar-day.is-today {
  border-color: var(--line-strong);
}

.calendar-day > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.calendar-event {
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-muted));
}

.calendar-event strong {
  font-size: 12px;
}

.calendar-event small {
  color: var(--muted);
}

pre {
  max-width: 100%;
  max-height: 310px;
  overflow: auto;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, black 28%, var(--surface-raised));
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.create-panel {
  display: grid;
  gap: 14px;
}

.create-panel > h2:first-child {
  display: none;
}

.create-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.create-panel-head h2 {
  margin: 0;
}

.create-panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
}

.create-panel.is-collapsed > form,
.create-panel.is-collapsed > .empty-state {
  display: none;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
}

.alert-success {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
}

.alert-danger {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
}

.empty-state {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 14px;
  border-style: dashed;
  border-radius: 12px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 460px);
}

.auth-card {
  display: grid;
  gap: 16px;
}

.auth-card .alert {
  margin: 0;
}

.integration-hint {
  margin-top: -4px;
}

.goal-card {
  padding: 15px;
  border-radius: var(--radius);
}

.goal-strip article {
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: var(--radius);
}

.goal-strip article span {
  color: var(--muted);
  font-size: 13px;
}

code {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--primary);
  font-size: 12px;
  font-family: "Fira Code", ui-monospace, "Cascadia Code", monospace;
}

.task-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-raised);
}

.task-card strong {
  font-size: 15px;
}

.task-column {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-muted));
}

.task-column h2 {
  margin: 0;
  font-size: 17px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}

legend {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.badge-warning,
.badge-en-curso,
.badge-pendiente {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 40%, var(--line));
}

.badge-activo,
.badge-mantenimiento,
.badge-pausado {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
}

.badge-bloqueada {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, var(--line));
}

@media (max-width: 1240px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .idea-grid,
  .note-grid,
  .goal-grid,
  .snippet-grid.compact,
  .goal-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body.nav-open {
    overflow: hidden;
  }

  .mobile-menu-button {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 90;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    background: var(--surface-raised);
    box-shadow: var(--shadow);
  }

  .nav-open .mobile-menu-button {
    left: min(calc(86vw - 56px), 284px);
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }

  .nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    z-index: 80;
    width: min(86vw, 330px);
    transform: translateX(calc(-100% - 18px));
    transition: transform .18s ease;
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .main {
    width: calc(100% - 20px);
    margin-left: 10px;
    padding: 72px 0 22px;
    gap: 14px;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px;
  }

  .topbar .icon-button {
    grid-column: 2;
    grid-row: 1;
  }

  .global-search {
    grid-column: 1 / -1;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .two-col,
  .idea-grid,
  .note-grid,
  .snippet-grid,
  .snippet-grid.compact,
  .goal-grid,
  .goal-strip,
  .form-grid.columns,
  .filter-bar,
  .public-stats {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: repeat(6, minmax(270px, 82vw));
  }

  .task-board {
    grid-template-columns: repeat(4, minmax(250px, 82vw));
  }

  .kanban-move {
    display: grid;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .panel,
  .auth-card {
    padding: 14px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-card strong {
    font-size: 21px;
  }

  .panel-head,
  .actions,
  .stack-list > div,
  .idea-list > div,
  .share-box,
  .export-actions,
  .create-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head .button,
  .actions .button,
  .actions button,
  .share-box .button,
  .export-actions .button,
  .create-panel-head .button {
    width: 100%;
  }

  .inline-tight,
  .inline-mini,
  .actions-cell {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .inline-tight input,
  .inline-tight select,
  .inline-tight .custom-select,
  .inline-mini input,
  .inline-mini select,
  .inline-mini .custom-select,
  .actions-cell .button,
  .actions-cell button {
    width: 100%;
    min-width: 0;
  }

  .form-grid .button.primary,
  .form-grid button[type="submit"],
  .inline-form .button,
  .filter-bar .button {
    width: 100%;
    justify-self: stretch;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr {
    padding: 11px;
    border-radius: 13px;
    background: var(--surface-raised);
  }

  td {
    display: grid;
    grid-template-columns: minmax(86px, 34%) 1fr;
    gap: 9px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }

  td:first-child,
  td:last-child {
    padding-left: 0;
    padding-right: 0;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  td[colspan] {
    display: block;
  }

  td[colspan]::before {
    content: "";
    display: none;
  }

  .calendar-panel {
    overflow: visible;
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-grid {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 56px;
  }

  .calendar-day.is-empty {
    display: none;
  }

  .kanban-board,
  .task-board {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .kanban-column,
  .task-column {
    min-height: auto;
  }
}

@media (max-width: 460px) {
  .main {
    width: calc(100% - 16px);
    margin-left: 8px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .chart-bars {
    gap: 6px;
  }

  .search-icon {
    display: none;
  }

  .global-search {
    grid-template-columns: 1fr auto;
  }
}

/* ─── Nav icons ─────────────────────────────────────────────────────────────── */

.nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: .7;
  transition: opacity .14s ease;
}

.nav-list a::before {
  display: none; /* removemos el dot anterior, ahora usamos svg */
}

.nav-list a,
.sidebar-footer a,
.sidebar-footer button {
  gap: 10px;
}

.nav-list a.is-active .nav-icon,
.nav-list a:hover .nav-icon,
.sidebar-footer a:hover .nav-icon,
.sidebar-footer button:hover .nav-icon {
  opacity: 1;
}

.nav-list a.is-active .nav-icon {
  color: var(--primary);
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

/* ─── Topbar actions & notifications ─────────────────────────────────────────── */

.topbar {
  grid-template-columns: minmax(170px, 1fr) minmax(260px, 500px) auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--red) 50%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 12%, var(--surface-muted));
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .16s ease;
}

.alert-pill:hover {
  background: color-mix(in srgb, var(--red) 22%, var(--surface-muted));
  color: var(--red);
}

.overdue-date {
  color: var(--red);
  font-weight: 800;
}

/* ─── Auth brand ────────────────────────────────────────────────────────────── */

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.auth-brand strong {
  font-size: 18px;
}

.auth-card .eyebrow {
  margin-top: 4px;
}

/* ─── Pagination ─────────────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 0 4px;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--muted);
  font-size: 13px;
}

.pagination .button[aria-disabled="true"] {
  opacity: .4;
  pointer-events: none;
  cursor: default;
}

/* ─── Markdown body ──────────────────────────────────────────────────────────── */

.markdown-body {
  color: var(--text);
  line-height: 1.65;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 10px 0 6px;
  line-height: 1.25;
  color: var(--text);
}

.markdown-body h1 { font-size: 18px; }
.markdown-body h2 { font-size: 16px; }
.markdown-body h3 { font-size: 14px; }

.markdown-body ul {
  margin: 6px 0;
  padding-left: 20px;
}

.markdown-body li {
  margin: 3px 0;
}

.markdown-body a {
  color: var(--primary);
  text-decoration: underline;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-muted));
  color: var(--primary);
  font-size: 12px;
  font-family: "Fira Code", ui-monospace, monospace;
}

.markdown-body pre {
  margin: 8px 0;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.note-body {
  max-height: 220px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, var(--text) 70%, transparent);
  mask-image: linear-gradient(180deg, var(--text) 70%, transparent);
}

/* ─── Task board drag & drop ─────────────────────────────────────────────────── */

.task-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  min-height: 60px;
}

.task-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-raised);
  cursor: grab;
  transition: box-shadow .14s ease, transform .14s ease, opacity .14s ease;
}

.task-card:active {
  cursor: grabbing;
}

.task-card.is-dragging {
  opacity: .5;
  transform: scale(.98);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.task-column.is-over {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-muted) 78%, var(--primary));
}

.task-column.is-over .task-list {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-radius: 10px;
}

.task-card strong {
  font-size: 14px;
  line-height: 1.3;
}

.badge-sm {
  font-size: 10px;
  min-height: 18px;
  padding: 1px 6px;
}

/* ─── Snippet card highlight.js override ─────────────────────────────────────── */

.snippet-card pre {
  max-height: 260px;
  border-radius: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.snippet-card pre code.hljs {
  border-radius: 10px;
  font-size: 12px;
  padding: 13px;
}

/* ─── Text utilities ─────────────────────────────────────────────────────────── */

.text-green { color: var(--green); }
.text-red   { color: var(--red);   }

/* ─── Filter bar compact ─────────────────────────────────────────────────────── */

.filter-bar.compact {
  grid-template-columns: minmax(200px, 1.5fr) minmax(140px, 1fr) auto;
}

/* ─── Misc improvements ──────────────────────────────────────────────────────── */

.note-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.note-card .actions {
  margin-top: auto;
}

/* Sidebar footer links now have icons too */
.sidebar-footer a,
.sidebar-footer button {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Help / Manual module ───────────────────────────────────────────────────── */

.help-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

.help-toc {
  position: sticky;
  top: 80px;
}

.help-toc-inner {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.help-toc .eyebrow {
  margin-bottom: 10px;
}

.help-toc nav {
  display: grid;
  gap: 3px;
}

.help-toc nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background .12s ease, color .12s ease;
}

.help-toc nav a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.help-content {
  display: grid;
  gap: 14px;
}

.help-intro p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.help-module-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.help-module-head .nav-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
  opacity: 1;
  flex-shrink: 0;
}

.help-module-head h2 {
  margin: 0;
  flex: 1;
}

.help-module-head .button {
  flex-shrink: 0;
}

.help-content h3 {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.help-content ul,
.help-content ol {
  margin: 0 0 8px;
  padding-left: 20px;
  display: grid;
  gap: 5px;
  line-height: 1.55;
}

.help-content p {
  margin: 0 0 8px;
  line-height: 1.65;
}

.help-content p:last-child {
  margin-bottom: 0;
}

.help-tip {
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface-muted));
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.help-tip strong {
  color: var(--primary);
}

.help-code {
  margin: 10px 0;
}

.help-code pre {
  max-height: none;
  font-size: 12px;
}

@media (max-width: 980px) {
  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-toc {
    position: static;
  }

  .help-toc-inner {
    overflow-x: auto;
  }

  .help-toc nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    white-space: nowrap;
  }
}

/* ─── Topbar responsive fix ──────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto auto;
  }

  .topbar-actions {
    grid-column: 3;
    grid-row: 1;
  }
}
