:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #2e2e2e;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #7c6af7;
  --accent-dim: #3d3472;
  --green: #4ade80;
  --teal: #2dd4bf;
  --yellow: #facc15;
  --orange: #fb923c;
  --red: #f87171;
  --blue: #60a5fa;
  --purple: #7c6af7;
  --proj-gt: #a78bfa;
  --proj-cel: #fb923c;
  --proj-gh: #34d399;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; min-height: 100vh; }

header { padding: 16px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
header h1 { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
header span { color: var(--muted); font-size: 12px; }

.layout { display: grid; grid-template-columns: 1fr 340px; gap: 0; height: calc(100vh - 53px); }

/* CALENDARIO */
.calendar-panel { padding: 16px 20px; overflow-y: auto; scroll-behavior: smooth; }
.btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; transition: background .15s; }
.btn:hover { background: var(--border); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { opacity: .85; }

.month-block { margin-bottom: 28px; }
.month-block-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.month-block-title.is-current { color: var(--accent); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-day-name { text-align: center; font-size: 10px; color: var(--muted); padding: 4px 0; font-weight: 600; text-transform: uppercase; }
.cal-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; height: 70px; overflow: hidden; padding: 5px 7px; cursor: pointer; transition: border-color .15s; }
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.other-month { opacity: .3; pointer-events: none; }
.cal-cell.today { border-color: var(--accent); }
.cal-cell.today .cal-num { color: var(--accent); font-weight: 700; }
.cal-cell.selected { background: var(--accent-dim); border-color: var(--accent); }
.cal-cell.this-week { background: #1d1d2a; }
.cal-num { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.cal-dot { font-size: 9px; padding: 1px 4px; border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; border-left: 2px solid transparent; }
.dot-green   { background: var(--surface2); color: var(--text); border-left-color: var(--green); }
.dot-teal    { background: var(--surface2); color: var(--text); border-left-color: var(--teal); }
.dot-blue    { background: var(--surface2); color: var(--text); border-left-color: var(--blue); }
.dot-purple  { background: var(--surface2); color: var(--text); border-left-color: var(--purple); }
.dot-orange  { background: var(--surface2); color: var(--text); border-left-color: var(--orange); }
.dot-red     { background: var(--surface2); color: var(--text); border-left-color: var(--red); }
.dot-muted   { background: var(--surface2); color: var(--text); border-left-color: var(--muted); }
.dot-project { background: var(--surface2); color: var(--text); border-left-color: var(--blue); }
.dot-todo    { background: var(--surface2); color: var(--text); border-left-color: var(--proj-cel); }
.dot-note    { background: var(--surface2); color: var(--text); border-left-color: var(--proj-gh); }

/* PANEL LATERAL */
.side-panel { border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { flex: 1; padding: 11px 6px; text-align: center; cursor: pointer; font-size: 11px; color: var(--muted); border-bottom: 2px solid transparent; transition: all .15s; white-space: nowrap; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }
.tab-content { flex: 1; overflow-y: auto; padding: 14px; display: none; }
.tab-content.active { display: block; }

/* SECTION TITLES */
.section-title { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; margin-top: 18px; display: flex; align-items: center; gap: 6px; }
.section-title:first-child { margin-top: 0; }
.section-count { background: var(--surface2); color: var(--muted); border-radius: 10px; padding: 1px 6px; font-size: 10px; }

/* CARDS */
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; margin-bottom: 6px; transition: border-color .15s; border-left: 3px solid transparent; }
.item-card:hover { border-left-color: var(--accent); }
.item-card.card-green  { border-left-color: var(--green); }
.item-card.card-teal   { border-left-color: var(--teal); }
.item-card.card-blue   { border-left-color: var(--blue); }
.item-card.card-purple { border-left-color: var(--purple); }
.item-card.card-orange { border-left-color: var(--orange); }
.item-card.card-red    { border-left-color: var(--red); }
.item-card.card-muted  { border-left-color: var(--muted); }
.item-card .title { font-size: 12px; font-weight: 500; margin-bottom: 5px; }
.item-card .meta { font-size: 10px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* BADGES */
.badge { padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 700; }
.badge-draft       { background: #2a2a1a; color: var(--yellow); }
.badge-ready       { background: #1a2a1a; color: #86efac; }
.badge-published   { background: #1a2e1a; color: var(--green); }
.badge-distributed { background: #0d1f0d; color: var(--green); }
.badge-planned     { background: #1e2a3a; color: var(--blue); }
.badge-active      { background: #1e3a5f; color: var(--blue); }
.badge-paused      { background: #2a2a2a; color: var(--muted); }
.badge-done        { background: #1a2e1a; color: var(--green); }
.badge-gt  { background: #2a2040; color: var(--proj-gt); }
.badge-cel { background: #2d1a0a; color: var(--proj-cel); }
.badge-gh  { background: #0d2420; color: var(--proj-gh); }

/* PROJECT FILTERS */
.proj-filters { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.proj-btn { padding: 3px 9px; border-radius: 4px; font-size: 10px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); transition: all .15s; }
.proj-btn.active-gt  { background: #2a2040; border-color: var(--proj-gt); color: var(--proj-gt); }
.proj-btn.active-cel { background: #2d1a0a; border-color: var(--proj-cel); color: var(--proj-cel); }
.proj-btn.active-gh  { background: #0d2420; border-color: var(--proj-gh); color: var(--proj-gh); }
.proj-btn.active-all { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* CHECKLIST */
.checklist { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.check-item { display: flex; align-items: center; gap: 4px; font-size: 10px; cursor: pointer; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); transition: all .15s; user-select: none; }
.check-item.checked { background: #1a2e1a; border-color: #2a4a2a; color: var(--green); }
.check-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; }
.check-item.checked .dot { opacity: 1; }

/* FORM */
.add-form { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.add-form h3 { font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.field { margin-bottom: 8px; }
.field label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.field input, .field select, .field textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 9px; font-size: 12px; font-family: inherit; outline: none; transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 52px; }
.field select option { background: var(--surface); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.form-actions { display: flex; gap: 7px; justify-content: flex-end; margin-top: 6px; }

/* DAY DETAIL */
.day-detail { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.day-detail h3 { font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.empty { color: var(--muted); font-size: 11px; text-align: center; padding: 16px 0; }

/* VISION */
.vision-section { margin-bottom: 22px; }
.vision-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.vision-section-header h3 { font-size: 12px; font-weight: 700; flex: 1; }
.vision-week-range { font-size: 10px; color: var(--muted); }
.month-group { margin-bottom: 14px; }
.month-label { font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 6px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface); border-radius: 7px; margin-bottom: 14px; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* TODOS & NOTAS */
.todo-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; margin-bottom: 5px; }
.todo-item input[type=checkbox] { margin-top: 1px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.todo-item .todo-text { flex: 1; font-size: 12px; line-height: 1.4; cursor: text; outline: none; word-break: break-word; }
.todo-item.done .todo-text { color: var(--muted); text-decoration: line-through; }
.todo-item .todo-del { color: var(--muted); cursor: pointer; font-size: 10px; opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.todo-item:hover .todo-del { opacity: 1; }
.note-item { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 7px; padding: 8px 10px; margin-bottom: 6px; }
.note-item .note-title { font-size: 11px; font-weight: 600; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.note-item .note-del { color: var(--muted); cursor: pointer; font-size: 10px; opacity: 0; transition: opacity .15s; }
.note-item:hover .note-del { opacity: 1; }
.note-item textarea { width: 100%; background: transparent; border: none; color: var(--text); font-size: 11px; font-family: inherit; resize: none; outline: none; min-height: 48px; line-height: 1.5; }

/* VIEW TOGGLE */
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.view-btn { padding: 4px 14px; font-size: 11px; cursor: pointer; background: var(--surface2); color: var(--muted); border: none; transition: all .15s; font-family: inherit; }
.view-btn.active { background: var(--accent); color: #fff; }

/* CANVAS */
.canvas-panel { position: relative; overflow: hidden; background: radial-gradient(circle at 50% 50%, #141420 0%, var(--bg) 100%); }
.canvas-viewport { width: 100%; height: 100%; cursor: grab; position: absolute; inset: 0; }
.canvas-viewport.panning { cursor: grabbing; }
.canvas-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
#canvas-svg { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.ccard { position: absolute; border-radius: 10px; padding: 10px 12px; cursor: grab; user-select: none; min-width: 150px; max-width: 210px; box-shadow: 0 4px 20px rgba(0,0,0,.5); border: 1px solid var(--border); background: var(--surface); }
.ccard.dragging-card { cursor: grabbing; z-index: 100; box-shadow: 0 12px 40px rgba(0,0,0,.8); }
.ccard.note-card { background: #211e0e; border-color: #4a4020; }
.ccard .cc-title { font-size: 11px; font-weight: 600; line-height: 1.4; margin-bottom: 5px; word-break: break-word; }
.ccard .cc-meta { font-size: 9px; color: var(--muted); display: flex; gap: 4px; flex-wrap: wrap; }
.ccard .cc-del { position: absolute; top: 3px; right: 5px; font-size: 10px; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.ccard:hover .cc-del { opacity: 1; }
.port { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); cursor: crosshair; opacity: 0; transition: opacity .15s; z-index: 20; }
.ccard:hover .port { opacity: 1; }
.port-t { top: -5px; left: calc(50% - 5px); }
.port-b { bottom: -5px; left: calc(50% - 5px); }
.port-l { left: -5px; top: calc(50% - 5px); }
.port-r { right: -5px; top: calc(50% - 5px); }
.ccard.cc-green  { border-left: 3px solid var(--green); }
.ccard.cc-yellow { border-left: 3px solid var(--yellow); }
.ccard.cc-red    { border-left: 3px solid var(--red); }
.ccard.cc-blue   { border-left: 3px solid var(--blue); }
.canvas-toolbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 7px 12px; z-index: 200; box-shadow: 0 4px 24px rgba(0,0,0,.6); white-space: nowrap; }
.canvas-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); pointer-events: none; opacity: .5; }

/* STATS BAR */
.stats-bar { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 14px; overflow: hidden; }
.stat { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-right: 1px solid var(--border); gap: 2px; }
.stat:last-child { border-right: none; }
.stat-n { font-size: 17px; font-weight: 700; line-height: 1; }
.stat span:last-child { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }

/* SEARCH */
.search-wrap { padding: 10px 14px 6px; }
.search-wrap input { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 7px 10px; font-size: 12px; font-family: inherit; outline: none; transition: border-color .15s; }
.search-wrap input:focus { border-color: var(--accent); }

@media (max-width: 700px) {
  header { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  header h1 { font-size: 13px; }
  header > div { flex-wrap: wrap; }
  #today-scroll-label { display: none; }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 45% 55%;
    height: calc(100vh - 53px);
  }

  .calendar-panel { padding: 10px; }

  .side-panel { border-left: none; border-top: 1px solid var(--border); }

  .cal-cell { height: 52px; overflow: hidden; padding: 3px 5px; }

  /* Dots compactos: círculos de color sin texto */
  .cal-dot {
    font-size: 0;
    width: 6px; height: 6px;
    border-radius: 50%;
    border-left: none;
    display: inline-block;
    padding: 0;
    margin: 1px 1px 0 0;
  }
  .dot-green   { background: var(--green); }
  .dot-teal    { background: var(--teal); }
  .dot-blue    { background: var(--blue); }
  .dot-purple  { background: var(--purple); }
  .dot-orange  { background: var(--orange); }
  .dot-red     { background: var(--red); }
  .dot-muted   { background: var(--muted); }
  .dot-project { background: var(--blue); }
  .dot-todo    { background: var(--proj-cel); }
  .dot-note    { background: var(--proj-gh); }

  .canvas-hint { opacity: .8; font-size: 11px; }
}
