/* Latent Dragons — hoja de estilos base. Tema oscuro por defecto (herramienta creativa), tema claro opcional. */

:root {
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #0e1116;
  --bg-2: #141922;
  --bg-3: #1a2029;
  --bg-4: #222a35;
  --line: #262e3a;
  --line-2: #33404f;
  --fg: #e8e4dc;
  --fg-2: #a9b0bb;
  --fg-3: #6f7886;
  --accent: #d19a6a;        /* cobre del logotipo */
  --accent-2: #b97d4f;
  --accent-fg: #1a120b;
  --teal: #3fa595;          /* pátina */
  --blue: #6b8fd6;
  --violet: #9b7bdc;
  --yellow: #d6bb5a;
  --red: #e06c6c;
  --green: #5fc48f;
  --orange: #e5945a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 248px;
  --topbar: 56px;
  --tabbar: 64px;
  --content-max: 1100px;
}

[data-theme="light"] {
  --bg: #f4f2ee;
  --bg-2: #ffffff;
  --bg-3: #f0ede7;
  --bg-4: #e6e1d9;
  --line: #e3ded5;
  --line-2: #cfc8bc;
  --fg: #1f2329;
  --fg-2: #4d5560;
  --fg-3: #8a919c;
  --accent: #b5713f;
  --accent-2: #9a5f33;
  --accent-fg: #ffffff;
  --shadow: 0 10px 30px rgba(40, 30, 10, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
img, video { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
::selection { background: rgba(209, 154, 106, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- disposición ---------- */
.app { display: flex; min-height: 100dvh; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { color: var(--fg-3); font-size: 13px; font-weight: 400; margin-left: 8px; }
.content { flex: 1; padding: 16px; max-width: var(--content-max); width: 100%; margin: 0 auto; }
.content.wide { max-width: none; }
.content.flush { padding: 0; max-width: none; display: flex; flex-direction: column; flex: 1; }
.tabbar { display: none; }

.brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { font-size: 15px; letter-spacing: 0.02em; }
.brand small { display: block; color: var(--fg-3); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }

.nav { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-title { padding: 12px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); display: flex; align-items: center; justify-content: space-between; }
.nav-title button { opacity: 0.7; }
.nav-title button:hover { opacity: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; color: var(--fg-2);
  cursor: pointer; text-decoration: none; font-weight: 500; font-size: 14px; border: 0; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg-3); color: var(--fg); text-decoration: none; }
.nav-item.active { background: var(--bg-4); color: var(--fg); }
.nav-item .ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: 0.85; }
.nav-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.nav-item .count { font-size: 11px; font-weight: 600; background: var(--accent); color: var(--accent-fg); border-radius: 10px; padding: 1px 7px; }
.nav-item .swatch { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.sidebar-footer { margin-top: auto; padding: 10px 8px; border-top: 1px solid var(--line); }

/* ---------- componentes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-3); color: var(--fg); cursor: pointer; font-weight: 500; font-size: 14px;
  min-height: 40px; white-space: nowrap;
}
.btn:hover { background: var(--bg-4); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--bg-3); color: var(--fg); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 0; width: 40px; }
.btn.icon.sm { width: 32px; }
.btn .ico { width: 18px; height: 18px; }

.input, .textarea, .select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--fg); min-height: 42px;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(209, 154, 106, 0.18); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--fg-2); }
.field .hint { font-size: 12px; color: var(--fg-3); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h2 { font-size: 15px; }
.card-title a, .card-title .btn { font-size: 13px; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; flex: 0 0 auto; text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--bg-2); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-4); color: var(--fg-2); white-space: nowrap; }
.badge .swatch { width: 8px; height: 8px; border-radius: 50%; }
.badge.todo { background: rgba(120, 130, 145, 0.18); color: #aab3c0; }
.badge.doing { background: rgba(107, 143, 214, 0.18); color: #9db5ec; }
.badge.review { background: rgba(155, 123, 220, 0.2); color: #bca6ec; }
.badge.retake { background: rgba(229, 148, 90, 0.2); color: #f0b48a; }
.badge.done { background: rgba(95, 196, 143, 0.18); color: #8ddcb3; }
.badge.blocked { background: rgba(224, 108, 108, 0.2); color: #f09a9a; }
[data-theme="light"] .badge.todo { color: #5b6470; }
[data-theme="light"] .badge.doing { color: #3a5fb5; }
[data-theme="light"] .badge.review { color: #6d4fc2; }
[data-theme="light"] .badge.retake { color: #b5662a; }
[data-theme="light"] .badge.done { color: #24894f; }
[data-theme="light"] .badge.blocked { color: #b53a3a; }
.badge.kind-meeting { color: var(--blue); }
.badge.kind-training { color: var(--violet); }
.badge.kind-shoot { color: var(--orange); }
.badge.kind-milestone { color: var(--accent); }
.badge.kind-deadline, .badge.kind-delivery { color: var(--red); }

.empty { text-align: center; color: var(--fg-3); padding: 40px 16px; }
.empty .ico { width: 36px; height: 36px; opacity: 0.4; margin-bottom: 8px; }
.empty b { display: block; color: var(--fg-2); font-weight: 600; margin-bottom: 4px; }
.muted { color: var(--fg-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  text-decoration: none; color: inherit; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.list-item:hover { background: var(--bg-3); text-decoration: none; }
.list-item + .list-item { border-top: 1px solid var(--line); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; display: block; }
.list-item .meta { color: var(--fg-3); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.list.divided .list-item { border-radius: 0; }

.segmented { display: inline-flex; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: var(--fg-2); cursor: pointer; font-weight: 500; font-size: 13px; min-height: 32px; }
.segmented button.active { background: var(--bg-4); color: var(--fg); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px); transform: translateX(-50%); background: var(--bg-4); color: var(--fg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; font-size: 14px; border: 1px solid var(--line-2); max-width: min(90vw, 480px); }
.toast.error { border-color: var(--red); }

/* modales y hojas */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--shadow); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 1; }
.modal-head h2 { flex: 1; font-size: 16px; }
.modal-body { padding: 16px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg-2); }
@media (max-width: 600px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92dvh; border-bottom: 0; }
}

/* ---------- inicio ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hero h1 { font-size: 24px; }
.hero .date { color: var(--fg-3); font-size: 14px; }
.today-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; }
@media (max-width: 820px) { .today-grid { grid-template-columns: 1fr; } }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.stat:hover { background: var(--bg-3); text-decoration: none; }
.stat b { display: block; font-size: 22px; font-weight: 600; }
.stat span { color: var(--fg-3); font-size: 12px; }

/* ---------- chat ---------- */
.content.flush.chat { display: flex; flex-direction: row; flex: 1; min-height: 0; height: calc(100dvh - var(--topbar)); }
.chat-list { width: 300px; flex: 0 0 300px; border-right: 1px solid var(--line); overflow-y: auto; background: var(--bg-2); }
.chat-list .nav-title { padding-top: 14px; }
.chan {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; text-decoration: none; color: var(--fg-2);
  border: 0; background: none; width: 100%; text-align: left;
}
.chan:hover { background: var(--bg-3); text-decoration: none; }
.chan.active { background: var(--bg-4); color: var(--fg); }
.chan.unread { color: var(--fg); font-weight: 600; }
.chan .hash { color: var(--fg-3); font-weight: 500; }
.chan .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan .count { font-size: 11px; font-weight: 700; background: var(--accent); color: var(--accent-fg); border-radius: 10px; padding: 1px 7px; }
.chan .swatch { width: 8px; height: 8px; border-radius: 2px; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.chat-head h2 { font-size: 15px; }
.chat-head .desc { color: var(--fg-3); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.day-sep { display: flex; align-items: center; gap: 10px; color: var(--fg-3); font-size: 12px; font-weight: 600; margin: 14px 0 6px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: flex; gap: 10px; padding: 6px 8px; border-radius: 10px; position: relative; }
.msg:hover { background: var(--bg-2); }
.msg.compact { padding-top: 1px; padding-bottom: 1px; }
.msg.compact .avatar { visibility: hidden; height: 0; }
.msg .body { flex: 1; min-width: 0; }
.msg .who { display: flex; align-items: baseline; gap: 8px; }
.msg .who b { font-size: 14px; }
.msg .who time { color: var(--fg-3); font-size: 12px; }
.msg .text { white-space: pre-wrap; word-break: break-word; }
.msg .text .mention { color: var(--accent); font-weight: 600; background: rgba(209,154,106,0.12); border-radius: 4px; padding: 0 3px; }
.msg .text a { word-break: break-all; }
.msg .actions { position: absolute; right: 8px; top: -12px; display: none; gap: 2px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; }
.msg:hover .actions { display: flex; }
.msg .replies { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--accent); font-size: 13px; font-weight: 500; background: none; border: 0; cursor: pointer; padding: 2px 0; }
.attachment { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-width: 420px; background: var(--bg-2); }
.attachment img { display: block; max-height: 320px; object-fit: contain; width: 100%; background: #000; }
.attachment video { display: block; width: 100%; max-height: 320px; background: #000; }
.attachment .file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.attachment .file-row .ico { width: 20px; height: 20px; color: var(--fg-3); }
.composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.composer-box { display: flex; align-items: flex-end; gap: 8px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 12px; }
.composer-box:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; border: 0; background: none; resize: none; padding: 8px 0; max-height: 160px; min-height: 24px; line-height: 1.4; }
.composer textarea:focus { outline: none; }
.composer .pending { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); padding: 4px 8px 8px; }
.thread { width: 380px; flex: 0 0 380px; border-left: 1px solid var(--line); display: flex; flex-direction: column; background: var(--bg-2); }
.thread .messages { padding: 12px; }

/* ---------- archivo ---------- */
.files-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--fg-3); font-size: 14px; }
.crumbs a, .crumbs button { color: var(--fg-2); background: none; border: 0; cursor: pointer; padding: 2px 4px; border-radius: 6px; font-weight: 500; }
.crumbs a:hover, .crumbs button:hover { background: var(--bg-3); text-decoration: none; }
.crumbs .cur { color: var(--fg); font-weight: 600; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; text-align: left; padding: 0; color: inherit; display: flex; flex-direction: column; }
.tile:hover { border-color: var(--line-2); background: var(--bg-3); }
.tile .thumb { aspect-ratio: 4 / 3; background: var(--bg-3); display: flex; align-items: center; justify-content: center; color: var(--fg-3); position: relative; overflow: hidden; }
.tile .thumb img, .tile .thumb video { width: 100%; height: 100%; object-fit: cover; }
.tile .thumb .ico { width: 30px; height: 30px; }
.tile .thumb .ver { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,0.65); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.tile .name { padding: 8px 10px 2px; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta { padding: 0 10px 8px; font-size: 12px; color: var(--fg-3); }
.tile.folder .thumb { aspect-ratio: auto; height: 64px; color: var(--accent); }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 20px; text-align: center; color: var(--fg-3); margin-top: 12px; }
.dropzone.over { border-color: var(--accent); color: var(--fg); background: rgba(209,154,106,0.06); }
.preview { display: flex; flex-direction: column; gap: 12px; }
.preview .media { background: #000; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 200px; max-height: 60dvh; }
.preview .media img, .preview .media video { max-height: 60dvh; max-width: 100%; }
.versions { display: flex; flex-direction: column; gap: 4px; }
.versions .v { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg-3); font-size: 13px; }
.versions .v.cur { outline: 1px solid var(--accent); }
.progress { height: 6px; background: var(--bg-4); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }

/* ---------- tareas ---------- */
.task-groups { display: flex; flex-direction: column; gap: 16px; }
.task-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); }
.task-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; text-align: left; width: 100%; color: inherit;
}
.task-row + .task-row { margin-top: 6px; }
.task-row:hover { background: var(--bg-3); }
.task-row .check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); flex: 0 0 20px; display: flex; align-items: center; justify-content: center; background: none; cursor: pointer; padding: 0; }
.task-row .check.done { background: var(--green); border-color: var(--green); color: #0b2a1a; }
.task-row .grow { flex: 1; min-width: 0; }
.task-row .title { display: block; font-weight: 500; }
.task-row .title.done { color: var(--fg-3); text-decoration: line-through; }
.task-row .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.task-row .due.late { color: var(--red); font-weight: 600; }
.task-row .due.soon { color: var(--orange); font-weight: 600; }
.prio { width: 4px; align-self: stretch; border-radius: 2px; background: transparent; }
.prio.high { background: var(--orange); }
.prio.urgent { background: var(--red); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.board .col { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 200px; }
.board .col h3 { font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; color: var(--fg-2); }
.board .task-row { border-color: transparent; background: var(--bg-3); }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment .text { white-space: pre-wrap; word-break: break-word; }
.comment time { color: var(--fg-3); font-size: 12px; margin-left: 8px; }

/* ---------- agenda ---------- */
.agenda-day { margin-bottom: 18px; }
.agenda-day h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.agenda-day h3.today { color: var(--accent); }
.event {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; text-align: left; width: 100%; color: inherit;
}
.event + .event { margin-top: 6px; }
.event:hover { background: var(--bg-3); }
.event .time { width: 58px; flex: 0 0 58px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.event .time small { display: block; color: var(--fg-3); font-weight: 400; font-size: 11px; }
.event .bar { width: 4px; align-self: stretch; border-radius: 2px; }
.event .grow { flex: 1; min-width: 0; }
.event .title { font-weight: 500; display: block; }
.event .meta { color: var(--fg-3); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .day { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 120px; }
.week .day h4 { font-size: 12px; color: var(--fg-3); margin-bottom: 6px; }
.week .day h4.today { color: var(--accent); }
.week .mini { font-size: 12px; padding: 4px 6px; border-radius: 6px; background: var(--bg-3); margin-bottom: 4px; cursor: pointer; border-left: 3px solid var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week .mini b { font-weight: 600; margin-right: 4px; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline .ms { display: flex; gap: 12px; align-items: center; }
.timeline .ms .d { width: 84px; flex: 0 0 84px; color: var(--fg-3); font-size: 13px; }
.timeline .ms .n { flex: 1; padding: 8px 12px; border-radius: 8px; background: var(--bg-3); border-left: 3px solid var(--accent); }

/* ---------- actividad ---------- */
.act { display: flex; gap: 10px; padding: 10px 8px; border-radius: 10px; cursor: pointer; text-align: left; width: 100%; color: inherit; background: none; border: 0; }
.act:hover { background: var(--bg-3); }
.act.unread { background: rgba(209,154,106,0.07); }
.act .t { flex: 1; min-width: 0; }
.act .t b { font-weight: 600; }
.act .t .when { color: var(--fg-3); font-size: 12px; margin-left: 6px; }

/* ---------- flujos ---------- */
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 12px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 26px; }
.step .tool { font-weight: 600; }
.step .action { color: var(--fg-2); }
.step .notes { color: var(--fg-3); font-size: 13px; margin-top: 2px; }
.step .min { color: var(--fg-3); font-size: 12px; white-space: nowrap; }
.step-editor { display: grid; grid-template-columns: 1fr 2fr 80px auto; gap: 8px; align-items: start; }
@media (max-width: 700px) { .step-editor { grid-template-columns: 1fr 1fr; } }

/* ---------- acceso ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, rgba(209,154,106,0.10), transparent 60%), var(--bg); }
.login-box { width: 100%; max-width: 400px; text-align: center; }
.login-box img { width: 96px; height: 96px; border-radius: 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.login-box h1 { font-size: 22px; margin-bottom: 4px; }
.login-box p { color: var(--fg-3); margin-bottom: 22px; }
.login-box .input { text-align: center; font-size: 17px; min-height: 48px; }
.login-box .code { letter-spacing: 0.4em; font-family: var(--mono); font-size: 24px; }
.login-box form { text-align: left; }
.login-box .btn { width: 100%; min-height: 48px; margin-top: 6px; }
.login-box .dev { margin-top: 16px; padding: 10px; background: var(--bg-3); border-radius: 10px; font-size: 13px; color: var(--fg-2); }

/* ---------- móvil ---------- */
.fab { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--bg-2); border-top: 1px solid var(--line); z-index: 30;
  }
  .tabbar a, .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--fg-3);
    text-decoration: none; font-size: 11px; font-weight: 500; background: none; border: 0; position: relative;
  }
  .tabbar a.active { color: var(--accent); }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar .count { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--accent); color: var(--accent-fg); font-size: 10px; font-weight: 700; border-radius: 9px; padding: 1px 5px; min-width: 16px; }
  .chat { height: calc(100dvh - var(--topbar) - var(--tabbar)); }
  .chat-list { width: 100%; flex: 1; border-right: 0; }
  .chat.viewing .chat-list { display: none; }
  .chat:not(.viewing) .chat-main { display: none; }
  .thread { position: fixed; inset: 0; width: auto; z-index: 40; border: 0; }
  .content { padding: 12px; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .stat b { font-size: 18px; }
  .week { display: flex; flex-direction: column; }
  .fab {
    display: flex; position: fixed; right: 16px; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%;
    background: var(--accent); color: var(--accent-fg); border: 0; box-shadow: var(--shadow); align-items: center; justify-content: center; z-index: 31; cursor: pointer;
  }
  .fab .ico { width: 26px; height: 26px; }
  .msg .actions { display: flex; position: static; background: none; border: 0; margin-top: 4px; opacity: 0.55; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 901px) { .hide-desktop { display: none !important; } }

.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-grid a { display: flex; align-items: center; gap: 10px; padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; font-weight: 500; }
.more-grid a .ico { width: 22px; height: 22px; color: var(--accent); }

.kbd { font-family: var(--mono); font-size: 12px; background: var(--bg-4); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); }
.notice { background: rgba(209,154,106,0.08); border: 1px solid rgba(209,154,106,0.35); color: var(--fg-2); padding: 10px 12px; border-radius: 10px; font-size: 13px; }
