:root {
  --brand: #5b5fc7;
  --brand-strong: #4f52b2;
  --brand-soft: #e8ebfa;
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --bg-side: #f7f7f7;
  --line: #e1dfdd;
  --line-soft: #edebe9;
  --text: #242424;
  --text-2: #616161;
  --text-3: #8a8886;
  --late: #c50f1f;
  --late-bg: #fff4ce;
  --soon-bg: #e6f2fb;
  --ok: #107c10;
  --warn: #8a5a00;
  --radius: 6px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .08);
  --font: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.ic { flex: none; display: block; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.pad { padding: 12px; }
.right { text-align: right; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.txt-late { color: var(--late); }
.txt-ok { color: var(--ok); }
.txt-warn { color: var(--warn); }
.only-mobile { display: none !important; }
[hidden] { display: none !important; }

/* ---------- Botones y campos ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid #d1d1d1; border-radius: var(--radius); background: #fff; font-weight: 600; white-space: nowrap; text-decoration: none !important; color: var(--text); }
.btn:hover { background: var(--bg-soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.danger { background: var(--late); border-color: var(--late); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 40px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; justify-content: center; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-2); position: relative; flex: none; }
.icon-btn:hover { background: rgba(0, 0, 0, .06); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; }
.link-btn { border: 0; background: none; color: var(--brand); padding: 0; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea, .select-sm, .pop-form select, .fields select, .fields input, .add-member select, .table select, .inline-field select {
  border: 1px solid #d1d1d1; border-radius: var(--radius); padding: 6px 8px; background: #fff; min-height: 32px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .fields input:focus, .fields select:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.check-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; }
.check-row input { accent-color: var(--brand); width: 16px; height: 16px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #8a8886; padding: 4px 4px; min-width: 260px; color: var(--text-2); }
.search input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; padding: 4px 0; color: var(--text); }
.search:focus-within { border-bottom-color: var(--brand); border-bottom-width: 2px; padding-bottom: 3px; }
.search.sm { min-width: 0; margin: 4px 8px 8px; }

/* ---------- Estructura ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 280px; flex: none; background: var(--bg-side); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sb-head { display: flex; align-items: center; gap: 4px; padding: 16px 12px 12px 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--text); flex: 1; text-decoration: none !important; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 11px; font-weight: 400; color: var(--text-2); }
.brand-logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #7b83eb, #5b5fc7 55%, #c239b3); color: #fff; }
.brand-logo.big { width: 44px; height: 44px; border-radius: 12px; }
.bell .badge { position: absolute; top: 2px; right: 0; background: var(--late); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 5px; line-height: 14px; }
.sb-create { display: flex; margin: 4px 16px 16px; }
.sb-create .create-plan { flex: 1; border-radius: var(--radius) 0 0 var(--radius); height: 40px; font-size: 15px; justify-content: flex-start; }
.sb-create .create-more { border-radius: 0 var(--radius) var(--radius) 0; height: 40px; padding: 0 10px; border-left: 1px solid rgba(255, 255, 255, .35); }
.sb-scroll { flex: 1; overflow-y: auto; padding: 0 8px; }
.sb-nav a, .sb-plan, .sb-foot a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius); color: var(--text); text-decoration: none !important; font-size: 15px; }
.sb-nav a:hover, .sb-plan:hover, .sb-foot a:hover { background: rgba(0, 0, 0, .05); }
.sb-nav a.active, .sb-plan.active, .sb-foot a.active { background: #e9e9ef; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.sb-nav .ic { color: var(--text-2); }
.sb-section { font-size: 13px; color: var(--text-2); padding: 18px 10px 6px; }
.sb-empty { font-size: 12px; color: var(--text-3); padding: 4px 10px; }
.plan-tile { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 6px; color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .3px; }
.plan-tile.sm { width: 22px; height: 22px; font-size: 9px; border-radius: 5px; }
.plan-tile.lg { width: 40px; height: 40px; font-size: 14px; border-radius: 8px; }
.sb-foot { border-top: 1px solid var(--line); padding: 8px; }
.sb-foot a { font-size: 14px; padding: 7px 10px; }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: var(--radius); text-align: left; }
.me-btn:hover { background: rgba(0, 0, 0, .05); }
.me-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sb-backdrop { display: none; }
.main { flex: 1; min-width: 0; overflow: auto; background: var(--bg); }

/* ---------- Avatares ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 600; line-height: 1; box-shadow: 0 0 0 2px #fff; }
.avatar.pending { opacity: .55; }
.avatar.more { width: 24px; height: 24px; font-size: 10px; background: #8a8886; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -6px; }

/* ---------- Páginas ---------- */
.page { padding: 24px 32px 48px; max-width: 1400px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.page-head h1 { font-size: 24px; flex: 1; }
.page-actions { display: flex; gap: 8px; }
.page-sub { margin: 0 0 16px; }
.toolbar { display: flex; align-items: center; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-state h2 { color: var(--text); margin-bottom: 8px; }
.empty-state p { max-width: 520px; margin: 0 auto 16px; }
.row-gap { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.empty-inline { padding: 24px; color: var(--text-2); text-align: center; }

.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.plan-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); text-decoration: none !important; transition: box-shadow .15s; }
.plan-card:hover { box-shadow: var(--shadow); }
.plan-card-top { display: flex; align-items: center; gap: 12px; }
.plan-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-card-title b { font-size: 15px; }
.plan-card-title small { color: var(--text-2); }
.plan-card-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.pin-btn.on { color: var(--brand); }
.pin-btn.on .ic { fill: var(--brand-soft); }
.progress { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; flex: 1; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.progress-inline { display: flex; align-items: center; gap: 8px; min-width: 140px; }

/* ---------- Casilla de completado ---------- */
.check { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #616161; background: #fff; color: transparent; padding: 0; flex: none; }
.check:not(:disabled):hover { color: var(--brand); border-color: var(--brand); }
.check.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.check.lg { width: 28px; height: 28px; }
.check.sm { width: 18px; height: 18px; }
.check:disabled { opacity: .35; }

/* ---------- Mis tareas ---------- */
.mt-group { margin-bottom: 18px; }
.mt-group-head { display: flex; align-items: center; gap: 6px; border: 0; background: none; font-weight: 600; font-size: 15px; padding: 6px 0; }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 10px; background: var(--bg-soft); color: var(--text-2); font-size: 12px; text-align: center; font-weight: 600; }
.mt-row { display: grid; grid-template-columns: 28px 1fr 100px 100px 80px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 6px; cursor: pointer; background: #fff; }
.mt-row:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.mt-main { min-width: 0; display: flex; flex-direction: column; }
.mt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-name.done { text-decoration: line-through; color: var(--text-2); }
.mt-main small { color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.plan-dot, .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mt-progress { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); font-weight: 600; white-space: nowrap; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #eef0fb, #f7f0fa); padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; padding: 32px; border-radius: 12px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-brand h1 { font-size: 24px; }
.login-brand p { margin: 0; color: var(--text-2); }
.login-error { background: #fde7e9; color: var(--late); padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; font-size: 13px; }
.login-card .muted { margin: 16px 0 0; text-align: center; }

/* ---------- Plan ---------- */
.plan-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.plan-head { display: flex; align-items: center; gap: 16px; padding: 10px 24px 0; border-bottom: 1px solid var(--line); min-height: 64px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; font-size: 18px; color: var(--text-2); }
.crumb-link { color: var(--text-2); }
.plan-name { display: flex; align-items: center; gap: 6px; border: 0; background: none; font-size: 20px; padding: 4px 6px; border-radius: var(--radius); min-width: 0; color: var(--text); }
.plan-name:hover { background: var(--bg-soft); }
.view-tabs { display: flex; align-items: stretch; gap: 2px; align-self: stretch; }
.view-tab { display: flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--text-2); border-bottom: 3px solid transparent; text-decoration: none !important; font-size: 13px; }
.view-tab span { display: none; }
.view-tab:hover { color: var(--brand); }
.view-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.view-tab.active span { display: inline; font-weight: 600; }
.plan-toolbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; flex-wrap: wrap; }
.plan-toolbar:empty { display: none; }
.toolbar-right { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tool-btn { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 10px; border-radius: var(--radius); font-size: 15px; }
.tool-btn:hover { background: var(--bg-soft); }
.tool-btn.on { color: var(--brand); font-weight: 600; }
.plan-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- Cuadrícula ---------- */
.grid-scroll { flex: 1; overflow: auto; padding: 0 0 40px; }
.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; min-width: 100%; }
.grid th { position: sticky; top: 0; z-index: 3; background: #fff; text-align: left; font-weight: 400; font-size: 14px; color: var(--text); padding: 14px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { border-bottom: 1px solid var(--line-soft); height: 48px; padding: 0 6px; background: #fff; white-space: nowrap; overflow: hidden; }
.grid .c-num { position: sticky; left: 0; z-index: 2; text-align: center; color: var(--text-2); font-size: 13px; }
.grid .c-check { position: sticky; left: 52px; z-index: 2; text-align: center; }
.grid .c-name { position: sticky; left: 92px; z-index: 2; border-right: 1px solid var(--line-soft); }
.grid th.c-num, .grid th.c-check, .grid th.c-name { z-index: 4; }
.grid th.c-name { padding-left: 16px; }
.grid tr:hover td { background: #fafafa; }
.grid tr.row-selected td { background: var(--brand-soft); }
.name-wrap { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tree-tog { display: grid; place-items: center; width: 22px; height: 22px; border: 0; background: none; padding: 0; color: var(--text); border-radius: 4px; flex: none; }
.tree-tog:hover { background: rgba(0, 0, 0, .07); }
.tree-sp { width: 22px; flex: none; }
.tree-sp.sm { width: 18px; }
.cell-in { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 5px 6px; outline: none; min-width: 0; height: 32px; }
.cell-in:hover:not(:disabled) { border-color: var(--line); }
.cell-in:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 1px var(--brand); }
.cell-in:disabled { opacity: 1; color: inherit; }
select.cell-in { appearance: none; -webkit-appearance: none; cursor: pointer; }
select.cell-in:disabled { cursor: default; }
input[type=date].cell-in { font-size: 13.5px; }
.name-in { font-size: 14.5px; flex: 1; text-overflow: ellipsis; }
.g-row.summary .name-in, .g-row.summary .sum-val { font-weight: 700; }
.g-row.done .name-in { text-decoration: line-through; }
.g-row.dim td { color: var(--text-2); }
.g-row.dim .name-in { color: var(--text-2); }
.sum-val { padding: 0 7px; font-size: 14px; }
.row-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; color: var(--text-2); border-radius: 4px; padding: 0; opacity: 0; flex: none; }
.g-row:hover .row-btn, .row-btn:focus { opacity: 1; }
.row-btn:hover { background: rgba(0, 0, 0, .07); color: var(--brand); }
.mini-count { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--text-2); padding: 0 4px; flex: none; }
.assign-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; border: 1px solid transparent; background: none; border-radius: 4px; padding: 0 6px; text-align: left; min-width: 0; }
.assign-btn:hover:not(:disabled) { border-color: var(--line); }
.assign-btn:disabled { opacity: 1; }
.assign-names { font-size: 14px; }
.add-hint { opacity: 0; font-size: 13px; }
.g-row:hover .add-hint { opacity: 1; }
.c-date.hl-late input, .c-date.hl-late .sum-val { background: var(--late-bg); }
.c-date.hl-soon input, .c-date.hl-soon .sum-val { background: var(--soon-bg); }
.c-date.hl-late .sum-val, .c-date.hl-soon .sum-val { padding: 6px 7px; border-radius: 4px; }
.pct-cell { display: flex; align-items: center; gap: 2px; }
.pct-cell input { text-align: right; }
.pct-cell span { color: var(--text-2); }
.pct-cell.boxed input { width: 70px; }
.prio-urgent { color: #c50f1f; font-weight: 600; }
.prio-important { color: #ca5010; font-weight: 600; }
.grid th.bl, .grid td.bl { background: #fafaff; color: var(--text-2); font-size: 13px; padding: 0 10px; }
.add-row td { border-bottom: 0; color: var(--brand); }
.add-row .cell-in::placeholder { color: var(--brand); }
.add-row .c-check .ic { margin: auto; }

/* ---------- Popover / menús ---------- */
.popover { position: fixed; z-index: 60; min-width: 220px; max-width: 360px; max-height: 70vh; overflow: auto; background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 4px 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; border: 0; background: none; text-align: left; color: var(--text); text-decoration: none !important; font-size: 14px; }
.menu-item:hover:not(:disabled) { background: var(--bg-soft); }
.menu-item.danger { color: var(--late); }
.menu-item .ic { color: var(--text-2); }
.menu-item.danger .ic { color: var(--late); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head div { display: flex; flex-direction: column; min-width: 0; }
.menu-head small { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.pop-form { padding: 12px 14px; width: 300px; }
.pop-form .field select { width: 100%; }
.swatch-mini { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); }
.swatch-mini.late { background: var(--late-bg); }
.swatch-mini.soon { background: var(--soon-bg); }
.swatch-mini.done { background: #eee; }
.picker { width: 320px; }
.picker-list { max-height: 320px; overflow: auto; }
.picker-sep { font-size: 12px; color: var(--text-2); padding: 8px 14px 4px; border-top: 1px solid var(--line-soft); }
.picker-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 14px; border: 0; background: none; text-align: left; min-width: 0; }
.picker-item:hover { background: var(--bg-soft); }
.picker-name { display: flex; flex-direction: column; min-width: 0; }
.picker-name small { color: var(--text-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.cbox { display: grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid #616161; border-radius: 3px; flex: none; color: #fff; }
.picker-item.on .cbox { background: var(--brand); border-color: var(--brand); }

/* ---------- Notificaciones ---------- */
.notif-pop { width: 380px; max-width: calc(100vw - 16px); }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 60vh; overflow: auto; }
.notif { display: flex; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.notif:hover { background: var(--bg-soft); }
.notif.unread { background: #f3f4fd; }
.notif.unread .notif-body > span { font-weight: 600; }
.notif-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); flex: none; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-body small { color: var(--text-2); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: grid; place-items: center; z-index: 70; padding: 16px; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 8px; }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 8px 24px; overflow: auto; }
.modal-body p { margin: 0 0 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch input { display: none; }
.swatch i { display: block; width: 28px; height: 28px; border-radius: 6px; background: var(--c); cursor: pointer; }
.swatch input:checked + i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.check-list { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 10px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #323130; color: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow); transition: opacity .4s; max-width: 90vw; }
.toast.error { background: var(--late); }
.toast.success { background: var(--ok); }
.toast.out { opacity: 0; }

/* ---------- Tablero (Kanban) ---------- */
.board-bar { display: flex; align-items: center; gap: 16px; padding: 0 24px 10px; flex-wrap: wrap; }
.inline-field { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.board { flex: 1; display: flex; gap: 16px; overflow: auto; padding: 4px 24px 24px; align-items: flex-start; }
.col { width: 290px; flex: none; display: flex; flex-direction: column; gap: 8px; max-height: 100%; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 6px 4px; }
.col-head b { flex: 1; font-size: 15px; }
.col-cards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 8px; padding: 2px; transition: background .1s; }
.col-cards.drop-over { background: var(--brand-soft); outline: 2px dashed var(--brand); }
.add-card, .add-bucket { display: flex; align-items: center; gap: 6px; border: 0; background: var(--bg-soft); border-radius: var(--radius); padding: 8px 10px; color: var(--text); font-weight: 600; }
.add-card:hover, .add-bucket:hover { background: #ebebeb; }
.col-new { padding-top: 36px; }
.card { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.card:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.card.dragging { opacity: .5; }
.card.done .card-title { text-decoration: line-through; color: var(--text-2); }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.label { background: #f3e8fd; color: #6b2fa0; border-radius: 4px; padding: 1px 8px; font-size: 12px; }
.card-top { display: flex; gap: 10px; align-items: flex-start; }
.card-top .check { width: 20px; height: 20px; margin-top: 1px; }
.card-title { font-weight: 600; line-height: 1.35; word-break: break-word; }
.card-parent { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 2px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); }
.card-meta:empty { display: none; }
.meta { display: inline-flex; align-items: center; gap: 4px; }
.card-foot { display: flex; justify-content: flex-end; }
.card.mini { gap: 6px; padding: 8px 10px; }
.card.mini .dot { margin-top: 6px; }
.people .col { width: 270px; }
.person-head { gap: 10px; }
.person-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.person-info small { color: var(--text-2); }

/* ---------- Cronograma ---------- */
.seg { display: inline-flex; border: 1px solid #d1d1d1; border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 5px 12px; font-size: 13px; }
.seg button + button { border-left: 1px solid #d1d1d1; }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }
.legend i.lg-bl { background: repeating-linear-gradient(45deg, #b4b4b4, #b4b4b4 2px, #e1e1e1 2px, #e1e1e1 4px); }
.tl { flex: 1; overflow: auto; position: relative; border-top: 1px solid var(--line); }
.tl-inner { position: relative; }
.tl-head { display: flex; position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); height: 52px; }
.tl-corner { position: sticky; left: 0; z-index: 6; background: #fff; border-right: 1px solid var(--line); padding: 16px 16px; flex: none; }
.tl-scale { position: relative; flex: none; }
.tl-months, .tl-ticks { position: relative; height: 26px; }
.tl-month { position: absolute; top: 0; height: 26px; border-left: 1px solid var(--line); padding: 5px 8px; font-size: 12px; font-weight: 600; text-transform: capitalize; overflow: hidden; white-space: nowrap; }
.tl-tick { position: absolute; top: 0; height: 26px; font-size: 11px; color: var(--text-2); text-align: center; padding-top: 5px; border-left: 1px solid var(--line-soft); }
.tl-tick.we { background: #fafafa; }
.tl-body { position: relative; }
.tl-left { position: sticky; left: 0; z-index: 4; background: #fff; border-right: 1px solid var(--line); }
.tl-left-row { display: flex; align-items: center; height: 40px; border-bottom: 1px solid var(--line-soft); cursor: pointer; gap: 6px; padding-right: 8px; }
.tl-left-row:hover { background: #fafafa; }
.tl-left-row .c-num { width: 40px; text-align: center; color: var(--text-2); font-size: 12px; flex: none; }
.tl-left-row.summary { font-weight: 700; }
.tl-left-row.done .ellipsis { text-decoration: line-through; color: var(--text-2); }
.tl-left-row.row-selected { background: var(--brand-soft); }
.tl-name { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; }
.tl-canvas { position: absolute; top: 0; bottom: 0; }
.tl-weekend { position: absolute; top: 0; bottom: 0; background: #fafafa; }
.tl-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); }
.tl-row-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-soft); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--late); z-index: 2; }
.tl-arrows { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; overflow: visible; }
.tl-arrows path { fill: none; stroke: #8a8886; stroke-width: 1.3; }
.tl-arrows path.head { fill: #8a8886; stroke: none; }
.bar { position: absolute; height: 22px; border-radius: 4px; background: color-mix(in srgb, var(--bar, #0f6cbd) 30%, white); border: 1px solid var(--bar, #0f6cbd); overflow: hidden; cursor: pointer; z-index: 3; }
.bar i { display: block; height: 100%; background: var(--bar, #0f6cbd); }
.bar:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.bar.sum { height: 10px; margin-top: 6px; border-radius: 2px; background: #c8c6c4; border-color: #484644; }
.bar.sum i { background: #484644; }
.bar.selected, .bar.row-selected { outline: 2px solid var(--brand); outline-offset: 1px; }
.bar-bl { position: absolute; height: 6px; border-radius: 2px; background: repeating-linear-gradient(45deg, #a19f9d, #a19f9d 2px, #e1dfdd 2px, #e1dfdd 4px); z-index: 2; }
.bar-label { position: absolute; font-size: 12px; color: var(--text-2); white-space: nowrap; z-index: 4; pointer-events: none; background: rgba(255, 255, 255, .9); padding: 0 4px; border-radius: 3px; }
.bar-label:empty { display: none; }

/* ---------- Gráficos ---------- */
.charts { flex: 1; overflow: auto; padding: 4px 24px 32px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { color: var(--text-2); font-size: 13px; }
.kpi b { font-size: 28px; font-weight: 600; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.chart-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.chart-card h3 { font-size: 15px; margin-bottom: 14px; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-n { font-size: 30px; font-weight: 600; fill: var(--text); }
.donut-l { font-size: 12px; fill: var(--text-2); }
.legend-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 160px; }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.legend-list i { width: 12px; height: 12px; border-radius: 3px; }
.legend-list b { margin-left: auto; }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 34px; gap: 10px; align-items: center; margin-bottom: 10px; }
.hbar-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.hbar-track { height: 14px; }
.hbar { display: flex; height: 100%; border-radius: 3px; overflow: hidden; min-width: 2px; }
.hbar-n { text-align: right; font-weight: 600; font-size: 13px; }

/* ---------- Tablas genéricas ---------- */
.page-inner { padding: 8px 24px 32px; overflow: auto; flex: 1; }
.members-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0 16px; }
.members-head h2 { font-size: 18px; margin-bottom: 4px; }
.members-head p { margin: 0; max-width: 620px; }
.add-member { display: flex; gap: 8px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table.compact th, .table.compact td { padding: 6px 8px; font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fafafa; }
.person { display: flex; align-items: center; gap: 10px; }
.tag { font-size: 11px; background: #fff4ce; color: var(--warn); border-radius: 4px; padding: 1px 6px; }
.status { font-size: 12px; font-weight: 600; border-radius: 10px; padding: 2px 10px; }
.status.ok { background: #dff6dd; color: var(--ok); }
.status.warn { background: #fff4ce; color: var(--warn); }
.status.off { background: #f3f2f1; color: var(--text-2); }

/* ---------- Panel de tarea ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 100vw; background: #fff; box-shadow: -8px 0 28px rgba(0, 0, 0, .14); z-index: 50; display: flex; flex-direction: column; animation: slideIn .16s ease-out; }
.drawer.out { transform: translateX(100%); transition: transform .16s ease-in; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-loading { padding: 40px; color: var(--text-2); }
.drawer-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 8px 20px; border-bottom: 1px solid var(--line-soft); }
.drawer-plan { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--text-2); font-size: 13px; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px 32px; }
.drawer-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.title-in { flex: 1; border: 1px solid transparent; border-radius: var(--radius); font-size: 20px; font-weight: 600; resize: none; padding: 2px 6px; outline: none; overflow: hidden; line-height: 1.3; }
.title-in:hover:not(:disabled) { border-color: var(--line); }
.title-in:focus { border-color: var(--brand); }
.title-in:disabled { background: none; }
.note { display: flex; gap: 8px; align-items: center; background: var(--soon-bg); color: #0f548c; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; margin: 0 0 12px; }
.fields { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.f-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; min-height: 40px; gap: 8px; }
.f-row > label { color: var(--text-2); font-size: 13px; }
.f-val { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.f-val select, .f-val input:not([type=number]) { width: 100%; max-width: 280px; }
.f-val.two select { width: auto; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft); border-radius: 14px; padding: 2px 10px 2px 2px; font-size: 13px; }
.dep-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-soft); border-radius: 4px; padding: 2px 4px 2px 8px; font-size: 13px; max-width: 100%; }
.dep-chip .link-btn { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-chip .x { border: 0; background: none; display: grid; place-items: center; color: var(--text-2); padding: 2px; }
.d-section { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 14px; }
.d-section h4 { font-size: 14px; margin-bottom: 10px; display: flex; gap: 8px; }
.notes-in { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; resize: vertical; outline: none; }
.notes-in:focus { border-color: var(--brand); }
.sub-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 6px 4px; text-align: left; border-radius: 4px; }
.sub-row:hover { background: var(--bg-soft); }
.sub-row .ellipsis { flex: 1; }
.checklist { display: flex; flex-direction: column; gap: 2px; }
.cl-item { display: flex; align-items: center; gap: 8px; }
.cl-title { flex: 1; border: 1px solid transparent; border-radius: 4px; padding: 5px 6px; outline: none; background: none; }
.cl-title:hover:not(:disabled) { border-color: var(--line); }
.cl-title:focus { border-color: var(--brand); }
.cl-title.done { text-decoration: line-through; color: var(--text-2); }
.cl-add { display: flex; align-items: center; gap: 8px; color: var(--brand); padding: 4px 0; }
.cl-add input { flex: 1; border: 0; border-bottom: 1px solid var(--line); padding: 6px 4px; outline: none; }
.cl-add input:focus { border-bottom-color: var(--brand); }
.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; }
.comment-meta small { color: var(--text-2); }
.comment-meta .icon-btn { margin-left: auto; opacity: 0; }
.comment:hover .comment-meta .icon-btn { opacity: 1; }
.comment-text { background: var(--bg-soft); border-radius: 8px; padding: 8px 12px; margin-top: 4px; line-height: 1.45; word-break: break-word; }
.mention { color: var(--brand); font-weight: 600; }
.comment-box { position: relative; }
.comment-box textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; resize: vertical; outline: none; }
.comment-box textarea:focus { border-color: var(--brand); }
.comment-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.mention-list { position: absolute; bottom: 100%; left: 0; background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 4px 0; min-width: 240px; z-index: 5; }

/* ---------- Carteras ---------- */
.pf { border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px 6px; margin-bottom: 20px; }
.pf-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.pf-head > div:first-child { flex: 1; min-width: 200px; }
.pf-head h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.pf-head p { margin: 4px 0 0; }
.pf-kpis { display: flex; gap: 16px; color: var(--text-2); font-size: 13px; flex-wrap: wrap; }
.pf-kpis b { color: var(--text); font-size: 16px; }

/* ---------- Importación ---------- */
.import-help { background: var(--bg-soft); border-radius: 10px; padding: 16px 20px; margin: 12px 0 20px; }
.import-help h3 { font-size: 15px; margin-bottom: 8px; }
.import-help ol { margin: 0 0 8px; padding-left: 20px; line-height: 1.7; }
.import-help p { margin: 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed #c8c6c4; border-radius: 12px; padding: 36px; cursor: pointer; color: var(--text-2); text-align: center; }
.dropzone b { color: var(--text); font-size: 16px; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.import-files { margin-top: 20px; }
.imp-file { border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; }
.imp-file.error { border-color: #f1bbbc; background: #fdf3f4; color: var(--late); }
.imp-file h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-grid { display: grid; grid-template-columns: 2fr 2fr 1.5fr; gap: 12px; }
.imp-file details { margin: 4px 0 12px; }
.imp-file summary { cursor: pointer; color: var(--brand); font-weight: 600; padding: 4px 0; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; margin-top: 10px; }
.imp-preview { overflow: auto; max-height: 300px; border: 1px solid var(--line-soft); border-radius: 6px; }
.imp-actions { display: flex; justify-content: flex-end; }
.imp-result { border: 1px solid #c4e7c2; background: #f1faf1; border-radius: 10px; padding: 16px 20px; }
.imp-result h3 { margin-bottom: 8px; }
.imp-result p { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }

/* ---------- Indicadores: ICA, ruta crítica, portafolio ---------- */
.ica { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.ica i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.ica-green i { background: #1f8a65; }
.ica-yellow i { background: #e3a92b; }
.ica-red i { background: #d64545; }
.ica-gray i { background: #c8c6c4; }
.ica-gray { color: var(--text-2); font-weight: 400; }
.c-ica { padding-left: 12px !important; }
.link-btn.txt-late { color: var(--late); }
.sum-val.plain { font-weight: 400; color: var(--text-2); }
.crit-swatch { width: 14px; height: 14px; border-radius: 3px; background: #fde3d6; border: 1.5px solid #d4570f; }
.crit-chip { font-size: 11px; font-weight: 600; color: #b3470a; background: #fde3d6; border-radius: 10px; padding: 1px 8px; }
.grid tr.critical td { background: #fff3ec; }
.grid tr.critical:hover td { background: #ffe9dd; }
.grid tr.critical .name-in { color: #b3470a; font-weight: 600; text-decoration-color: #b3470a; }
.grid tr.critical td.c-num { box-shadow: inset 3px 0 0 #d4570f; color: #b3470a; font-weight: 600; }

.page.wide { max-width: 1500px; }
.pf-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 16px; }
.pf-date { margin-left: auto; }
.card-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 18px; background: #fff; }
.card-box h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.box-head .ica { font-weight: 400; gap: 3px; }
.sub-h { font-size: 14px; margin: 18px 0 6px; }
.health h3 { margin-bottom: 14px; }
.health-bar { display: flex; gap: 3px; height: 18px; border-radius: 9px; overflow: hidden; }
.health-bar i { display: block; height: 100%; }
.health-legend { display: flex; gap: 32px; margin-top: 12px; flex-wrap: wrap; font-size: 14px; }
.health-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pf-kpis-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi-btn { text-align: left; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.kpi-btn:hover { border-color: var(--late); box-shadow: 0 2px 10px rgba(197, 15, 31, .12); }
.kpi-btn span { display: flex; align-items: center; gap: 4px; }
.kpi-ica .ica { font-size: 26px; gap: 10px; }
.kpi-ica .ica i { width: 18px; height: 18px; }
.table-wrap { overflow-x: auto; }
.pf-table td, .pf-table th { white-space: nowrap; }
.progress.exp i { background: #5b9cf6; }
.total-row td { font-weight: 700; border-top: 2px solid var(--line); }
.chart-scroll { overflow-x: auto; }
.bars .gl { stroke: var(--line-soft); stroke-dasharray: 4 4; }
.bars .ax { font-size: 12px; fill: var(--text-2); }
.bars .lbl { font-weight: 600; fill: var(--text); }
.bars .hit { fill: transparent; }
.bars .bar-g:hover .hit { fill: rgba(91, 95, 199, .06); }
.chart-legend { display: flex; justify-content: center; gap: 24px; font-size: 13px; margin-top: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 50%; }
.chart-tip { position: fixed; z-index: 80; background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; min-width: 190px; pointer-events: none; }
.chart-tip div { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.chart-tip div b { margin-left: auto; }
.chart-tip i { width: 10px; height: 10px; border-radius: 50%; }
.late-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 65; display: flex; justify-content: center; align-items: flex-start; padding: 32px 16px; }
.late-panel { background: #fff; border-radius: 12px; box-shadow: var(--shadow); width: min(1400px, 100%); max-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.late-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 24px 10px; border-bottom: 1px solid var(--line-soft); }
.late-head h2 { font-size: 20px; }
.late-head p { margin: 4px 0 0; }
.late-board { padding-top: 16px; overflow: auto; }
.late-board .col { width: 300px; }
.card-plan { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .view-tab.active span { display: none; }
  .tool-btn span { display: none; }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-grid !important; }
  .hide-mobile { display: none !important; }
  .sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 35; }
  .page { padding: 16px 16px 40px; }
  .plan-head { padding: 8px 12px 0; gap: 8px; }
  .plan-toolbar, .board-bar { padding-left: 16px; padding-right: 16px; }
  .board, .charts, .page-inner { padding-left: 16px; padding-right: 16px; }
  .search { min-width: 0; flex: 1; }
  .view-tabs { width: 100%; overflow-x: auto; }
  .mt-row { grid-template-columns: 28px 1fr 80px; }
  .mt-row .chip, .mt-row .mt-progress { display: none; }
  .imp-grid, .two-cols { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .f-row { grid-template-columns: 110px 1fr; }
  .grid .c-name { position: static; }
  .grid .c-check { position: static; }
  .grid .c-num { position: static; }
  .table { display: block; overflow-x: auto; }
}
