/* ==========================================================================
   SistePlanner — hoja de estilos con la identidad de Sisteplan
   Colores: petróleo #0F6F7C · tinta #1C2E3A · sol #E39A2D · hueso #F7F5F1 · noche #17222A
   Tipografía: Montserrat (800 en títulos, 400–600 en textos)
   ========================================================================== */

:root {
  --bg: #f7f5f1;            /* hueso */
  --surface: #ffffff;
  --surface-2: #edece6;     /* fondo de tarjeta de la web */
  --text: #1c2e3a;          /* tinta */
  --body: #33434d;
  --text-soft: #4a5961;
  --muted: #56636b;
  --border: #dddad2;
  --accent: #0f6f7c;        /* petróleo */
  --accent-hover: #0b5560;
  --accent-soft: #dcecee;
  --sun: #e39a2d;           /* sol */
  --night: #17222a;         /* noche */
  --danger: #b83a2e;
  --danger-hover: #9a2f25;
  --warn: #9a5a14;
  --ok: #2f7a55;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 1px rgba(28, 46, 58, .25), 0 0 1px rgba(28, 46, 58, .31);
  --shadow-pop: 0 8px 24px rgba(28, 46, 58, .18), 0 0 1px rgba(28, 46, 58, .31);
  --list-w: 272px;
  --topbar-h: 60px;
  --board: #0f6f7c;
  font-family: "Montserrat Variable", Montserrat, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); -webkit-font-smoothing: antialiased; }
#app { min-height: 100%; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--text); }
.c { color: var(--accent); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
button, input, textarea, select { font: inherit; color: inherit; }
svg.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.icon.fill { fill: currentColor; }

/* ---------- Botones y campos ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border: 0; border-radius: 999px;
  background: rgba(28, 46, 58, .07); color: var(--text); font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .12s;
}
.btn:hover { background: rgba(28, 46, 58, .12); }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(28, 46, 58, .08); }
.btn-block { width: 100%; justify-content: flex-start; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; cursor: pointer; flex: none;
}
.icon-btn:hover { background: rgba(28, 46, 58, .1); }
.icon-btn.sm { width: 26px; height: 26px; }

.input, .textarea, .select {
  width: 100%; padding: 8px 12px; border: 1px solid #c9c6bd; border-radius: 8px;
  background: #fff; outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--text); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.form-error { color: var(--danger); font-size: 13px; margin: 0 0 10px; min-height: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Barra superior ---------- */

.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 8px 28px;
  padding: 0 clamp(12px, 3vw, 28px); background: rgba(239, 240, 237, .94); border-bottom: 1px solid #e2e0d9;
  position: relative; z-index: 5; backdrop-filter: blur(10px); color: var(--text);
}
.brand { display: inline-flex; align-items: center; color: inherit; text-decoration: none; border-radius: 8px; padding: 4px 6px; margin-left: -6px; }
.brand:hover { background: rgba(28, 46, 58, .05); }
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.bw { display: flex; flex-direction: column; line-height: 1.05; }
.bw b { font-weight: 800; font-size: 18px; letter-spacing: .05em; color: var(--text); }
.bw i { font-style: normal; color: var(--accent); }
.bw small { font-weight: 600; font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.topnav { display: flex; gap: 24px; }
.topnav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--body); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--accent); }
.topnav a.on { color: var(--text); border-bottom-color: var(--sun); }

.avatar {
  --size: 28px;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-size: calc(var(--size) * .38); font-weight: 700; color: #fff; letter-spacing: .02em;
  user-select: none; border: 0; padding: 0; cursor: default;
}
button.avatar { cursor: pointer; }
.avatar.sm { --size: 24px; }
.avatar.lg { --size: 40px; }
.avatar-stack { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.avatar-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.avatar-stack .avatar:last-child { margin-left: 0; }

/* ---------- Pantalla de acceso ---------- */

.auth-page {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(15, 111, 124, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 111, 124, .07) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
}
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 10px; box-shadow: 0 30px 60px -30px rgba(23, 34, 42, .35), 0 0 0 1px #e2e0d9; padding: 36px 32px 28px; }
.auth-card .brand { justify-content: center; display: flex; margin: 0 0 26px; padding: 0; }
.auth-card .brand-mark { width: 46px; height: 46px; }
.auth-card .bw b { font-size: 24px; }
.auth-card .bw small { font-size: 10.5px; margin-top: 6px; }
.auth-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 6px; }
.auth-sub { margin: 0 0 22px; color: var(--muted); }
.auth-card .btn-primary { width: 100%; height: 48px; margin-top: 6px; font-size: 15px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-switch button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; }
.notice { background: #e3f1f2; border: 1px solid #a9d3d8; color: #0b5560; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }

/* ---------- Inicio: lista de tableros ---------- */

.page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }
.page-title { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.015em; margin-bottom: 6px; }
.section { margin-top: 28px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.board-tile {
  position: relative; height: 104px; border-radius: var(--radius-lg); padding: 12px 14px;
  color: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--board); overflow: hidden; box-shadow: var(--shadow-card);
  transition: transform .12s, box-shadow .12s;
}
.board-tile::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(135deg, rgba(255,255,255,.06), rgba(0,0,0,.16));
  background-size: 18px 18px, 18px 18px, auto; }
.board-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.board-tile > * { position: relative; }
.board-tile-title { font-weight: 800; font-size: 16px; line-height: 1.25; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-tile-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; opacity: .92; }
.board-tile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.board-tile-meta .icon { width: 13px; height: 13px; }
.board-tile .star { position: absolute; top: 8px; right: 8px; color: #fff; opacity: 0; }
.board-tile:hover .star, .board-tile .star.on { opacity: 1; }
.board-tile .star.on { color: var(--sun); }
.board-tile.new { background: rgba(28, 46, 58, .06); color: var(--text-soft); align-items: center; justify-content: center; font-weight: 600; border: 0; cursor: pointer; box-shadow: none; }
.board-tile.new::before { display: none; }
.board-tile.new:hover { background: rgba(28, 46, 58, .11); transform: none; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }

.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatch { height: 34px; border-radius: 6px; border: 0; cursor: pointer; position: relative; }
.swatch.on::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.swatches.labels { grid-template-columns: repeat(6, 1fr); }
.swatches.labels .swatch { height: 28px; }

/* ---------- Vista de tablero ---------- */

.board-page { flex: 1; display: flex; flex-direction: column; min-height: 0; height: 100vh; background: var(--board); position: relative; }
.board-page::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(160deg, rgba(255,255,255,.06) 0%, rgba(0,0,0,.2) 100%);
  background-size: 40px 40px, 40px 40px, auto; }
.board-page > * { position: relative; }
.board-header { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: #fff; background: rgba(0, 0, 0, .16); min-width: 0; }
.board-header > * { flex: none; }
.board-header > .spacer { flex: 1; }
.board-header .icon-btn, .board-header .btn-ghost { color: #fff; }
.board-header .icon-btn:hover, .board-header .btn-ghost:hover { background: rgba(255, 255, 255, .2); }
.board-header .btn-ghost.active { background: rgba(255, 255, 255, .9); color: var(--text); }
.board-header > .board-title-btn, .board-header > .board-title-input { flex: 0 1 auto; min-width: 0; }
.board-title-btn { font-size: 19px; font-weight: 800; color: #fff; background: transparent; border: 0; padding: 4px 10px; border-radius: 6px; cursor: pointer; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-title-btn:hover { background: rgba(255, 255, 255, .2); }
.board-title-input { font-size: 19px; font-weight: 800; padding: 3px 9px; width: min(420px, 60vw); }
.board-header .star.on { color: var(--sun); }
.board-header .avatar-stack .avatar { box-shadow: 0 0 0 2px rgba(0,0,0,.18); }
.filter-count { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 700; }

.lists {
  flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 12px 16px; overflow-x: auto; overflow-y: hidden;
}
.lists::-webkit-scrollbar { height: 12px; }
.lists::-webkit-scrollbar-thumb { background: rgba(255,255,255,.4); border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
.lists::-webkit-scrollbar-track { background: rgba(0,0,0,.12); border-radius: 6px; margin: 0 12px; }

.list {
  width: var(--list-w); flex: none; max-height: 100%; display: flex; flex-direction: column;
  background: var(--surface-2); border-radius: var(--radius-lg); box-shadow: 0 1px 1px rgba(28,46,58,.2);
}
.list-header { display: flex; align-items: flex-start; gap: 4px; padding: 8px 8px 4px 8px; cursor: grab; }
.list-title { flex: 1; font-weight: 700; color: var(--text); padding: 6px 8px; border-radius: 6px; cursor: pointer; word-break: break-word; min-width: 0; }
.list-title-input { flex: 1; font-weight: 600; padding: 5px 7px; }
.list-count { font-size: 12px; color: var(--muted); padding: 7px 2px 0; }
.list-cards { flex: 1 1 auto; min-height: 6px; overflow-y: auto; padding: 2px 8px; display: flex; flex-direction: column; gap: 8px; }
.list-cards::-webkit-scrollbar { width: 8px; }
.list-cards::-webkit-scrollbar-thumb { background: rgba(28,46,58,.2); border-radius: 4px; }
.list-footer { padding: 8px; }
.add-card-btn { width: 100%; justify-content: flex-start; color: var(--text-soft); background: transparent; }
.add-card-btn:hover { background: rgba(28, 46, 58, .08); color: var(--text); }
.list.ghost { opacity: .4; }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 8px 10px; cursor: pointer; position: relative; flex: none;
  outline: 2px solid transparent; outline-offset: -2px;
}
.card:hover { outline-color: var(--accent); }
.card:focus-visible { outline-color: var(--accent); }
.card.is-complete .card-title { color: var(--muted); }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.label-chip { display: inline-flex; align-items: center; min-width: 40px; height: 8px; border-radius: 4px; }
.label-chip.named { height: 18px; padding: 0 8px; font-size: 11px; font-weight: 700; line-height: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { word-break: break-word; white-space: pre-wrap; color: var(--text); font-weight: 500; }
.card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; color: var(--text-soft); font-size: 12px; }
.card-badges:empty { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.badge .icon { width: 14px; height: 14px; }
.badge.due { padding: 1px 4px; margin-left: -4px; }
.badge.due.soon { background: var(--sun); color: var(--text); }
.badge.due.overdue { background: var(--danger); color: #fff; }
.badge.due.done, .badge.check.done { background: var(--ok); color: #fff; padding: 1px 4px; margin-left: -4px; }
.card-badges .avatar-stack { margin-left: auto; }
.card.filtered-out { display: none; }
.card-ghost { opacity: .35; }
.card-ghost * { visibility: hidden; }
.card-ghost { background: rgba(28,46,58,.15); box-shadow: none; }
.card-drag { box-shadow: var(--shadow-pop) !important; }

.composer { display: flex; flex-direction: column; gap: 8px; }
.composer .textarea { min-height: 56px; resize: none; box-shadow: var(--shadow-card); border: 0; }
.composer .textarea:focus { box-shadow: 0 0 0 2px var(--accent); }

.add-list { width: var(--list-w); flex: none; }
.add-list-btn { width: 100%; height: 44px; justify-content: flex-start; color: #fff; background: rgba(255, 255, 255, .2); border-radius: var(--radius-lg); padding: 0 14px; font-weight: 700; }
.add-list-btn:hover { background: rgba(255, 255, 255, .34); }
.add-list .composer { background: var(--surface-2); border-radius: var(--radius-lg); padding: 8px; }
.add-list .composer .input { box-shadow: none; border: 1px solid var(--accent); }

/* ---------- Panel lateral del tablero ---------- */

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 100vw; z-index: 40;
  background: #fff; box-shadow: -8px 0 24px rgba(28,46,58,.18); display: flex; flex-direction: column;
  animation: slide-in .16s ease-out;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-header { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); }
.drawer-header h3 { flex: 1; font-size: 15px; font-weight: 800; text-align: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 14px 24px; }
.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-list .btn { justify-content: flex-start; background: transparent; font-weight: 600; height: 38px; border-radius: 8px; }
.menu-list .btn:hover { background: rgba(28,46,58,.08); }
.menu-list .btn.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 8px 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.member-row .who { flex: 1; min-width: 0; }
.member-row .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row .who span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag { font-size: 11px; font-weight: 600; color: var(--text-soft); background: var(--surface-2); border-radius: 4px; padding: 2px 6px; }
.activity-item { display: flex; gap: 10px; padding: 8px 0; font-size: 13px; }
.activity-item p { margin: 0; }
.activity-item time { display: block; color: var(--muted); font-size: 12px; }
.activity-item a { cursor: pointer; }
.archived-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); margin-bottom: 8px; }
.archived-item .t { flex: 1; min-width: 0; }
.archived-item .t b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Popovers ---------- */

.popover {
  position: fixed; z-index: 60; width: 304px; max-width: calc(100vw - 16px);
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; max-height: calc(100vh - 16px);
}
.popover-header { display: flex; align-items: center; padding: 8px 8px 4px 12px; }
.popover-header h4 { flex: 1; text-align: center; font-size: 14px; font-weight: 700; color: var(--text); padding-left: 26px; }
.popover-body { padding: 8px 12px 12px; overflow-y: auto; }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; width: 100%; border: 0; background: transparent; text-align: left; }
.pick-row:hover { background: rgba(28,46,58,.06); }
.pick-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .tick { width: 16px; height: 16px; color: var(--accent); }
.label-pick { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.label-pick .bar { flex: 1; height: 32px; border-radius: 4px; border: 0; cursor: pointer; text-align: left; padding: 0 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.label-pick .bar:hover { filter: brightness(.94); }
.label-pick input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.label-preview { height: 32px; border-radius: 4px; display: flex; align-items: center; padding: 0 12px; font-weight: 600; margin-bottom: 12px; }

/* ---------- Modal (tarjeta, diálogos) ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(9, 15, 30, .6);
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 48px 16px;
}
.modal { position: relative; width: 100%; max-width: 800px; background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.modal.dialog { max-width: 420px; background: #fff; padding: 20px 20px 16px; margin-top: 10vh; }
.modal.dialog h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.modal.dialog p { margin: 0 0 16px; color: var(--text-soft); }
.modal.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 2; }

.card-modal { padding: 20px 20px 24px; }
.card-modal-head { display: flex; gap: 12px; padding-right: 36px; }
.card-modal-head .icon { margin-top: 8px; width: 20px; height: 20px; color: var(--accent); }
.card-modal-title { flex: 1; font-size: 21px; font-weight: 800; color: var(--text); border: 0; background: transparent; resize: none; padding: 4px 8px; margin-left: -8px; border-radius: 6px; overflow: hidden; line-height: 1.3; }
.card-modal-title:focus { background: #fff; box-shadow: 0 0 0 2px var(--accent); outline: none; }
.card-modal-sub { margin: 2px 0 0 32px; color: var(--text-soft); font-size: 13px; }
.card-modal-sub select { border: 0; background: transparent; font-weight: 600; color: var(--text); text-decoration: underline; cursor: pointer; padding: 0; }
.archived-banner { background: #fbecd6; color: #6b4310; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-modal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 204px; gap: 24px; margin-top: 18px; }
.card-modal-main { min-width: 0; }
.cm-meta { display: flex; flex-wrap: wrap; gap: 16px 24px; margin: 0 0 24px 32px; }
.cm-meta h5 { margin: 0 0 6px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cm-meta .row { gap: 4px; }
.cm-meta .label-chip.named { height: 32px; line-height: 32px; border-radius: 4px; padding: 0 12px; font-size: 14px; min-width: 48px; cursor: pointer; border: 0; }
.cm-meta .label-chip.empty { height: 32px; width: 48px; border-radius: 4px; cursor: pointer; border: 0; }
.due-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 6px; background: rgba(28,46,58,.06); }
.due-pill .tag { font-size: 11px; font-weight: 700; border-radius: 3px; padding: 0 4px; }
.due-pill .tag.overdue { background: var(--danger); color: #fff; }
.due-pill .tag.soon { background: var(--sun); color: var(--text); }
.due-pill .tag.done { background: var(--ok); color: #fff; }
.add-round { width: 32px; height: 32px; border-radius: 50%; background: rgba(28,46,58,.06); }

.cm-section { margin-bottom: 24px; }
.cm-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cm-section-head .icon { width: 20px; height: 20px; color: var(--accent); }
.cm-section-head h4 { flex: 1; font-size: 16px; font-weight: 700; }
.cm-section-body { margin-left: 32px; }
.desc-view { white-space: pre-wrap; word-break: break-word; cursor: pointer; padding: 2px 0; }
.desc-empty { background: rgba(28,46,58,.06); border-radius: 6px; padding: 10px 12px 26px; cursor: pointer; color: var(--text-soft); }
.desc-empty:hover { background: rgba(28,46,58,.1); }
.desc-edit .textarea { min-height: 140px; }

.progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.progress span { font-size: 11px; color: var(--text-soft); width: 32px; text-align: right; }
.progress-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(28,46,58,.1); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .2s; }
.progress-bar.full > div { background: var(--ok); }
.check-item { display: flex; align-items: flex-start; gap: 10px; padding: 4px 6px; margin-left: -6px; border-radius: 6px; }
.check-item:hover { background: rgba(28,46,58,.05); }
.check-item input[type="checkbox"] { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.check-item .txt { flex: 1; word-break: break-word; cursor: pointer; }
.check-item.done .txt { text-decoration: line-through; color: var(--muted); }
.check-item .icon-btn { opacity: 0; }
.check-item:hover .icon-btn, .check-item .icon-btn:focus-visible { opacity: 1; }
.check-add { margin-top: 8px; }

.comment-form { display: flex; gap: 10px; margin-bottom: 16px; }
.comment-form .grow { flex: 1; }
.comment-form .textarea { min-height: 40px; }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .body { flex: 1; min-width: 0; }
.comment .meta { font-size: 13px; margin-bottom: 4px; }
.comment .meta b { font-weight: 600; }
.comment .meta time { color: var(--muted); font-size: 12px; margin-left: 6px; }
.comment .bubble { background: #fff; border-radius: 6px; padding: 8px 12px; box-shadow: var(--shadow-card); white-space: pre-wrap; word-break: break-word; }
.comment .links { font-size: 12px; margin-top: 4px; display: flex; gap: 10px; }
.comment .links button { background: none; border: 0; padding: 0; color: var(--text-soft); text-decoration: underline; cursor: pointer; font-size: 12px; }
.log-entry { display: flex; gap: 10px; margin-bottom: 12px; font-size: 13px; align-items: flex-start; }
.log-entry p { margin: 4px 0 0; }
.log-entry time { display: block; color: var(--muted); font-size: 12px; }

.cm-side h5 { margin: 0 0 6px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cm-side .btn { width: 100%; justify-content: flex-start; margin-bottom: 8px; border-radius: 8px; }
.cm-side .btn.danger { color: var(--danger); }
.cm-side .group + .group { margin-top: 16px; }

/* ---------- Administración ---------- */

.table-wrap { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: #faf9f6; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.actions { text-align: right; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-hover); }

/* ---------- Avisos ---------- */

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--night); color: #fff; font-weight: 500; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-pop); font-size: 13px; animation: toast-in .18s ease-out; max-width: 90vw; }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.loading { flex: 1; display: grid; place-items: center; color: var(--muted); }

/* ---------- Pantallas pequeñas ---------- */

@media (max-width: 720px) {
  .modal-backdrop { padding: 0; }
  .modal:not(.dialog) { border-radius: 0; min-height: 100%; }
  .card-modal-grid { grid-template-columns: 1fr; }
  .cm-meta, .cm-section-body, .card-modal-sub { margin-left: 0; }
  .cm-side { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .cm-side .group + .group { margin-top: 0; }
  .cm-side h5 { grid-column: 1 / -1; }
  .board-title-btn { max-width: none; font-size: 16px; }
  .board-header { padding: 6px 8px; gap: 2px; }
  .board-header .avatar-stack .avatar:nth-child(n+4) { display: none; }
  .page { padding: 20px 14px 48px; }
  .drawer { width: 100vw; }
  .hide-sm { display: none !important; }
  .bw small { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .bw b { font-size: 16px; }
}

/* ---------- Ajustes adicionales ---------- */
.popover h5 { margin: 14px 0 6px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.popover h5:first-child { margin-top: 0; }
.popover .menu-list .btn { justify-content: flex-start; background: transparent; height: 36px; font-weight: 600; border-radius: 8px; }
.popover .menu-list .btn:hover { background: rgba(28,46,58,.08); }
.popover .menu-list .btn.danger { color: var(--danger); }
.popover .btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
button.due-pill { border: 0; cursor: pointer; color: inherit; font: inherit; }
button.due-pill:hover { background: rgba(28,46,58,.12); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--ok); color: #fff; font-weight: 700; }
.sortable-fallback { opacity: 1 !important; box-shadow: var(--shadow-pop) !important; }
.sortable-fallback.list { box-shadow: var(--shadow-pop) !important; }
.card-link { font-weight: 600; color: var(--text); text-decoration: underline; cursor: pointer; }
.color-custom { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.color-custom input[type="color"] { width: 44px; height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }
