/* Versión 2: identidad (tipografía, color y formas) sobre el mismo cristal,
   y los componentes del CRM: celdas nuevas, pipeline, ficha, centros de columnas y automatizaciones, panel. */

/* ---------- Tipografía ---------- */
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url('/fonts/figtree-latin-ext-wght-normal.woff2') format('woff2');
  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: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/poppins-latin-500-normal.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/poppins-latin-ext-500-normal.woff2') format('woff2');
  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: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/poppins-latin-ext-600-normal.woff2') format('woff2');
  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;
}

/* ---------- Variables ---------- */
:root {
  --font-ui: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Poppins', 'Figtree', ui-sans-serif, system-ui, sans-serif;

  --ink: #0a0f1c;
  --ink-solid: #10162a;            /* texto sobre colores sólidos claros */
  --text: #f4f6fb;
  --text-2: rgba(230, 235, 247, 0.76);
  --text-3: rgba(214, 222, 240, 0.54);

  /* Cristal neutro y frío: funciona sobre cualquier fondo */
  --glass: rgba(17, 23, 40, 0.48);
  --glass-strong: rgba(14, 19, 33, 0.9);
  --fill: rgba(224, 233, 255, 0.06);
  --fill-2: rgba(224, 233, 255, 0.1);
  --fill-3: rgba(224, 233, 255, 0.17);
  --line: rgba(212, 223, 255, 0.12);
  --line-2: rgba(212, 223, 255, 0.22);

  --ok: #00c875;
  --warn: #fdab3d;
  --danger: #ff7575;
  --series: #579bfc;               /* un solo tono para las barras que miden cantidad */

  --r-xl: 18px;
  --r-l: 16px;
  --r-m: 10px;
  --r-s: 8px;
}
[data-accent='ocean'] { --accent: #007f9b; --accent-2: #7bd6ea; --accent-3: #006278; --accent-ink: #ffffff; --accent-soft: rgba(0, 150, 186, 0.2); }

body { font: 400 14px/1.5 var(--font-ui); letter-spacing: 0; }
* { scrollbar-color: rgba(212, 223, 255, 0.24) transparent; }
select option { background: #121a2e; }

#backdrop { background-color: #0b1220; }
#backdrop::after { background: linear-gradient(180deg, rgba(8, 12, 24, 0.14), rgba(8, 12, 24, 0.42)); }
#backdrop[data-bg='brisa'], .choice-thumb[data-bg='brisa'] {
  background-image:
    radial-gradient(52% 58% at 10% 6%, rgba(0, 134, 192, 0.6), transparent 70%),
    radial-gradient(46% 52% at 90% 10%, rgba(85, 89, 223, 0.55), transparent 70%),
    radial-gradient(58% 52% at 74% 104%, rgba(0, 200, 117, 0.2), transparent 72%),
    radial-gradient(48% 50% at 16% 98%, rgba(162, 93, 220, 0.32), transparent 72%),
    linear-gradient(165deg, #0e1934, #080c18);
}

/* Títulos en Poppins; el resto, Figtree */
.page-head h1, .board-title h1, .drawer-title { font-weight: 600; letter-spacing: -0.02em; }
.page-head h1 { font-size: 30px; }
.board-title h1 { font-size: 26px; }
.drawer-title { font-size: 23px; line-height: 1.25; }
.modal-head h2, .panel-head h2, .ws-head h2, .tgroup-head h2, .lane-head h2, .empty h3, .side-brand-name, .board-card strong {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em;
}
.stat-value, .panel-figure strong { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
.stat-value { font-size: 30px; }
.brand-mark { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; }

/* ---------- Formas: menos píldora, más bloque ---------- */
.btn { border-radius: 8px; font-weight: 600; letter-spacing: 0; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 20px -12px var(--accent); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 86%, #fff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 10px 26px -12px var(--accent); }
.btn-primary::after { background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.32) 50%, transparent 65%); }
.btn-danger { background: rgba(223, 47, 74, 0.2); border-color: rgba(255, 117, 117, 0.45); color: #ffc7cd; }
.btn-danger:hover:not(:disabled) { background: rgba(223, 47, 74, 0.34); border-color: rgba(255, 117, 117, 0.7); }
.seg, .select-chip, .filter-box, .top-search, .top-clock, .top-user { border-radius: 10px; }
.seg-btn { border-radius: 7px; }
.top-burger, .top-actions .btn-primary { border-radius: 10px; }
.side-link { border-radius: 10px; }
.card { border-radius: 10px; }
.toast { border-radius: 10px; background: rgba(14, 19, 33, 0.94); }
.pill { border-radius: 6px; }
.side[data-collapsed='true'] [data-tip]:hover::after, .side[data-collapsed='true'] [data-tip]:focus-visible::after { background: rgba(14, 19, 33, 0.97); }
.board-card.is-new, .lane-new { background: rgba(14, 19, 33, 0.3); }
.board-card.is-new:hover, .lane-new:hover { background: rgba(14, 19, 33, 0.5); }
::view-transition-group(item-sheet) { background: rgba(16, 22, 38, 0.94); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(212, 223, 255, 0.16); }

.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.toast.has-action { pointer-events: auto; padding-right: 8px; }
.toast.is-auto .icon { color: #ffcb00; }
.toast-action { height: 28px; padding: 0 10px; margin-left: 4px; border-radius: 7px; background: var(--fill-2); color: var(--accent-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.toast-action:hover { background: var(--fill-3); color: var(--text); }
.auto-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px; background: rgba(255, 203, 0, 0.16); color: #ffe27a; font-size: 11px; font-weight: 600; vertical-align: 1px; }

/* ---------- Avisos (campana) ---------- */
.top-bell { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--text-2); box-shadow: none; transition: color var(--t-fast), transform 0.45s var(--spring); }
.top-bell:hover { color: var(--text); }
.top-bell:active { transform: scale(0.92); transition-duration: 80ms; }
.top-bell .badge { position: absolute; top: 5px; right: 4px; box-shadow: 0 0 0 2px rgba(14, 19, 33, 0.9); }
.top-bell.has-unread .icon { color: var(--text); animation: ring 0.9s var(--ease-out); transform-origin: 50% 10%; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-11deg); } 60% { transform: rotate(7deg); } 80% { transform: rotate(-4deg); } }
.note-menu { display: grid; gap: 1px; }
.note-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; text-align: left; }
.note-row:hover:not(:disabled), .note-row:focus-visible { background: var(--fill-2); outline: none; }
.note-row:disabled { opacity: 1; cursor: default; }
.note-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: transparent; }
.note-row.is-new .note-dot { background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
.note-text { display: grid; gap: 1px; min-width: 0; }
.note-text strong { font-weight: 500; overflow-wrap: anywhere; }
.note-row.is-new .note-text strong { font-weight: 600; }
.note-text small { font-size: 12px; color: var(--text-3); }
.note-empty { padding: 10px 10px 14px; color: var(--text-2); font-size: 13px; line-height: 1.5; }

/* ---------- Tabla: grupos con color y estados sólidos ---------- */
.tgroup-head h2 { font-size: 16.5px; color: color-mix(in srgb, var(--c) 72%, #fff); }
.tbody .trow::before { width: 5px; opacity: 1; }
.thead { background: rgba(6, 10, 22, 0.22); font-size: 12.5px; }
.th-btn { font-size: 12.5px; }
.title-btn { font-weight: 500; }
.trow { min-height: 38px; }
.cell { min-height: 37px; }
.cell-text { line-height: 37px; }
.cell-input { min-height: 37px; background: rgba(4, 8, 18, 0.55); }

.cell-status { margin: 0; width: 100%; height: 100%; min-height: 37px; border: 0; border-radius: 0; background: var(--c); color: var(--k, #fff); font-size: 13.5px; font-weight: 500; position: relative; }
.cell-status:hover { background: color-mix(in srgb, var(--c) 86%, #fff); box-shadow: none; }
/* Esquina doblada al pasar el cursor: indica que la etiqueta se puede cambiar */
.cell-status:not(.is-empty)::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0; border-color: transparent rgba(8, 12, 24, 0.5) transparent transparent; transition: border-width var(--t-med) var(--ease-out); }
.cell-status:not(.is-empty):hover::after { border-width: 0 10px 10px 0; }
.cell-status.is-empty { background: rgba(224, 233, 255, 0.09); border: 0; }
.cell-status.is-empty:hover { background: rgba(224, 233, 255, 0.16); }
.drawer-value .cell-status { max-width: none; }
.status-menu { gap: 6px; padding: 6px; }
.status-option { height: 34px; border: 0; border-radius: 6px; background: var(--c); color: var(--k, #fff); font-weight: 500; }
.status-option:hover, .status-option:focus-visible { background: color-mix(in srgb, var(--c) 86%, #fff); }
.status-option.is-active { box-shadow: 0 0 0 2px var(--glass-strong), 0 0 0 4px var(--text); }

/* Etiquetas múltiples y vínculos */
.cell-tags { justify-content: flex-start; gap: 4px; padding: 0 8px; }
.tag-chip, .link-chip { flex: 0 1 auto; min-width: 0; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 12.5px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-chip { background: color-mix(in srgb, var(--c) 30%, transparent); color: color-mix(in srgb, var(--c) 38%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 46%, transparent); }
.link-chip { background: rgba(87, 155, 252, 0.2); color: #cfe0ff; box-shadow: inset 0 0 0 1px rgba(87, 155, 252, 0.4); }
.tag-more { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.link-list { max-height: 260px; overflow: auto; }
.link-row { display: flex; align-items: center; gap: 2px; }
.link-row .person-option { flex: 1; min-width: 0; }
.pop-form { display: grid; gap: 10px; padding: 6px; }
.pop-note { padding: 10px 8px; font-size: 13px; }

/* Correo, teléfono y enlace: el valor se edita; el icono actúa */
.cell-slot { position: relative; }
.cell.is-link:not(.is-empty) { color: #a9cdff; padding-right: 34px; }
.cell-go { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--text-3); opacity: 0; transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast); }
.trow:hover .cell-go, .drawer-field:hover .cell-go, .cell-go:focus-visible { opacity: 1; }
.cell-go:hover { background: var(--fill-3); color: var(--text); }

.check-box { display: grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 5px; border: 1.5px solid var(--line-2); color: transparent; transition: background var(--t-fast), border-color var(--t-fast), transform 0.4s var(--spring); }
.cell-check.is-on .check-box, .check-box.is-on { background: var(--ok); border-color: var(--ok); color: var(--ink-solid); }
.cell-check:active .check-box { transform: scale(0.8); }
.cell-rating { gap: 1px; }
.cell-rating:hover { background: transparent; }
.star { display: grid; place-items: center; width: 21px; height: 26px; color: rgba(224, 233, 255, 0.24); transition: color var(--t-fast), transform 0.4s var(--spring); }
.star:hover { transform: scale(1.18); }
.star.is-on { color: #ffcb00; }
.star.is-on .icon { fill: currentColor; }
.cell-timeline { padding: 0 8px; }
.timeline-bar { position: relative; display: block; width: 100%; height: 24px; border-radius: 999px; overflow: hidden; background: rgba(162, 93, 220, 0.28); box-shadow: inset 0 0 0 1px rgba(162, 93, 220, 0.4); }
.timeline-fill { position: absolute; inset: 0 auto 0 0; background: #a25ddc; }
.timeline-bar.is-late .timeline-fill { background: #df2f4a; }
.timeline-bar.is-late { background: rgba(223, 47, 74, 0.3); box-shadow: inset 0 0 0 1px rgba(223, 47, 74, 0.5); }
.timeline-text { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 600; line-height: 24px; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); white-space: nowrap; }
.cell-formula { color: var(--text-2); cursor: default; }
.cell-formula:hover { background: transparent; }
.cell-button { padding: 0 8px; }
.cell-button:hover { background: transparent; }
.cell-action { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; height: 28px; padding: 0 12px; border-radius: 6px; background: var(--c); color: var(--k, #fff); font-size: 13px; font-weight: 600; white-space: nowrap; transition: transform 0.45s var(--spring), filter var(--t-fast), box-shadow var(--t-med); }
.cell-action span { overflow: hidden; text-overflow: ellipsis; }
.cell-action:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 6px 16px -8px var(--c); }
.cell-action:active:not(:disabled) { transform: scale(0.94); transition-duration: 80ms; }
.cell-action.is-busy { opacity: 0.7; cursor: progress; }
.button-preview { padding: 14px; border-radius: var(--r-s); background: rgba(4, 8, 18, 0.35); border: 1px dashed var(--line-2); }
.td-sum.is-center { align-items: center !important; padding-right: 8px !important; }
.chip.is-money { background: rgba(0, 200, 117, 0.16); color: #8ff0c4; font-weight: 600; }
.chip.is-link { background: rgba(87, 155, 252, 0.16); color: #cfe0ff; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.chip.is-star { color: #ffe27a; }

/* ---------- Encabezado del tablero ---------- */
.auto-btn .icon { color: #ffcb00; }
.auto-btn .badge { margin-left: 1px; }

/* ---------- Pipeline: cada etapa es una flecha ---------- */
.lane.is-stage { padding-top: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, transparent), transparent 46%), var(--glass); }
.lane-chevron { flex: none; display: grid; gap: 1px; align-content: center; min-height: 58px; margin: 6px 0 4px; padding: 8px 28px 8px 26px; background: var(--c); color: var(--k, #fff);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%); }
.lane-chevron-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lane-chevron h2 { flex: 0 1 auto; min-width: 0; font: 600 14.5px/1.3 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-chevron .count { flex: none; padding: 0 7px; border-radius: 999px; background: rgba(8, 12, 24, 0.22); color: inherit; font-weight: 600; }
.lane-chevron .lane-sum { margin: 0; font-size: 13px; font-weight: 600; color: inherit; opacity: 0.86; }
.kanban .lane { border-radius: var(--r-l); }

/* ---------- Ficha del elemento ---------- */
.drawer.sheet { width: min(1080px, 100%); border-radius: var(--r-xl); }
.sheet .drawer-scroll { gap: 18px; padding: 18px 24px 30px; }
.sheet-nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sheet-nav .select-chip { margin-left: 6px; }
.sheet-top { display: grid; gap: 12px; }
.sheet-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.sum-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 30px; padding: 0 11px; border-radius: 8px; background: var(--fill); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-chip.is-money { color: #8ff0c4; font-weight: 600; font-variant-numeric: tabular-nums; }
a.sum-chip.is-link:hover, button.sum-chip.is-link:hover { background: var(--fill-2); color: var(--text); border-color: var(--line-2); }

.stage-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: var(--r-m); background: rgba(4, 8, 18, 0.28); border: 1px solid var(--line); }
.stage-path { flex: 1 1 380px; min-width: 0; display: flex; }
.stage { flex: 1 1 0; min-width: 0; height: 36px; margin-left: -7px; padding: 0 16px 0 22px; display: grid; place-items: center; background: var(--fill-2); color: var(--text-2); font-size: 12.5px; font-weight: 600;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); transition: background var(--t-med), color var(--t-fast), filter var(--t-fast); }
.stage:first-child { margin-left: 0; padding-left: 14px; border-radius: 7px 0 0 7px; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.stage > span { display: flex; align-items: center; gap: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.stage:hover { background: color-mix(in srgb, var(--c) 34%, var(--fill-2)); color: var(--text); }
.stage.is-past { background: color-mix(in srgb, var(--c) 46%, rgba(14, 19, 33, 0.6)); color: var(--text); }
.stage.is-current { background: var(--c); color: var(--k, #fff); }
button.stage.is-current:hover { background: var(--c); color: var(--k, #fff); filter: brightness(1.08); }
.stage:focus-visible { outline: none; filter: brightness(1.25); }
.stage-actions { display: flex; gap: 8px; }
.stage-close { background: color-mix(in srgb, var(--c) 20%, transparent); border-color: color-mix(in srgb, var(--c) 55%, transparent); color: color-mix(in srgb, var(--c) 40%, #fff); }
.stage-close:hover:not(:disabled) { background: color-mix(in srgb, var(--c) 36%, transparent); border-color: var(--c); color: #fff; }

.sheet-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: -4px; }
.sheet-tab { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 8px 8px 0 0; color: var(--text-2); font-weight: 600; font-size: 13.5px; position: relative; transition: color var(--t-fast), background var(--t-fast); }
.sheet-tab:hover { color: var(--text); background: var(--fill); }
.sheet-tab.is-active { color: var(--text); }
.sheet-tab.is-active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-2); animation: grow-x 0.3s var(--ease-out); }
@keyframes grow-x { from { transform: scaleX(0); } }
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 26px; align-items: start; }
.sheet-main, .sheet-side, .sheet-pane { display: grid; gap: 14px; min-width: 0; align-content: start; }
.sheet-pane { gap: 22px; max-width: 720px; }
.sheet-h { font: 600 14px/1.3 var(--font-display); color: var(--text-2); }
.sheet .drawer-fields { background: rgba(4, 8, 18, 0.26); }
.sheet .drawer-field { grid-template-columns: 142px minmax(0, 1fr); min-height: 40px; }
.drawer-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-value .cell-tags, .drawer-value .cell-rating, .drawer-value .cell-check, .drawer-value .cell-button { justify-content: flex-start; }
.drawer-value .cell-timeline { max-width: 220px; }
.drawer-value .cell-formula { justify-content: flex-start; }

.composer { border: 1px solid var(--line); border-radius: var(--r-m); background: rgba(4, 8, 18, 0.26); padding: 10px; }
.composer-form { display: grid; gap: 8px; }
.kind-row { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line); color: var(--text-2); font-size: 13px; font-weight: 600; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform 0.45s var(--spring); }
.kind-chip .icon { color: var(--c); }
.kind-chip:hover { color: var(--text); background: var(--fill); }
.kind-chip:active { transform: scale(0.94); transition-duration: 80ms; }
.kind-chip.is-active { background: color-mix(in srgb, var(--c) 20%, transparent); border-color: color-mix(in srgb, var(--c) 60%, transparent); color: var(--text); }
.composer .input { background: rgba(4, 8, 18, 0.4); }
.composer textarea.input { min-height: 58px; resize: none; overflow: hidden; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.when-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.when-field .input { width: auto; height: 34px; padding: 0 8px; }
.when-field .input::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.6); cursor: pointer; }

.timeline { display: grid; gap: 10px; }
.timeline-month { font: 600 12.5px/1 var(--font-ui); color: var(--text-3); margin-top: 6px; }
.timeline-list { display: grid; gap: 4px; position: relative; }
.timeline-list::before { content: ''; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
.entry { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; position: relative; animation: rise 0.4s var(--ease-out) both; }
.entry-icon { flex: none; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: color-mix(in srgb, var(--c) 30%, #0e1321); color: color-mix(in srgb, var(--c) 55%, #fff); box-shadow: 0 0 0 3px rgba(14, 19, 33, 0.92), inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent); position: relative; z-index: 1; }
.entry-body { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 4px 10px 10px 10px; background: var(--fill); border: 1px solid var(--line); }
.entry.is-future .entry-body { border-style: dashed; border-color: var(--line-2); }
.entry-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-height: 22px; }
.entry-head strong { font-weight: 600; overflow-wrap: anywhere; }
.entry-head span { font-size: 12px; color: var(--text-3); margin-right: auto; }
.entry-head .icon-btn { width: 22px; height: 22px; opacity: 0; align-self: center; }
.entry:hover .icon-btn, .entry .icon-btn:focus-visible { opacity: 1; }
.entry-body p { margin-top: 3px; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-empty { display: grid; justify-items: center; gap: 8px; padding: 22px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-m); text-align: center; color: var(--text-3); }
.timeline-empty p { max-width: 44ch; color: var(--text-2); font-size: 13px; }

/* ---------- Centro de columnas ---------- */
.modal.is-xl { width: min(940px, 100%); }
.col-center { display: grid; gap: 18px; }
.col-cats { display: grid; gap: 18px; }
.col-cat { display: grid; gap: 10px; }
.col-cat h3, .auto-ideas h3 { font: 600 13px/1 var(--font-display); color: var(--text-2); }
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 8px; }
.col-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: rgba(4, 8, 18, 0.24); text-align: left; transition: border-color var(--t-med), background var(--t-med), transform 0.45s var(--spring); }
.col-card:hover { border-color: var(--line-2); background: var(--fill); transform: translateY(-1px); }
.col-card:active { transform: scale(0.98); transition-duration: 80ms; }
.col-card-text { display: grid; gap: 2px; min-width: 0; }
.col-card-text strong { font-weight: 600; }
.col-card-text small { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.type-tile { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--c); color: var(--ink-solid); }
.preset .type-tile { width: 22px; height: 22px; border-radius: 6px; }
.col-none { padding: 14px 4px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 5px 11px 5px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--fill); font-size: 13px; font-weight: 500; text-align: left; transition: border-color var(--t-fast), background var(--t-fast), transform 0.45s var(--spring); }
.preset > .icon:first-child { margin-left: 5px; color: #ffcb00; }
.preset > .icon:last-child { color: var(--text-3); }
.preset:hover:not(:disabled) { border-color: var(--line-2); background: var(--fill-2); }
.preset:active:not(:disabled) { transform: scale(0.96); transition-duration: 80ms; }
.col-config-head { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-m); background: rgba(4, 8, 18, 0.28); border: 1px solid var(--line); }
.col-config-head .type-tile { width: 42px; height: 42px; border-radius: 10px; }
.col-config-head strong { font: 600 15px/1.3 var(--font-display); }
.col-config-head p { font-size: 13px; color: var(--text-2); }
.col-center .form-actions { justify-content: space-between; }
.formula-input { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }
.formula-state { font-size: 12.5px; color: var(--text-3); }
.formula-state.is-ok { color: #8ff0c4; }
.formula-state.is-bad { color: #ffb0b0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border-radius: 6px; background: var(--fill-2); font-size: 12.5px; font-weight: 500; }
.chip-btn:hover { background: var(--fill-3); }
.chip-btn.is-fn { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; color: #cfe0ff; }
.link-btn { justify-self: start; }
.type-hint { display: flex; gap: 10px; padding: 6px; }
.type-hint p { font-size: 12.5px; color: var(--text-2); }
.kit-note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-s); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); font-size: 13px; line-height: 1.5; color: var(--text-2); }
.kit-note .icon { flex: none; margin-top: 2px; color: var(--accent-2); }
.kit-note strong { color: var(--text); font-weight: 600; }
.template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.template-card strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.template-card.is-kit { grid-column: 1 / -1; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.template-card.is-kit .template-icon { grid-row: span 2; margin: 0; width: 44px; height: 44px; }

/* ---------- Automatizaciones ---------- */
.auto-center { display: grid; gap: 16px; min-height: 260px; align-content: start; }
.auto-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auto-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-s); background: rgba(255, 203, 0, 0.12); border: 1px solid rgba(255, 203, 0, 0.3); color: #ffe9a3; font-size: 13px; }
.rule-list, .run-list { display: grid; gap: 8px; }
.rule-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: rgba(4, 8, 18, 0.24); transition: border-color var(--t-med), opacity var(--t-med); }
.rule-row:hover { border-color: var(--line-2); }
.rule-row.is-off .rule-body, .rule-row.is-off .rule-icon { opacity: 0.5; }
.rule-row.is-marked { border-color: rgba(255, 203, 0, 0.55); box-shadow: 0 0 0 3px rgba(255, 203, 0, 0.1); }
.rule-icon, .run-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 203, 0, 0.16); color: #ffcb00; }
.rule-body, .run-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rule-text { font-size: 14.5px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.rule-text b, .rule-preview b, .run-rule b { color: var(--text); font-weight: 600; }
.rule-gone { color: #ffb0b0; font-style: normal; text-decoration: line-through; }
.rule-meta, .run-meta { font-size: 12px; color: var(--text-3); }
.run-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--r-m); border: 1px solid var(--line); }
.run-icon { background: rgba(0, 200, 117, 0.16); color: var(--ok); }
.run-row.is-bad .run-icon { background: rgba(255, 117, 117, 0.16); color: var(--danger); }
.run-row.is-bad { border-color: rgba(255, 117, 117, 0.35); }
.run-body p { color: var(--text-2); overflow-wrap: anywhere; }
.run-body strong { color: var(--text); font-weight: 600; }
.auto-ideas { display: grid; gap: 10px; padding-top: 4px; }
.rule-builder { display: grid; gap: 14px; }
.rule-step { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: rgba(4, 8, 18, 0.24); }
.rule-word { font: 600 18px/38px var(--font-display); color: #ffcb00; }
.rule-word.is-then { color: var(--accent-2); }
.rule-step-body { display: grid; gap: 12px; min-width: 0; }
.rule-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.rule-params:empty { display: none; }
.rule-field { display: grid; gap: 6px; min-width: 0; align-content: start; font-size: 12.5px; color: var(--text-2); }
.rule-field.is-wide { grid-column: 1 / -1; }
.rule-preview { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: var(--r-s); background: var(--fill); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.rule-preview .icon { flex: none; margin-top: 3px; color: #ffcb00; }
.opt-chip { height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 40%, #fff); font-size: 12.5px; font-weight: 600; transition: background var(--t-fast), color var(--t-fast), transform 0.45s var(--spring); }
.opt-chip:active { transform: scale(0.94); transition-duration: 80ms; }
.opt-chip.is-on { background: var(--c); border-color: var(--c); color: var(--k, #fff); }

/* ---------- Panel del tablero ---------- */
.board-panel { display: grid; gap: 12px; align-content: start; }
.board-panel .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; align-items: start; }
.panel-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.panel-foot.is-warn { color: #ffb0b0; }
.goal .panel-head { margin-bottom: 12px; }
.meter { height: 12px; border-radius: 999px; background: rgba(0, 200, 117, 0.16); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 999px; background: #00c875; min-width: 4px; animation: wipe 0.9s var(--ease-out) both; }
.meter-note { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.meter-note strong { color: var(--text); font: 600 15px/1 var(--font-display); }
.hbars { display: grid; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.hbar-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 14px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--c); transform-origin: left; animation: bar-right 0.8s var(--ease-out) both; }
.hbar-fill.is-series { background: var(--series); }
@keyframes bar-right { from { transform: scaleX(0); } }
.hbar-row:hover .hbar-fill { filter: brightness(1.15); }
.hbar-value { display: grid; justify-items: end; line-height: 1.15; min-width: 64px; }
.hbar-value strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-value small { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; height: 190px; padding-top: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.col-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.col-value { font-size: 11.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-fill { width: min(100%, 38px); border-radius: 4px 4px 0 0; background: var(--series); transform-origin: bottom; animation: bar-up 0.8s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.col-bar:hover .col-fill { filter: brightness(1.15); }
.col-label { position: absolute; top: calc(100% + 5px); font-size: 12px; color: var(--text-3); }
.col-bar.is-now .col-label { color: var(--text); font-weight: 600; }

/* ---------- Pantallas angostas ---------- */
@media (max-width: 900px) {
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .sheet-side { order: -1; }
  .rule-step { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rule-word { line-height: 1.2; }
}
@media (max-width: 760px) {
  .drawer.sheet { border-radius: 0; }
  .sheet .drawer-scroll { padding: 14px 14px 24px; }
  .stage-path { flex-basis: 100%; overflow-x: auto; }
  .stage { flex: 1 0 auto; }
  .top-bell { width: 40px; }
  .template-grid { grid-template-columns: minmax(0, 1fr); }
  .hbar-row { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) auto; gap: 8px; }
  .auto-btn { padding: 0 10px; }
  .board-tools-right .filter-box { flex: 1 1 100%; }
}

/* ---------- Arrastrar grupos y listas ---------- */
.group-grip { width: 22px; height: 28px; padding: 0; margin-left: -6px; border-radius: 6px; opacity: 0.45; }
.tgroup:hover .group-grip, .group-grip:hover { opacity: 1; }
.group-grip:hover { background: var(--fill-2); color: var(--text); }
.grip:active { cursor: grabbing; }
.lane-head.is-movable { cursor: grab; border-radius: 10px; transition: background var(--t-fast); }
.lane-head.is-movable:hover { background: var(--fill); }
.lane-head.is-movable:active { cursor: grabbing; }
.tgroup.is-dragging, .lane.is-dragging { opacity: 0.4; outline: 2px dashed var(--line-2); outline-offset: -2px; }
.tgroup-head.is-drop-target { background: var(--accent-soft); border-radius: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.drop-marker.is-group { height: 4px; margin: -9px 6px; }
.drop-marker.is-x { flex: none; width: 4px; height: auto; align-self: stretch; margin: 0 -14px; }
/* Mientras se arrastra una fila, el grupo vacío ofrece espacio para soltarla */
[data-drag='item'] .tbody:empty { min-height: 44px; }
.tgroup.is-flash, .lane.is-flash { animation: flash-group 1.1s var(--ease-out); }
@keyframes flash-group { 0% { box-shadow: 0 0 0 2px var(--accent-2), 0 0 30px -6px var(--accent-2); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .tgroup.is-flash, .lane.is-flash { animation: none; } }
/* La fila se toma desde su asa; se ve siempre un poco para que se descubra */
.tbody .trow .grip { opacity: 0.3; }
.tbody .trow:hover .grip { opacity: 1; }

/* ---------- Selección, archivados y actividad del tablero ---------- */
.row-lead { display: flex; align-items: center; justify-content: flex-end; gap: 2px; padding-right: 6px; }
.thead .row-lead { padding-right: 6px; }
.row-check, .group-check { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; opacity: 0.35; transition: opacity var(--t-fast); }
.trow:hover .row-check, .row-check:checked, .row-check:focus-visible, .group-check:checked, .group-check:indeterminate, .thead:hover .group-check, .group-check:focus-visible { opacity: 1; }
.trow.is-selected { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.trow.is-selected .td { background: transparent; }
.select-bar { position: fixed; left: 50%; bottom: 22px; z-index: 40; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8), inset 0 0 0 1px var(--line-2); animation: bar-in 0.25s var(--ease-out); }
@keyframes bar-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.select-bar[hidden] { display: none; }
.select-count { margin-right: 6px; color: var(--text-2); white-space: nowrap; }
.select-count strong { color: var(--text); font: 600 15px/1 var(--font-display); }
.sum-chip.is-author { color: var(--text-2); }
.icon-btn.is-danger:hover:not(:disabled) { background: rgba(223, 47, 74, 0.22); color: #ffc7cd; }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.bin { display: grid; gap: 14px; min-height: 200px; align-content: start; }
.bin-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--r-s); background: var(--fill); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.bin-note .icon { flex: none; margin-top: 2px; color: var(--accent-2); }
.bin-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 38px; }
.bin-actions { display: flex; gap: 8px; }
.bin-list { display: grid; gap: 6px; }
.bin-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: rgba(4, 8, 18, 0.24); }
.bin-row.is-selected { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.bin-row .row-check { opacity: 1; }
.bin-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bin-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bin-text span { font-size: 12.5px; color: var(--text-3); }
.board-log { display: grid; gap: 12px; min-height: 260px; align-content: start; }
.log-list { max-height: min(60vh, 560px); overflow: auto; padding-right: 4px; }
.log-list .feed-row { align-items: center; }
.log-list .feed-body { flex: 1; min-width: 0; }
.log-day { padding: 12px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--text-3); list-style: none; }
.log-day::first-letter { text-transform: uppercase; }
.log-day:first-child { padding-top: 0; }
.log-tag { flex: none; padding: 2px 8px; border-radius: 6px; background: var(--fill-2); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.btn.is-small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.log-more { justify-self: center; }
@media (max-width: 760px) {
  .select-bar { left: 12px; right: 12px; bottom: 12px; transform: none; flex-wrap: wrap; animation: none; }
  .bin-row { flex-wrap: wrap; }
}

/* ---------- Carpetas y privacidad ---------- */
.side-folder { display: flex; align-items: center; gap: 6px; width: 100%; max-width: none; height: 32px; padding: 0 8px 0 calc(8px + var(--d, 0) * 14px); border-radius: 9px; color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left; transition: background var(--t-fast), color var(--t-fast); }
.side-folder:hover { background: var(--fill); color: var(--text); }
.side-folder > .icon:nth-child(2) { color: var(--c); }
.side-folder > span:not(.side-count) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-board { padding-left: calc(6px + var(--d, 0) * 14px); }
.side[data-collapsed='true'] .side-board { padding-left: 6px; }
.side[data-collapsed='true'] .side-folder { height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.side-lock { margin-left: auto; color: var(--text-3); display: inline-flex; }

.ws { display: grid; gap: 12px; }
.ws-head .btn.is-small { margin-left: auto; }
.ws-head .btn.is-small + .icon-btn { margin-left: 0; }
.ws-head.is-drop-target, .folder-head.is-drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 12px; }
.folder { display: grid; gap: 10px; padding: 4px 0 4px 14px; border-left: 2px solid color-mix(in srgb, var(--c) 45%, transparent); margin-left: 6px; }
.folder-head { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 2px 6px 2px 0; border-radius: 12px; transition: background var(--t-fast); }
.folder-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: 10px; text-align: left; color: var(--text-2); }
.folder-toggle:hover { background: var(--fill); color: var(--text); }
.folder-icon { display: inline-flex; color: var(--c); }
.folder-head h3 { font: 600 15px/1.2 var(--font-display); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-body { display: grid; gap: 10px; }
.board-grid.is-drop-target { outline: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 6px; border-radius: 14px; }
.board-card.is-dragging { opacity: 0.4; }
.board-card { position: relative; }
.board-card-menu { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity var(--t-fast); }
.board-card:hover .board-card-menu, .board-card-menu:focus-visible { opacity: 1; }
.privacy-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 7px; border-radius: 6px; background: var(--fill-2); color: var(--text-2); font: 500 11.5px/18px var(--font-ui); vertical-align: 2px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; margin-left: 4px; border-radius: 8px; background: var(--fill); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; font-weight: 600; transition: background var(--t-fast), color var(--t-fast); }
.privacy-pill:hover { background: var(--fill-2); color: var(--text); }
.privacy-pill.is-private { background: rgba(255, 203, 0, 0.12); border-color: rgba(255, 203, 0, 0.35); color: #ffe27a; }
.privacy-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.privacy-opt { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: rgba(4, 8, 18, 0.24); text-align: left; transition: border-color var(--t-fast), background var(--t-fast); }
.privacy-opt:hover { border-color: var(--line-2); }
.privacy-opt.is-active { border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: var(--accent-soft); }
.privacy-opt > span:last-child { display: grid; gap: 2px; }
.privacy-opt strong { font-weight: 600; }
.privacy-opt small { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.privacy-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--fill-2); color: var(--accent-2); }
.privacy-now { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--r-s); background: var(--fill); color: var(--text-2); }
.privacy-now strong { color: var(--text); }
.owner-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-m); border: 1px solid var(--line); }
.owner-row > span:nth-child(2) { flex: 1; display: grid; gap: 1px; }
.owner-row small { font-size: 12px; color: var(--text-3); }
.people-picker { display: grid; gap: 8px; }
.people-list { display: grid; gap: 2px; max-height: 240px; overflow: auto; padding: 4px; border-radius: var(--r-m); border: 1px solid var(--line); background: rgba(4, 8, 18, 0.24); }
.people-list.is-static { max-height: none; }
.people-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; list-style: none; }
.people-row:hover { background: var(--fill); }
.people-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.people-row > span:last-child { display: grid; gap: 1px; min-width: 0; }
.people-row small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-list { display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.place-row { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px 0 calc(12px + var(--d, 0) * 20px); border-radius: 9px; text-align: left; }
.place-row:hover:not(:disabled) { background: var(--fill-2); }
.place-row:disabled { opacity: 0.5; cursor: not-allowed; }
.place-row.is-current { opacity: 1; background: var(--accent-soft); }
.place-icon { display: inline-flex; color: var(--text-3); }
.place-note { margin-left: auto; font-size: 12px; color: var(--text-3); }
@media (max-width: 760px) { .privacy-choice { grid-template-columns: minmax(0, 1fr); } .folder { padding-left: 8px; } }

/* ---------- Galería de plantillas (v2.4) ---------- */
.modal.is-xl:has(.tpl) { width: min(1080px, 100%); }
.tpl-gallery { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; height: min(640px, calc(100dvh - 150px)); }
.tpl-side { overflow-y: auto; margin-left: -6px; padding-right: 4px; border-right: 1px solid var(--line); }
.tpl-cats { display: grid; gap: 1px; padding-right: 10px; }
.tpl-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: var(--r-s); color: var(--text-2); font-size: 13.5px; text-align: left; transition: background var(--t-fast), color var(--t-fast); }
.tpl-cat:hover { background: var(--fill); color: var(--text); }
.tpl-cat.is-active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.tpl-cat .count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tpl-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tpl-search { display: flex; align-items: center; gap: 9px; padding: 0 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: rgba(0, 0, 0, 0.22); color: var(--text-3); }
.tpl-search:focus-within { border-color: var(--accent); }
.tpl-search .input { border: 0; background: none; padding-left: 0; box-shadow: none; }
.tpl-heading { margin: 16px 0 10px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.tpl-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-content: start; padding: 2px 4px 6px 2px; }
.tpl-card { display: grid; gap: 6px; align-content: start; padding: 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: rgba(0, 0, 0, 0.22); text-align: left; transition: border-color var(--t-med), background var(--t-med), transform 0.45s var(--spring); }
.tpl-card:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 8%, rgba(0, 0, 0, 0.22)); }
.tpl-card:active { transform: scale(0.97); transition-duration: 80ms; }
.tpl-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-card strong { font-weight: 600; font-size: 14.5px; }
.tpl-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tpl-card .template-icon { margin: 0; }
.tpl-desc { font-size: 12.5px; line-height: 1.5; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-view { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); }
.tpl-none { grid-column: 1 / -1; display: grid; justify-items: start; gap: 12px; padding: 24px 4px; color: var(--text-2); }

.tpl-setup { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; max-height: min(640px, calc(100dvh - 150px)); }
.tpl-preview { overflow-y: auto; padding: 18px; border-radius: var(--r-m); background: color-mix(in srgb, var(--c) 7%, rgba(0, 0, 0, 0.24)); border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line)); }
.tpl-preview-head { display: flex; gap: 14px; align-items: flex-start; }
.tpl-preview-head h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tpl-preview-head p { margin-top: 4px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.template-icon.is-big { width: 46px; height: 46px; flex: none; margin: 0; }
.tpl-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 4px; font-size: 12.5px; color: var(--text-2); }
.tpl-facts li { display: inline-flex; align-items: center; gap: 6px; }
.tpl-facts .icon { color: var(--ok); }
.tpl-sub { margin: 16px 0 8px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px 0 8px; border-radius: 6px; font-size: 12.5px; background: color-mix(in srgb, var(--c) 18%, transparent); border-left: 3px solid var(--c); color: var(--text); }
.tpl-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.tpl-cols li { display: flex; align-items: center; gap: 8px; min-height: 26px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tpl-cols .icon { flex: none; color: var(--text-3); }
.tpl-kit-board { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-s); background: rgba(0, 0, 0, 0.2); }
.tpl-kit-board summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.tpl-form { overflow-y: auto; align-content: start; padding: 2px 4px 2px 2px; }

/* Miniatura del tablero */
.tpl-thumb { display: grid; gap: 10px; margin-top: 16px; padding: 12px; border-radius: var(--r-s); background: rgba(0, 0, 0, 0.28); }
.tpl-thumb-group { display: grid; gap: 3px; }
.tpl-thumb-title { font-size: 12px; font-weight: 600; color: var(--c); margin-bottom: 2px; }
.tpl-thumb-row { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 3px; border-left: 3px solid var(--c); border-radius: 3px; }
.tpl-thumb-row > * { height: 18px; background: var(--fill); }
.tpl-thumb-row.is-head > span { display: block; padding: 0 6px; font-size: 10.5px; line-height: 18px; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: none; }
.tpl-thumb-row i.is-pill { background: color-mix(in srgb, var(--c) 55%, transparent); }

.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-s); background: var(--fill); cursor: pointer; font-size: 13.5px; }
.check-row input { margin-top: 3px; accent-color: var(--accent); }
.check-row small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }

@media (max-width: 760px) {
  .tpl-gallery { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - 120px); }
  .tpl-side { border: 0; margin: 0; overflow-x: auto; overflow-y: hidden; }
  .tpl-cats { display: flex; gap: 6px; padding: 0 0 6px; }
  .tpl-cat { flex: none; white-space: nowrap; background: var(--fill); }
  .tpl-setup { grid-template-columns: minmax(0, 1fr); max-height: none; }
  .tpl-cols { grid-template-columns: minmax(0, 1fr); }
}

/* Soltar un tablero sobre otro: se juntan en una carpeta nueva */
.board-card { position: relative; }
.board-card.is-drop-target { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow); transform: scale(1.02); }
.board-card.is-drop-target::after {
  content: 'Suelta para crear una carpeta'; position: absolute; inset: auto 10px 10px; display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; pointer-events: none;
}
.board-card.is-drop-target > * { pointer-events: none; }
.folder.is-dragging { opacity: 0.45; }
.folder-toggle { cursor: grab; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
[data-drag='folder'] .board-grid { pointer-events: none; }
.side-board.is-drop-target, .side-folder.is-drop-target, .side-ws.is-drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 10px; }
.side-board.is-dragging { opacity: 0.4; }

/* ---------- Suite LAQ: correos en los tableros ---------- */
.modal.is-lg { width: min(700px, 100%); }
.mail-body { font-family: inherit; line-height: 1.5; resize: vertical; min-height: 150px; }
.mail-form .field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mail-actions { align-items: center; }
.mail-from { display: flex; align-items: center; gap: 6px; margin-right: auto; font-size: 12.5px; color: var(--text-3); min-width: 0; }
.mail-from.is-warn { color: #ffcb00; }
.token-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.token-hint { font-size: 12px; color: var(--text-3); }
.token-chip { height: 26px; padding: 0 9px; border-radius: 6px; border: 1px dashed var(--line-2); color: var(--text-2); font-size: 12.5px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-chip:hover { color: var(--text); background: var(--fill); border-style: solid; }
.token-chip:active { transform: scale(0.95); }
.rule-params > .auto-note { grid-column: 1 / -1; }
.mail-preview { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-s); background: var(--fill); border: 1px solid var(--line); }
.mail-preview:empty { display: none; }
.mail-preview-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.mail-preview strong { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.mail-preview p { color: var(--text-2); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 190px; overflow: auto; }
.kind-chip.is-mail { margin-left: auto; border-color: color-mix(in srgb, var(--c) 55%, transparent); color: var(--text); }
.entry-mail.is-pending .entry-body { border-style: dashed; border-color: color-mix(in srgb, #ffcb00 55%, transparent); }
.entry-head span em { font-style: normal; }
.mail-state { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; }
.mail-state.is-ok { background: rgba(0, 200, 117, 0.18); color: #6ee7b1; }
.mail-state.is-info { background: rgba(87, 155, 252, 0.2); color: #a9cbff; }
.mail-state.is-warn { background: rgba(255, 203, 0, 0.18); color: #ffe07a; }
.mail-state.is-bad { background: rgba(223, 47, 74, 0.22); color: #ff9aa9; }
.entry-head .auto-tag { margin-left: 6px; }
.mail-people { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.entry-body p.mail-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mail-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.mail-links:empty { display: none; }
.mail-links .link-btn { display: inline-flex; align-items: center; gap: 5px; }
.btn-small { height: 30px; padding: 0 12px; font-size: 13px; }
.suite-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.suite-pill.is-ok { background: rgba(0, 200, 117, 0.18); color: #6ee7b1; }
.suite-pill.is-off { background: rgba(255, 203, 0, 0.16); color: #ffe07a; }
button.sum-chip { cursor: pointer; font: inherit; }
.mail-links .link-btn, .mail-form .link-btn { color: var(--accent-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.mail-links .link-btn:hover, .mail-form .link-btn:hover { text-decoration: underline; }
