/* Stellar Board — interfaz. Disposición de tablero de tarjetas, imagen de Stellar. */
:root {
  --cobalt: #1B5BE0; --cobalt-d: #1449b8; --cobalt-l: #e9f0fd; --navy: #0c1445;
  --text: #172b4d; --text-2: #44546f; --text-3: #626f86; --line: #dcdfe4;
  --bg-list: #f1f2f4; --bg-btn: #091e420f; --bg-btn-h: #091e4224; --danger: #c9372c; --ok: #1f845a;
  --warn: #f5cd47; --radius: 8px; --shadow: 0 1px 1px #091e4240, 0 0 1px #091e424f;
  --shadow-pop: 0 8px 12px #091e4226, 0 0 1px #091e424f;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('fonts/inter-latin.woff2') format('woff2'); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: #fff; line-height: 20px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.svg { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; }
.svg-lg { width: 20px; height: 20px; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- botones y campos */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 4px; padding: 6px 12px;
  background: var(--bg-btn); color: var(--text); cursor: pointer; font-weight: 500; min-height: 32px; text-decoration: none; }
.btn:hover { background: var(--bg-btn-h); text-decoration: none; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-d); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ae2e24; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-btn); }
.btn-block { width: 100%; justify-content: flex-start; }
.btn-sm { min-height: 28px; padding: 4px 8px; font-size: 13px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus:not(:focus-visible), .avatar:focus:not(:focus-visible) { outline: none; }
.btn:focus-visible, .pop-item:focus-visible, .card:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.input, textarea.input, select.input { width: 100%; border: 1px solid #8590a2; border-radius: 4px; padding: 6px 10px;
  background: #fff; min-height: 36px; outline: none; }
.input:focus { border-color: var(--cobalt); box-shadow: inset 0 0 0 1px var(--cobalt); }
textarea.input { resize: vertical; min-height: 80px; line-height: 20px; }
label.lbl { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin: 12px 0 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--cobalt); margin: 0; }

/* ---------- cabecera de la app */
.topbar { height: 48px; display: flex; align-items: center; gap: 4px; padding: 0 8px;
  background: linear-gradient(135deg, #1450C8 0%, #1B5BE0 100%);   /* cobalto de Stellar, como HR y Admin */
  color: #fff; position: relative; z-index: 30; box-shadow: 0 1px 0 rgba(9,16,40,.18); }
.topbar .logo { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; color: #fff;
  font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.topbar .logo img { height: 24px; width: auto; display: block; }
.topbar .logo:hover { background: #ffffff29; text-decoration: none; }
.topbar .tb-btn { background: transparent; color: #fff; border: 0; border-radius: 4px; padding: 6px 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-weight: 500; min-height: 32px; }
.topbar .tb-btn:hover { background: #ffffff29; }
.topbar .tb-create { background: #fff; color: var(--cobalt); font-weight: 600; margin-left: 4px; }
.topbar .tb-create:hover { background: #e9f0fd; }
.topbar .spacer { flex: 1; }
.topbar .search { position: relative; width: 260px; }
.topbar .search input { width: 100%; height: 32px; border-radius: 4px; border: 1px solid #ffffff52; background: #ffffff29;
  color: #fff; padding: 0 10px 0 32px; outline: none; }
.topbar .search input::placeholder { color: #ffffffcc; }
.topbar .search input:focus { background: #fff; color: var(--text); }
.topbar .search .svg { position: absolute; left: 9px; top: 8px; color: #ffffffcc; pointer-events: none; }
.topbar .search input:focus + .svg { color: var(--text-3); }
.topbar .bell { position: relative; }
.topbar .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.topbar .bell .dot { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; border-radius: 8px;
  background: #e2483d; color: #fff; font-size: 11px; line-height: 16px; text-align: center; padding: 0 4px; font-weight: 700; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px; flex: none; user-select: none; border: 0; cursor: pointer; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 40px; height: 40px; font-size: 15px; }

/* ---------- desplegables y ventanas emergentes */
.pop { position: fixed; z-index: 100; background: #fff; border-radius: 8px; box-shadow: var(--shadow-pop); width: 304px;
  max-height: calc(100vh - 80px); overflow: auto; color: var(--text); }
.pop-head { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; padding: 4px 8px; }
.pop-head h3 { text-align: center; font-size: 14px; font-weight: 600; color: var(--text-2); grid-column: 2; }
.pop-head .x { grid-column: 3; }
.pop-head .back { grid-column: 1; }
.pop-body { padding: 4px 12px 12px; }
.pop-sec { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 12px 0 6px; }
.pop-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0;
  padding: 6px 12px; cursor: pointer; border-radius: 0; min-height: 32px; color: var(--text); }
.pop-body .pop-item { margin: 0 -12px; width: calc(100% + 24px); }
.pop-item:hover { background: var(--bg-btn); text-decoration: none; }
.pop-item.sel { font-weight: 600; }
.pop-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.pop .note { font-size: 12px; color: var(--text-3); margin: 6px 0; }
.overlay { position: fixed; inset: 0; z-index: 90; }

/* ---------- inicio */
.home { display: flex; width: 100%; padding: 32px 40px; gap: 40px; }   /* todo el ancho (regla de Alejandro) */
.home-nav { width: 240px; flex: none; }
.home-nav a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; color: var(--text); font-weight: 500; }
.home-nav a.on { background: var(--cobalt-l); color: var(--cobalt); }
.home-nav a:hover { background: var(--bg-btn); text-decoration: none; }
.home-main { flex: 1; min-width: 0; }
.home-sec { margin-bottom: 40px; }
.home-sec h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--text-2); margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(194px, 1fr)); gap: 16px; }
.tile { position: relative; height: 96px; border-radius: 8px; padding: 10px 12px; color: #fff; font-weight: 600; font-size: 15px; letter-spacing: -.1px;
  background-size: cover; background-position: center; display: block; overflow: hidden; line-height: 20px; word-break: break-word; }
.tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,16,40,.62) 0%, rgba(9,16,40,.18) 62%, rgba(9,16,40,.05) 100%); transition: background .15s; }
.tile:hover::before { background: linear-gradient(180deg, rgba(9,16,40,.72) 0%, rgba(9,16,40,.32) 100%); }
.tile { box-shadow: 0 1px 2px rgba(9,30,66,.18); transition: transform .12s ease, box-shadow .12s ease; }
.tile:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(9,30,66,.18); }
.tile:hover { text-decoration: none; }
.tile span { position: relative; }
.tile .star { position: absolute; right: 6px; bottom: 6px; background: none; border: 0; color: #fff; padding: 4px; cursor: pointer;
  opacity: 0; transition: opacity .1s, transform .1s; z-index: 2; }
.tile:hover .star, .tile .star.on { opacity: 1; }
.tile .star.on { color: #f5cd47; }
.tile .star:hover { transform: scale(1.2); }
.tile.new { background: var(--bg-btn); color: var(--text); font-weight: 400; font-size: 14px; display: flex; align-items: center;
  justify-content: center; border: 0; cursor: pointer; flex-direction: column; }
.tile.new::before { display: none; }
.tile.new:hover { background: var(--bg-btn-h); }
.tile .tpl-tag { position: absolute; left: 10px; bottom: 8px; font-size: 11px; font-weight: 600; background: #ffffff33;
  border-radius: 3px; padding: 0 6px; }

/* ---------- tablero */
body.board-body { overflow: hidden; display: flex; flex-direction: column; }
.board-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; background-size: cover; background-position: center; }
.board-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(9,16,40,.42); backdrop-filter: blur(6px); color: #fff; flex-wrap: wrap; min-height: 56px; }
.board-head .bname { font-size: 18px; font-weight: 700; padding: 4px 10px; border-radius: 4px; cursor: pointer; border: 0; background: none;
  color: #fff; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-head .bname:hover { background: #ffffff33; }
.board-head input.bname-in { font-size: 18px; font-weight: 700; padding: 4px 10px; border-radius: 4px; border: 0; outline: 2px solid var(--cobalt); }
.hbtn { background: transparent; color: #fff; border: 0; border-radius: 4px; padding: 6px 8px; cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; min-height: 32px; font-weight: 500; }
.hbtn:hover { background: #ffffff33; }
.hbtn.on { background: #ffffffe6; color: var(--text); }
.hbtn.star-on { color: #f5cd47; }
.hbtn.light { background: #ffffffe6; color: var(--text); }
.hbtn.light:hover { background: #fff; }
.board-head .grow { flex: 1; }
.board-head .faces { display: flex; padding-left: 4px; }
.board-head .faces .avatar { margin-left: -4px; box-shadow: 0 0 0 2px #ffffff80; }
.banner { background: #fff7d6; color: #533f04; padding: 8px 16px; text-align: center; font-weight: 500; }
.banner button { margin-left: 8px; }

.canvas { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 12px 6px 8px; display: flex; align-items: flex-start; gap: 0; }
.canvas::-webkit-scrollbar { height: 12px; }
.canvas::-webkit-scrollbar-thumb { background: #ffffff66; border-radius: 6px; }
.canvas::-webkit-scrollbar-track { background: #00000026; border-radius: 6px; margin: 0 8px; }
.lists { display: flex; align-items: flex-start; height: 100%; }
.list { width: 272px; flex: none; margin: 0 6px; background: var(--bg-list); border-radius: 12px; max-height: 100%; display: flex;
  flex-direction: column; box-shadow: var(--shadow); }
.list-head { display: flex; align-items: flex-start; gap: 4px; padding: 8px 8px 4px 12px; cursor: grab; }
.list-head .lname { flex: 1; font-weight: 600; padding: 6px 4px; border-radius: 4px; word-break: break-word; cursor: pointer; min-height: 32px; }
.list-head textarea { flex: 1; font-weight: 600; padding: 5px 8px; border: 0; border-radius: 4px; outline: 2px solid var(--cobalt);
  resize: none; overflow: hidden; min-height: 32px; }
.list-cards { padding: 2px 8px; overflow-y: auto; flex: 1 1 auto; min-height: 4px; display: flex; flex-direction: column; gap: 8px; }
.list-cards::-webkit-scrollbar { width: 8px; }
.list-cards::-webkit-scrollbar-thumb { background: #091e4224; border-radius: 4px; }
.list-foot { padding: 8px; display: flex; gap: 4px; }
.list-foot .add { flex: 1; justify-content: flex-start; color: var(--text-2); background: transparent; }
.list-foot .add:hover { background: var(--bg-btn-h); color: var(--text); }
.add-list { width: 272px; flex: none; margin: 0 6px; }
.add-list > .btn { width: 100%; background: #ffffff3d; color: #fff; justify-content: flex-start; border-radius: 12px; padding: 12px; min-height: 44px; }
.add-list > .btn:hover { background: #ffffff52; }
.composer { background: var(--bg-list); border-radius: 12px; padding: 8px; }
.composer textarea, .composer input { width: 100%; border: 0; border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow); resize: none;
  outline: none; min-height: 36px; overflow: hidden; background: #fff; }
.composer .row { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.list-cards .composer { padding: 0; background: none; }

.card { position: relative; background: #fff; border-radius: 8px; box-shadow: var(--shadow); cursor: pointer; overflow: hidden;
  color: var(--text); min-height: 36px; flex: none; outline: 2px solid transparent; }
.card:hover { outline-color: var(--cobalt); }
.card .body { padding: 8px 12px 6px; }
.card .title { word-break: break-word; overflow-wrap: anywhere; }
.card .edit { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #fff;
  display: none; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); }
.card:hover .edit { display: flex; }
.card .edit:hover { background: var(--bg-list); }
.card .cover-c { height: 36px; }
.card .cover-i { background-color: #ddd; background-size: cover; background-position: center; height: 160px; }
.card.full-cover { min-height: 56px; }
.card.full-cover .body { position: relative; }
.card.full-cover.has-img .body { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; font-weight: 600; font-size: 16px;
  background: linear-gradient(transparent, #00000099); padding-top: 32px; }
.card.full-cover.has-img { min-height: 160px; background-size: cover; background-position: center; }
.card.full-cover.no-img .body { font-weight: 600; font-size: 16px; padding: 16px 12px; }
.card.full-cover .badges, .card.full-cover .labels { display: none; }
.card.template::after { content: "Plantilla"; position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 700;
  background: var(--cobalt-l); color: var(--cobalt); padding: 0 6px; border-radius: 3px; }
.card.template .body { padding-top: 26px; }
.card.link-card .title a { font-weight: 500; }
.card.dragging { transform: rotate(4deg); opacity: .9; }
.card.ghost { opacity: .35; background: #091e4214; box-shadow: none; }
.card.ghost * { visibility: hidden; }
.list.ghost { opacity: .4; }
.card.filtered-out { display: none; }
.labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.lab { height: 8px; min-width: 40px; max-width: 40px; border-radius: 4px; cursor: pointer; }
.labels.expanded .lab { height: 16px; max-width: 100%; padding: 0 6px; font-size: 12px; line-height: 16px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.labels:not(.expanded) .lab span { display: none; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; color: var(--text-2); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; border-radius: 3px; }
.badge .svg { width: 14px; height: 14px; }
.badge.due { padding: 0 4px; }
.badge.due.soon { background: var(--warn); color: #533f04; }
.badge.due.over { background: var(--danger); color: #fff; }
.badge.due.done { background: var(--ok); color: #fff; }
.badge.check-done { background: var(--ok); color: #fff; padding: 0 4px; }
.badge.watch { }
.badges .faces { margin-left: auto; display: flex; gap: 2px; }

/* paleta de etiquetas */
.lc-green{background:#4bce97;color:#164b35}.lc-yellow{background:#f5cd47;color:#533f04}.lc-orange{background:#fea362;color:#702e00}
.lc-red{background:#f87168;color:#5d1f1a}.lc-purple{background:#9f8fef;color:#352c63}.lc-blue{background:#579dff;color:#09326c}
.lc-sky{background:#6cc3e0;color:#164555}.lc-lime{background:#94c748;color:#37471f}.lc-pink{background:#e774bb;color:#50253f}
.lc-black{background:#8590a2;color:#091e42}
.lc-green_dark{background:#1f845a;color:#fff}.lc-yellow_dark{background:#946f00;color:#fff}.lc-orange_dark{background:#c25100;color:#fff}
.lc-red_dark{background:#c9372c;color:#fff}.lc-purple_dark{background:#6e5dc6;color:#fff}.lc-blue_dark{background:#0c66e4;color:#fff}
.lc-sky_dark{background:#227d9b;color:#fff}.lc-lime_dark{background:#5b7f24;color:#fff}.lc-pink_dark{background:#ae4787;color:#fff}
.lc-black_dark{background:#626f86;color:#fff}
.lc-green_light{background:#baf3db;color:#164b35}.lc-yellow_light{background:#f8e6a0;color:#533f04}.lc-orange_light{background:#fedec8;color:#702e00}
.lc-red_light{background:#ffd5d2;color:#5d1f1a}.lc-purple_light{background:#dfd8fd;color:#352c63}.lc-blue_light{background:#cce0ff;color:#09326c}
.lc-sky_light{background:#c6edfb;color:#164555}.lc-lime_light{background:#d3f1a7;color:#37471f}.lc-pink_light{background:#fdd0ec;color:#50253f}
.lc-black_light{background:#dcdfe4;color:#091e42}
.lc-none{background:#fff;color:var(--text);box-shadow:inset 0 0 0 1px var(--line)}

/* ---------- ventana de la tarjeta
   Una sola rejilla: columna de iconos (24px) + 12px de hueco; todo el contenido arranca en 36px. */
.modal-back { position: fixed; inset: 0; background: rgba(9, 16, 40, .62); z-index: 60; overflow-y: auto; display: flex;
  justify-content: center; align-items: flex-start; padding: 48px 16px; }
.modal-back.anim { animation: fade .12s ease-out; }
.modal-back.anim .modal { animation: rise .14s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(6px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal { --gut: 36px; background: #f7f8f9; border-radius: 12px; width: 800px; max-width: 100%; position: relative;
  box-shadow: 0 24px 48px rgba(9, 16, 40, .28); }
.modal .mclose { position: absolute; top: 10px; right: 10px; z-index: 3; border-radius: 50%; color: var(--text-2); }
.modal .mcover { height: 128px; border-radius: 12px 12px 0 0; background-size: contain; background-repeat: no-repeat;
  background-position: center; position: relative; }
.modal .mcover .btn { position: absolute; right: 12px; bottom: 10px; background: rgba(255,255,255,.9); }
.mnotice { margin: 16px 56px 0 24px; padding: 8px 12px; border-radius: 6px; background: #eef1f6; color: var(--text-2); font-size: 13px;
  display: flex; gap: 8px; align-items: center; }
.mhead { display: grid; grid-template-columns: 24px 1fr; column-gap: 12px; padding: 22px 56px 4px 24px; }
.mhead .ic { margin-top: 4px; color: var(--text-3); }
.mhead .titlebox { min-width: 0; }
.mhead textarea.mtitle { width: 100%; font-size: 20px; font-weight: 600; line-height: 28px; letter-spacing: -.2px; border: 0;
  background: transparent; border-radius: 6px; padding: 0 8px; margin-left: -8px; resize: none; overflow: hidden; outline: none; color: var(--text); }
.mhead textarea.mtitle:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--cobalt); }
.mhead .inlist { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.mhead .inlist button { background: none; border: 0; padding: 0; color: var(--text-2); font-weight: 500; cursor: pointer;
  border-bottom: 1px solid #c4c9d2; }
.mhead .inlist button:hover { color: var(--cobalt); border-color: var(--cobalt); }
.mgrid { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 24px; padding: 8px 24px 28px; }
.mmain { min-width: 0; }
.mside { padding-top: 6px; }
.mside .sec { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; margin: 18px 0 6px; }
.mside .sec:first-child { margin-top: 0; }
.mside .btn { width: 100%; justify-content: flex-start; margin-bottom: 6px; font-size: 13px; min-height: 32px; background: #e9ebee;
  color: var(--text); font-weight: 500; gap: 8px; }
.mside .btn:hover { background: #dfe2e6; }
.mside .btn .svg { color: var(--text-2); }
.mside .btn-danger { background: var(--danger); color: #fff; }
.mside .btn-danger .svg { color: #fff; }
.mrow { display: flex; flex-wrap: wrap; gap: 16px 28px; margin: 12px 0 4px var(--gut); }
.mrow h4 { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.mrow .vals { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mrow .lab { height: 32px; min-width: 40px; max-width: 220px; border-radius: 4px; padding: 0 12px; line-height: 32px; font-weight: 500;
  font-size: 13px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .lab span { display: inline !important; }
.mrow .btn-icon { width: 32px; height: 32px; background: #e9ebee; }
.mrow .btn { background: #e9ebee; font-size: 13px; }
.msec { margin-top: 28px; }
.msec-h { display: grid; grid-template-columns: 24px 1fr auto; column-gap: 12px; align-items: center; margin-bottom: 10px; }
.msec-h .ic { color: var(--text-3); display: flex; }
.msec-h h3 { font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.msec-h .tools { display: flex; gap: 6px; }
.msec-h .btn { background: #e9ebee; font-size: 13px; min-height: 30px; padding: 4px 10px; }
.msec-b { margin-left: var(--gut); }
.desc-view { cursor: pointer; min-height: 20px; word-break: break-word; line-height: 1.55; }
.desc-empty { background: #e9ebee; border-radius: 6px; padding: 10px 12px; min-height: 60px; cursor: pointer; color: var(--text-3); }
.desc-empty:hover { background: #dfe2e6; }
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; font-size: 15px; }
.md pre { background: #eceef1; padding: 10px; border-radius: 6px; overflow-x: auto; }
.md code { background: #eceef1; padding: 1px 4px; border-radius: 4px; font-size: 13px; }
.md blockquote { border-left: 3px solid var(--line); margin: 0 0 10px; padding-left: 12px; color: var(--text-2); }
.md table { border-collapse: collapse; margin-bottom: 10px; }
.md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.mention { background: var(--cobalt-l); color: var(--cobalt); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.datebox { display: inline-flex; align-items: center; gap: 8px; background: #e9ebee; border-radius: 6px; padding: 4px 10px; min-height: 32px; font-size: 13px; }
.datebox .tag { font-size: 11px; font-weight: 600; border-radius: 3px; padding: 1px 6px; }
.datebox .tag.soon { background: var(--warn); color: #533f04; }
.datebox .tag.over { background: var(--danger); color: #fff; }
.datebox .tag.done { background: var(--ok); color: #fff; }

/* checklist: casillas en la columna de los iconos, texto alineado con el resto */
.checklist .progress { display: grid; grid-template-columns: 24px 1fr; column-gap: 12px; align-items: center; margin: 2px 0 10px; }
.progress .pc { font-size: 11px; color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress .bar { height: 6px; background: #e1e4e8; border-radius: 3px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--cobalt); border-radius: 3px; transition: width .25s ease; }
.progress .bar i.full { background: var(--ok); }
.citem { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; column-gap: 12px; align-items: start;
  padding: 7px 8px 7px 0; border-radius: 6px; position: relative; }
.citem:hover { background: #eceef1; }
.citem input[type=checkbox] { justify-self: center; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--cobalt); cursor: pointer; }
.citem .cname { word-break: break-word; cursor: pointer; line-height: 20px; }
.citem .cname p { margin: 0; }
.citem.done .cname { text-decoration: line-through; text-decoration-color: #b3b9c4; color: var(--text-3); }
.citem .cmeta { display: flex; gap: 4px; align-items: center; }
.citem .cmeta .chip { font-size: 12px; background: #e3e6ea; border-radius: 12px; padding: 0 8px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; min-height: 22px; color: var(--text-2); }
.citem .cmeta .chip.over { background: var(--danger); color: #fff; }
.citem .cmeta .chip.soon { background: var(--warn); color: #533f04; }
.citem .tools { display: flex; gap: 2px; opacity: 0; transition: opacity .1s; }
.citem .tools:empty, .citem .cmeta:empty { display: none; }
.citem:hover .tools, .citem:focus-within .tools { opacity: 1; }
.citem .tools .btn { min-height: 24px; height: 24px; width: 24px; padding: 0; justify-content: center; border-radius: 50%; }
.citem textarea { margin-top: -2px; }
.checklist .cl-add { margin-left: var(--gut) !important; margin-top: 8px !important; background: #e9ebee; font-size: 13px; }
.checklist .cl-form { margin-left: var(--gut) !important; }

.att { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; margin-bottom: 10px; align-items: start; }
.att .thumb { width: 96px; height: 68px; border-radius: 6px; background: #e3e6ea; background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase; }
.att .meta .nm { font-weight: 600; word-break: break-word; color: var(--text); }
.att .meta .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.att .meta .sub button, .att .meta .sub a { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: none; cursor: pointer;
  font-size: 12px; border-bottom: 1px solid #c4c9d2; }
.att .meta .sub button:hover, .att .meta .sub a:hover { color: var(--cobalt); border-color: var(--cobalt); }
.comment { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; margin-bottom: 14px; }
.comment > .avatar { width: 24px; height: 24px; font-size: 10px; margin-top: 2px; }
.comment .cb { min-width: 0; }
.comment .who { font-weight: 600; font-size: 13px; }
.comment .when { font-size: 12px; color: var(--text-3); margin-left: 6px; }
.comment .bubble { background: #fff; border-radius: 8px; padding: 8px 12px; box-shadow: 0 1px 1px rgba(9,30,66,.12), 0 0 1px rgba(9,30,66,.2);
  margin: 4px 0; word-break: break-word; line-height: 1.5; }
.comment .acts { font-size: 12px; }
.comment .acts button { background: none; border: 0; padding: 0; margin-right: 10px; color: var(--text-3); cursor: pointer; font-size: 12px; }
.comment .acts button:hover { color: var(--text); text-decoration: underline; }
.new-comment .fake { background: #fff; border-radius: 8px; padding: 8px 12px; color: var(--text-3); cursor: text;
  box-shadow: 0 1px 1px rgba(9,30,66,.12), 0 0 1px rgba(9,30,66,.2); }
.act { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; margin-bottom: 12px; font-size: 13px; color: var(--text-2); }
.act strong { color: var(--text); font-weight: 600; }
.act .when { display: block; font-size: 12px; color: var(--text-3); }
.drop-hint { position: fixed; inset: 0; background: rgba(27, 91, 224, .85); color: #fff; font-size: 22px; font-weight: 600; display: flex;
  align-items: center; justify-content: center; z-index: 200; pointer-events: none; }

/* ---------- paneles laterales del tablero */
.drawer { position: fixed; top: 48px; right: 0; bottom: 0; width: 340px; background: #fff; z-index: 50; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; }
.drawer .dh { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); }
.drawer .dh h3 { text-align: center; font-size: 16px; font-weight: 600; grid-column: 2; }
.drawer .dh .x { grid-column: 3; }
.drawer .db { padding: 12px; overflow-y: auto; flex: 1; }
.colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.colors button { height: 32px; border-radius: 4px; border: 0; cursor: pointer; position: relative; }
.colors button.sel::after { content: ""; position: absolute; inset: 0; border-radius: 4px; box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--cobalt); }
.bgcolors { grid-template-columns: repeat(2, 1fr); }
.bgcolors button { height: 64px; }

/* ---------- toasts */
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; border-radius: 6px; padding: 10px 14px; box-shadow: var(--shadow-pop); max-width: 360px; }
.toast.err { background: var(--danger); }

/* ---------- páginas sencillas (entrar, ajustes, personas) */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #0c1445 0%, #1B5BE0 100%); padding: 16px; }
.auth-box { background: #fff; border-radius: 12px; box-shadow: var(--shadow-pop); padding: 32px 40px; width: 400px; max-width: 100%; }
.auth-box .brand { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 22px; font-weight: 700;
  color: var(--navy); margin-bottom: 20px; }
.auth-box .brand img { height: 34px; width: auto; }
.auth-box h1 { font-size: 16px; text-align: center; color: var(--text-2); margin-bottom: 16px; font-weight: 600; }
.auth-box .btn { width: 100%; justify-content: center; margin-top: 16px; min-height: 40px; }
.err-box { background: #ffeceb; color: #ae2e24; border-radius: 4px; padding: 8px 12px; margin-bottom: 8px; }
.ok-box { background: #dcfff1; color: #216e4e; border-radius: 4px; padding: 8px 12px; margin-bottom: 8px; }
.page { width: 100%; padding: 32px 40px; }   /* todo el ancho */
.page h1 { font-size: 22px; margin-bottom: 20px; }
.page h2 { font-size: 16px; margin: 28px 0 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; color: var(--text-2); }
.tag-pill { font-size: 11px; font-weight: 700; border-radius: 3px; padding: 1px 6px; background: var(--bg-btn); color: var(--text-2); }
.tag-pill.blue { background: var(--cobalt-l); color: var(--cobalt); }
.tag-pill.red { background: #ffeceb; color: #ae2e24; }
.form-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 160px; }

/* ---------- móvil */
@media (max-width: 760px) {
  .topbar .search { width: auto; flex: 1; }
  .topbar .hide-m { display: none; }
  .home { flex-direction: column; padding: 16px; }
  .home-nav { width: auto; display: flex; gap: 4px; overflow-x: auto; }
  .modal { --gut: 0px; }
  .mbody { grid-template-columns: 1fr; }
  .mleft { padding: 16px 16px 20px; border-radius: 0; }
  .mright { border-left: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px; max-height: none; }
  .mquick { margin-left: 0; }
  .modal-back { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; }
  .modal .mtop, .modal .mcover { border-radius: 0; }
  .canvas { scroll-snap-type: x mandatory; }
  .list, .add-list { scroll-snap-align: center; width: 85vw; }
  .drawer { width: 100%; }
  .card .edit { display: flex; background: transparent; }
  .board-head .bname { max-width: 50vw; }
}
@media print {
  .topbar, .board-head .hbtn, .list-foot, .add-list { display: none !important; }
  body.board-body { overflow: visible; }
  .canvas { overflow: visible; flex-wrap: wrap; }
}
.sortable-fallback.card { transform: rotate(4deg); box-shadow: var(--shadow-pop); opacity: 1 !important; }
.sortable-fallback.list { transform: rotate(3deg); opacity: 1 !important; }
.sortable-fallback.citem { background: #fff; box-shadow: var(--shadow-pop); }
.desc-view.clamped { max-height: 420px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }

/* ---------- editor con formato */
.rte { border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: border-color .12s, box-shadow .12s; }
.rte:focus-within { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt); }
.rte-bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
  position: sticky; top: 0; background: #fff; border-radius: 8px 8px 0 0; z-index: 1; }
.rte-b { height: 30px; min-width: 30px; padding: 0 6px; border: 0; background: none; border-radius: 4px; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font: inherit; font-size: 13px; }
.rte-b .svg { width: 16px; height: 16px; }
.rte-b:hover { background: #f1f2f4; color: var(--text); }
.rte-b.on { background: var(--cobalt-l); color: var(--cobalt); }
.rte-b:disabled { opacity: .5; cursor: default; }
.rte-tt { font-weight: 600; font-size: 14px; letter-spacing: -.3px; }
.rte-style .svg { width: 12px; height: 12px; }
.rte-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.rte-grow { flex: 1; }
.rte-md { font-size: 12px; font-weight: 600; color: var(--text-3); }
.rte-md[aria-pressed="true"] { background: var(--cobalt-l); color: var(--cobalt); }
.rte-ce { padding: 12px 14px; min-height: 120px; max-height: 60vh; overflow-y: auto; outline: none; line-height: 1.55; cursor: text; }
.rte-ce:focus { outline: none; }
.rte-ce a { cursor: text; }
.rte.is-empty .rte-ce::before { content: attr(data-ph); position: absolute; color: var(--text-3); pointer-events: none; }
.rte { position: relative; }
.rte-ce hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.rte-raw { display: block; width: 100%; min-height: 120px; border: 0; padding: 12px 14px; resize: vertical; outline: none; border-radius: 0 0 8px 8px;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: #fafbfc; }
.rte-compact .rte-ce { min-height: 64px; padding: 10px 12px; }
.rte-compact .rte-bar { padding: 2px 4px; }
.rte-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.rte-hint { font-size: 12px; margin-left: auto; }
.rte-menu { position: fixed; z-index: 200; width: auto; min-width: 200px; }
.rte-linkpop { width: 300px; padding: 12px; }
.rte-err { color: #c9372c; font-size: 12px; margin-top: 6px; }
.rte-mi-h1 { font-size: 20px; font-weight: 700; }
.rte-mi-h2 { font-size: 17px; font-weight: 700; }
.rte-mi-h3 { font-size: 15px; font-weight: 700; }
.md h1 { font-size: 20px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; }
.rte-raw[hidden], .rte-ce[hidden] { display: none; }
.rte-mi-p { font-weight: 400; }
.md img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: 6px 0; }

/* ---------- ficha de la tarjeta (diseño actual de Trello: contenido a la izquierda, comentarios a la derecha) */
.modal { --gut: 38px; width: 1080px; background: #fff; }
.modal .mcover { border-radius: 12px 12px 0 0; }
.mtop { display: flex; align-items: center; gap: 2px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line);
  background: #fff; border-radius: 12px 12px 0 0; position: sticky; top: 0; z-index: 4; }
.mcover + .mtop { border-radius: 0; }
.mtop .grow { flex: 1; }
.mtop .btn-icon { width: 32px; height: 32px; border-radius: 6px; color: var(--text-2); }
.modal .mclose { position: static; border-radius: 6px; }
.mlist { display: inline-flex; align-items: center; gap: 4px; max-width: 60%; background: #f1f2f4; border: 0; border-radius: 6px;
  padding: 5px 8px 5px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.mlist span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.mlist:hover { background: #e4e6ea; }
.mlist .svg { width: 14px; height: 14px; flex: none; }
.mwatch { color: var(--text-3); display: inline-flex; padding: 0 6px; }
.mbody { display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.mleft { min-width: 0; padding: 20px 28px 32px 24px; }
.mright { min-width: 0; background: #f7f8f9; border-left: 1px solid var(--line); padding: 18px 20px 24px; border-radius: 0 0 12px 0; }
.mnotice { margin: 0 0 16px; }
.mhead { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 0; }
.mdone { width: 20px; height: 20px; margin-top: 5px; border-radius: 50%; border: 2px solid #8590a2; background: #fff; color: transparent;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; transition: all .12s; justify-self: center; }
.mdone .svg { width: 12px; height: 12px; stroke-width: 3; }
.mdone:hover:not(:disabled) { border-color: var(--ok); color: var(--ok); }
.mdone.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.mdone:disabled { cursor: default; }
.mhead textarea.mtitle { font-size: 22px; line-height: 30px; font-weight: 700; }
.mquick { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px var(--gut); }
.mquick .mq { background: #fff; border: 1px solid #dcdfe4; font-size: 13px; font-weight: 500; min-height: 32px; padding: 4px 10px; gap: 6px; }
.mquick .mq:hover { background: #f1f2f4; }
.mquick .mq .svg { color: var(--text-2); width: 16px; height: 16px; }
.mrow { margin-top: 16px; }
.mright-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--text-2); }
.mright-h h3 { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.mright-h .btn { background: #e9ebee; font-size: 13px; min-height: 30px; padding: 4px 10px; }
.mright .comment { grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; }
.mright .comment > .avatar { width: 28px; height: 28px; font-size: 11px; margin-top: 0; }
.add-it { align-items: flex-start; padding: 8px 10px; }
.add-it .grow strong { display: block; font-weight: 600; font-size: 14px; }
.add-it .grow .muted { display: block; font-size: 12px; margin-top: 1px; }
.add-ic { display: inline-flex; width: 32px; height: 32px; border-radius: 6px; background: #f1f2f4; align-items: center; justify-content: center; flex: none; color: var(--text-2); }
.pop-item.danger { color: var(--danger); }
.pop-item.danger .svg { color: var(--danger); }
.modal .msec-h { grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 10px; }
.modal .msec-h .ic { justify-content: center; }
.modal:focus { outline: none; }

/* ---------- listas con color y plegadas (Trello Standard) */
.list.lcol-green { background: #baf3db; } .list.lcol-yellow { background: #f8e6a0; } .list.lcol-orange { background: #fedec8; }
.list.lcol-red { background: #ffd5d2; } .list.lcol-purple { background: #dfd8fd; } .list.lcol-blue { background: #cce0ff; }
.list.lcol-sky { background: #c6edfb; } .list.lcol-lime { background: #d3f1a7; } .list.lcol-pink { background: #fdd0ec; }
.list.lcol-black { background: #dcdfe4; }
.list-head .l-collapse { opacity: 0; transition: opacity .12s; }
.list:hover .list-head .l-collapse, .list-head .l-collapse:focus-visible { opacity: 1; }
.list.collapsed { width: 44px; min-height: 120px; align-self: flex-start; align-items: center; padding: 10px 0 12px; gap: 10px; cursor: pointer;
  border: 0; }
.list.collapsed:hover { filter: brightness(.97); }
.list.collapsed .cl-ic { color: var(--text-2); display: flex; }
.list.collapsed .cl-name { writing-mode: vertical-rl; font-weight: 600; font-size: 14px; max-height: 60vh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list.collapsed .cl-n { font-size: 12px; color: var(--text-2); background: rgba(9,30,66,.08); border-radius: 10px; padding: 1px 7px; }
.list-colors { grid-template-columns: repeat(5, 1fr); }
.list-colors button { height: 28px; }

/* ---------- frente: círculo de completada */
.card .title { display: flex; align-items: flex-start; gap: 0; }
.card .title .tt { flex: 1; min-width: 0; }
.card .cdone { flex: none; width: 0; height: 16px; margin-top: 2px; opacity: 0; overflow: hidden; border-radius: 50%; border: 1.5px solid #8590a2;
  background: #fff; color: transparent; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: width .15s ease, opacity .15s ease, margin .15s ease; }
.card .cdone .svg { width: 10px; height: 10px; stroke-width: 3.2; }
.card:hover .cdone, .card .cdone.on, .card .cdone:focus-visible { width: 16px; opacity: 1; margin-right: 6px; }
.card .cdone:hover { border-color: var(--ok); color: var(--ok); }
.card .cdone.on { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- reacciones a comentarios */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reactions:empty { display: none; }
.react { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 12px; border: 1px solid #dcdfe4;
  background: #fff; font: inherit; font-size: 12px; cursor: pointer; color: var(--text-2); }
.react .e { font-size: 14px; line-height: 1; }
.react:hover:not(:disabled) { border-color: #b3b9c4; }
.react.mine { background: var(--cobalt-l); border-color: var(--cobalt); color: var(--cobalt); font-weight: 600; }
.react:disabled { cursor: default; }
.comment .acts { display: flex; align-items: center; gap: 0; margin-top: 4px; }
.comment .acts .react-add { display: inline-flex; align-items: center; padding: 2px; margin-right: 8px; border-radius: 4px; }
.comment .acts .react-add .svg { width: 16px; height: 16px; }
.comment .acts .react-add:hover { background: #e9ebee; text-decoration: none; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-top: 8px; max-height: 240px; overflow-y: auto; }
.emoji-grid .emo { height: 32px; border: 0; background: none; border-radius: 6px; font-size: 20px; cursor: pointer; line-height: 1; padding: 0; }
.emoji-grid .emo:hover, .emoji-grid .emo:focus-visible { background: #f1f2f4; }
.list.lcol-gray { background: #dcdfe4; }
.list-colors .lc-gray { background: #8590a2; }
.list-colors .lc-purple { background: #9f8fef; } .list-colors .lc-green { background: #4bce97; } .list-colors .lc-yellow { background: #f5cd47; }
.list-colors .lc-orange { background: #fea362; } .list-colors .lc-red { background: #f87168; } .list-colors .lc-blue { background: #579dff; }
.list-colors .lc-sky { background: #6cc3e0; } .list-colors .lc-lime { background: #94c748; } .list-colors .lc-pink { background: #e774bb; }

/* móvil de la ficha nueva (al final para que mande sobre lo de arriba) */
@media (max-width: 760px) {
  .modal { --gut: 0px; width: 100%; }
  .mbody { grid-template-columns: 1fr; }
  .mleft { padding: 16px 16px 20px; }
  .mright { border-left: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px; }
  .mquick { margin-left: 0; }
  .mhead { grid-template-columns: 24px minmax(0, 1fr); }
  .modal .mtop, .modal .mcover { border-radius: 0; }
  .modal .msec-h { grid-template-columns: 24px minmax(0, 1fr) auto; }
}
/* táctil: sin «hover», los controles se ven siempre */
@media (hover: none) {
  .list-head .l-collapse { opacity: 1; }
  .card .cdone { width: 16px; opacity: 1; margin-right: 6px; }
}

/* ---------- menú del tablero como en Trello: tarjeta flotante */
.drawer { top: 56px; right: 12px; bottom: auto; max-height: calc(100vh - 68px); width: 368px; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(9,16,40,.28), 0 0 0 1px rgba(9,30,66,.08); overflow: hidden; }
.drawer .dh { border-bottom: 0; padding: 12px 10px 4px; }
.drawer .dh h3 { font-size: 15px; color: var(--text-2); }
.drawer .db { padding: 4px 12px 12px; }
.drawer .db > hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; min-height: 44px; }
.mi:hover, .mi:focus-visible { background: #f1f2f4; }
.mi .mi-ic { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.mi .mi-ic .svg { width: 20px; height: 20px; }
.mi .mi-bg { border-radius: 6px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(9,30,66,.12); }
.mi .mi-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 500; }
.mi .mi-sub { font-size: 12px; font-weight: 400; color: var(--text-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi .mi-faces { display: inline-flex; }
.mi .mi-faces .avatar { box-shadow: 0 0 0 2px #fff; margin-left: -6px; }
.mi.danger, .mi.danger .mi-ic { color: var(--danger); }
@media (max-width: 760px) { .drawer { right: 0; left: 0; width: auto; top: 48px; border-radius: 0 0 12px 12px; } }

/* ---------- galería de fondos */
.bg-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.bg-photos button { position: relative; height: 84px; border: 0; border-radius: 8px; background-size: cover; background-position: center; cursor: pointer; overflow: hidden; }
.bg-photos button .by { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 4px; font-size: 11px; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); opacity: 0; transition: opacity .12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-photos button:hover .by { opacity: 1; }
.bg-photos button.sel::after { content: ""; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 0 0 0 3px var(--cobalt); }
.colors .light-sw { box-shadow: inset 0 0 0 1px #c7ccd4; }

/* ---------- tableros con fondo claro: texto oscuro */
.board-wrap.light .board-head { background: rgba(255,255,255,.7); color: var(--text); }
.board-wrap.light .board-head .bname, .board-wrap.light .board-head .hbtn, .board-wrap.light .board-head .btn-ghost { color: var(--text); }
.board-wrap.light .board-head .hbtn:hover { background: rgba(9,30,66,.08); }
.board-wrap.light .add-list > .btn { background: rgba(9,30,66,.08); color: var(--text); }
.board-wrap.light .add-list > .btn:hover { background: rgba(9,30,66,.14); }
.board-wrap.light .list { box-shadow: 0 1px 2px rgba(9,30,66,.14), 0 0 0 1px rgba(9,30,66,.06); }
.tile.light { color: var(--text); box-shadow: inset 0 0 0 1px #dcdfe4, 0 1px 2px rgba(9,30,66,.12); }
.tile.light::before { background: none; }
.tile.light:hover::before { background: rgba(9,30,66,.04); }
.tile.light .star { color: var(--text-2); }

/* ---------- vistas de todos los tableros */
.nav-sep { height: 1px; background: var(--line); margin: 8px 8px; }
.view { min-width: 0; }
.v-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.v-head h1 { font-size: 22px; font-weight: 700; flex: 1; min-width: 200px; letter-spacing: -.2px; }
.v-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.v-select { width: auto; min-width: 180px; min-height: 34px; }
.v-note { color: var(--text-3); font-size: 13px; margin: 0 0 18px; }
.v-sec { margin-bottom: 26px; }
.v-sec h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-2); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.v-n { font-size: 11px; font-weight: 600; background: #e9ebee; color: var(--text-2); border-radius: 10px; padding: 1px 7px; letter-spacing: 0; }
.v-board { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; }
.v-board-n { font-weight: 600; color: var(--text); }
.v-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border-radius: 8px; margin-bottom: 6px; color: var(--text);
  box-shadow: 0 1px 1px rgba(9,30,66,.12), 0 0 1px rgba(9,30,66,.2); }
.v-card:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--cobalt); }
.v-done { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #b3b9c4; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.v-done .svg { width: 11px; height: 11px; stroke-width: 3; }
.v-card.done .v-done { background: var(--ok); border-color: var(--ok); }
.v-card.done .v-title { color: var(--text-3); text-decoration: line-through; }
.v-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.v-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.v-where { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-labs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 40%; }
.v-lab { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; }
.v-due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); background: #f1f2f4; border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.v-due .svg { width: 12px; height: 12px; }
.v-due.over { background: var(--danger); color: #fff; } .v-due.soon { background: var(--warn); color: #533f04; } .v-due.done { background: var(--ok); color: #fff; }
.v-empty { text-align: center; color: var(--text-3); padding: 48px 0; }
/* calendario */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); gap: 1px; margin-top: 10px; }
.cal-w { background: #f7f8f9; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: 8px; letter-spacing: .4px; }
.cal-d { background: #fff; min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d.out { background: #fafbfc; }
.cal-d.out .cal-n { color: #b3b9c4; }
.cal-d.over { background: var(--cobalt-l); }
.cal-n { font-size: 12px; font-weight: 600; color: var(--text-2); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-d.today .cal-n { background: var(--cobalt); color: #fff; }
.cal-e { display: flex; align-items: center; gap: 4px; font-size: 12px; background: #e9f2ff; color: #0c1445; border-radius: 4px; padding: 2px 6px; cursor: grab;
  white-space: nowrap; overflow: hidden; }
.cal-e span { overflow: hidden; text-overflow: ellipsis; }
.cal-e:hover { text-decoration: none; filter: brightness(.96); }
.cal-e .svg { width: 12px; height: 12px; flex: none; }
.cal-e.item { background: #f1f2f4; color: var(--text-2); }
.cal-e.over { background: #ffeceb; color: #ae2e24; } .cal-e.soon { background: #fff7d6; color: #7f5f01; } .cal-e.done { background: #dcfff1; color: #216e4e; text-decoration: line-through; }
/* control de aperturas */
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ap { display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; color: var(--text);
  box-shadow: 0 1px 2px rgba(9,30,66,.14), 0 0 0 1px rgba(9,30,66,.06); transition: box-shadow .12s, transform .12s; }
.ap:hover { text-decoration: none; box-shadow: 0 8px 20px rgba(9,30,66,.16); transform: translateY(-1px); }
.ap-top { height: 64px; background-size: cover; background-position: center; position: relative; display: flex; align-items: flex-end; }
.ap-top::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,16,40,.1), rgba(9,16,40,.6)); }
.ap-top span { position: relative; color: #fff; font-weight: 700; padding: 0 14px 10px; font-size: 15px; }
.ap-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.ap-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); }
.ap-phase { display: flex; flex-direction: column; gap: 2px; }
.ap-phase strong { font-size: 14px; }
.ap-bar { height: 8px; background: #e9ebee; border-radius: 4px; overflow: hidden; }
.ap-bar i { display: block; height: 100%; background: var(--cobalt); border-radius: 4px; }
.ap-pct { font-size: 13px; font-weight: 600; }
.ap-pct .muted { font-weight: 400; font-size: 12px; }
.ap-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-s { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border-radius: 12px; background: #f1f2f4; color: var(--text-2); }
.ap-s .svg { width: 13px; height: 13px; }
.ap-s.bad { background: #ffeceb; color: #ae2e24; font-weight: 600; } .ap-s.warn { background: #fff7d6; color: #7f5f01; font-weight: 600; }
.ap-list { margin: 0; padding-left: 18px; font-size: 12px; color: #ae2e24; }
.ap-next { font-size: 12px; color: var(--text-2); }
.ap-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: 12px; }
.ap-faces { display: inline-flex; }
.ap-faces .avatar { box-shadow: 0 0 0 2px #fff; margin-left: -6px; }
.ap-faces .avatar:first-child { margin-left: 0; }
@media (max-width: 760px) { .cal-d { min-height: 72px; padding: 3px; } .cal-e span { display: none; } .v-labs { display: none; } }
.v-head .v-select, .v-tools .v-select { width: auto; flex: none; max-width: 240px; }
.tpl-admin { margin-top: 12px; font-size: 13px; }
.tpl-admin summary { cursor: pointer; color: var(--text-2); }
.tpl-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 0; }
/* automatizaciones */
.rule { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px; border-radius: 8px; background: #f7f8f9; margin-bottom: 6px; }
.rule.off { opacity: .55; }
.rule-ic { width: 28px; height: 28px; border-radius: 6px; background: var(--cobalt-l); color: var(--cobalt); display: inline-flex; align-items: center; justify-content: center; }
.rule-ic .svg { width: 16px; height: 16px; }
.rule-t { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.rule-t span { color: var(--text-2); font-size: 12px; }
.switch { position: relative; width: 34px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #b3b9c4; border-radius: 10px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.rule-form { display: flex; flex-direction: column; }
a.hbtn:hover { text-decoration: none; }
.magic-btn { display: flex; width: 100%; justify-content: center; margin-top: 10px; background: #f1f2f4; }
.magic-btn:hover { text-decoration: none; background: #e4e6ea; }
.tag-pill.green { background: #dcfff1; color: #216e4e; }
@media (max-width: 760px) { .home, .page { padding: 16px; } }
.page .form-row { flex-wrap: wrap; }
.code-input { font-size: 22px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- auditoría de diseño (2-dic) */
/* 1. Fotos claras: cabecera y «Añadir otra lista» legibles (contraste ≥ 4,5:1 en el peor caso) */
.board-head { background: rgba(9,16,40,.6); backdrop-filter: blur(8px); }
.add-list > .btn { background: rgba(9,16,40,.45); backdrop-filter: blur(6px); }
.add-list > .btn:hover { background: rgba(9,16,40,.6); }
.canvas::-webkit-scrollbar-thumb { background: rgba(9,16,40,.45); }
.board-wrap.light .board-head { background: rgba(255,255,255,.78); }
.board-wrap.light .add-list > .btn { background: rgba(9,30,66,.08); backdrop-filter: none; }
/* 2. Tablas que no se salen en el móvil */
.table-wrap { overflow-x: auto; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 40px 1fr; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 0; grid-column: 2; white-space: normal !important; }
  .table td:first-child { grid-column: 1; grid-row: span 5; }
  .table td form { display: flex; flex-wrap: wrap; gap: 6px; }
}
/* 3. Menú de inicio en el móvil: sin textos partidos */
@media (max-width: 760px) {
  .home-nav { padding-bottom: 4px; scrollbar-width: none; }
  .home-nav a { white-space: nowrap; flex: none; min-height: 40px; }
  .home-nav .nav-sep { display: none; }
}
/* 4. Calendario en el móvil: marcas visibles */
@media (max-width: 760px) {
  .cal-e { height: 8px; padding: 0; background: var(--cobalt); border-radius: 4px; }
  .cal-e.over { background: var(--danger); } .cal-e.done { background: var(--ok); } .cal-e.soon { background: var(--warn); }
  .cal-d { cursor: pointer; }
}
/* 5. Tamaños táctiles en el móvil */
@media (max-width: 760px) {
  .topbar { height: 52px; }
  .topbar .tb-btn, .topbar .avatar, .hbtn, .btn-icon, .mtop .btn-icon { min-height: 40px; min-width: 40px; }
  .card .cdone { position: relative; overflow: visible; }
  .card .cdone::after { content: ""; position: absolute; inset: -12px; }
  .citem input[type=checkbox] { width: 20px; height: 20px; }
  .hide-m { display: none !important; }
}
/* 6. El lápiz no tapa el título */
@media (hover: none) { .card .title { padding-right: 28px; } }
.card:hover .title, .card:focus-within .title { padding-right: 28px; }
/* 7. Estrella de favoritos accesible */
.tile:focus-within .star, .tile .star:focus-visible { opacity: 1; }
@media (hover: none) { .tile .star { opacity: 1; } }
/* 8. Selector de color de Ajustes */
.check input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check input[type=radio] + .avatar { width: 36px; height: 36px; cursor: pointer; }
.check input:checked + .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cobalt); }
.check input:focus-visible + .avatar { outline: 2px solid var(--cobalt); outline-offset: 4px; }
/* 9. Caras apiladas legibles */
.board-head .faces .avatar, .ap-faces .avatar, .mi-faces .avatar { margin-left: -2px; }
/* 11. Contrastes */
.topbar .search input::placeholder { color: #fff; }
.cal-d.out .cal-n { color: #8590a2; }
.v-done { border-color: #8590a2; }
.ap-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
/* móvil: selectores de las vistas a todo el ancho */
@media (max-width: 760px) { .v-head .v-select, .v-tools .v-select { max-width: none; flex: 1 1 100%; } .v-tools { width: 100%; } }
.pop a.pop-item.sel { background: var(--cobalt-l); }

/* Alta, facturación y aviso de prueba (2-dic-2026) */
.org-banner { flex: none; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 7px 12px;
  font-size: 13px; background: #e9f0fd; color: #0c1445; text-align: center; }
.org-banner.warn { background: #fff4e5; color: #7a3e00; }
.org-banner a { font-weight: 700; }
.auth .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth label.check.terms { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 4px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.auth label.check.terms input { margin-top: 2px; }
.billing .bill-card { border: 1px solid #dfe3ea; border-radius: 12px; padding: 16px 18px; margin: 16px 0; max-width: 560px; }
.billing .bill-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.billing .bill-row.total { border-top: 1px solid #dfe3ea; margin-top: 6px; padding-top: 10px; font-size: 15px; }
.billing form { margin: 10px 0 4px; }
.legal-top { padding: 18px 24px; border-bottom: 1px solid #eef0f4; }
.page.legal { max-width: 780px; line-height: 1.6; }
.page.legal h2 { margin-top: 26px; }
.page.legal li { margin-bottom: 6px; }
.auth-lang{margin-top:18px;text-align:center;font-size:13px}.auth-lang a{color:var(--muted,#64748b)}
