/* Abogadía by Encriptech — estilos. Mobile first. Fondo claro con menús en azul empresarial (logo Encriptech). */
:root {
  --bg: #F3F6FB; --surface: #FFFFFF; --surface-2: #F6F8FC; --line: #DCE4F0; --line-2: #EBF0F7;
  --text: #0D1B36; --muted: #56637D; --faint: #8893A8;
  --primary: #0D4FA3; --primary-ink: #FFFFFF; --primary-soft: #E4EDFA; --primary-strong: #0A2B62;
  --accent: #E8871E; --plan: #CCDDF3;
  --ok: #1E9E5A; --ok-soft: #E3F5EA; --warn: #C98400; --warn-soft: #FFF4D9;
  --bad: #D64545; --bad-soft: #FDE8E8; --info: #0E8FA8; --info-soft: #DFF3F7; --mute-soft: #EDF1F7;
  --shadow: 0 1px 2px rgba(10, 43, 98, .06), 0 4px 16px rgba(10, 43, 98, .07);
  --radius: 16px; --radius-sm: 10px;
  --tab-h: 68px;
  /* Marca: menús y barras */
  --brand-navy: #0A2B62; --brand-blue: #0D4FA3; --brand-cyan: #19B9D1;
  --menu-bg: linear-gradient(180deg, #0A2B62 0%, #0C3F86 60%, #0D4FA3 100%);
  --menu-ink: #FFFFFF; --menu-muted: rgba(255, 255, 255, .72); --menu-hover: rgba(255, 255, 255, .10); --menu-on: rgba(255, 255, 255, .16);
  color-scheme: light;
}
/* Oscuro solo si el usuario lo elige en Ajustes (por defecto, fondo claro). */
:root[data-theme="dark"] {
  --bg: #0B1220; --surface: #121B2E; --surface-2: #16213A; --line: #24314D; --line-2: #1C2840;
  --text: #E6ECF7; --muted: #9AA6BF; --faint: #74809A;
  --primary: #4C8DFF; --primary-ink: #06101F; --primary-soft: #15284A; --primary-strong: #8AB4FF;
  --plan: #1F3559; --ok-soft: #12321F; --warn-soft: #3A2E0E; --bad-soft: #3D1A1A; --info: #35C3DA; --info-soft: #0F2E38; --mute-soft: #1C2840;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --menu-bg: linear-gradient(180deg, #071A3D 0%, #0A2B62 100%);
  color-scheme: dark;
}
/* "Automático" sigue al sistema */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0B1220; --surface: #121B2E; --surface-2: #16213A; --line: #24314D; --line-2: #1C2840;
    --text: #E6ECF7; --muted: #9AA6BF; --faint: #74809A;
    --primary: #4C8DFF; --primary-ink: #06101F; --primary-soft: #15284A; --primary-strong: #8AB4FF;
    --plan: #1F3559; --ok-soft: #12321F; --warn-soft: #3A2E0E; --bad-soft: #3D1A1A; --info: #35C3DA; --info-soft: #0F2E38; --mute-soft: #1C2840;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --menu-bg: linear-gradient(180deg, #071A3D 0%, #0A2B62 100%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-sm { width: 16px; height: 16px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.hide { display: none !important; }
@media (max-width: 520px) { .lbl-wide { display: none; } }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; }
.sidebar { display: none; }
.view { min-width: 0; padding: 16px 16px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 6px 0; }
.tabbar a.on { color: var(--primary); font-weight: 600; }
.tabbar a.fab { margin-top: -26px; }
.tabbar a.fab span.b {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 45%, transparent);
  border: 4px solid var(--bg);
}
.tabbar a.fab .i { width: 24px; height: 24px; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh;
    padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface);
  }
  .tabbar { display: none; }
  .view { padding: 28px 32px 48px; width: 100%; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 18px; letter-spacing: -.01em; }
.brand small { font-size: 11px; color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.on { background: var(--primary-soft); color: var(--primary-strong); }
.side-cta { justify-content: center; }

/* ---------- Encabezados ---------- */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.top h1 { font-size: 22px; letter-spacing: -.01em; }
.top .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.hello h1 { font-size: 26px; letter-spacing: -.02em; }
.hello h1 em { font-style: normal; color: var(--primary); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-title h2 { font-size: 16px; }
.section-title a { font-size: 13px; color: var(--primary); font-weight: 600; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.grid > .card + .card { margin-top: 0; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 639px) { .g4 { grid-template-columns: repeat(2, 1fr); } }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }
.big-delta { font-size: 30px; font-weight: 700; }
.c-ok { color: var(--ok); } .c-warn { color: var(--warn); } .c-bad { color: var(--bad); } .c-info { color: var(--info); }

.actions4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .actions4 { grid-template-columns: repeat(4, 1fr); } }
.action {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; cursor: pointer; text-align: left;
}
.action .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); }
.action.main { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.action.main .ic { background: rgba(255,255,255,.18); color: inherit; }
.action small { font-weight: 400; font-size: 12.5px; opacity: .8; display: block; margin-top: 2px; }

/* ---------- Listas ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line-2); cursor: pointer; }
.li:first-child { border-top: 0; }
.li:hover { background: var(--surface-2); }
.li .t { font-weight: 600; font-size: 14.5px; }
.li .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.li .num-badge { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .i { width: 34px; height: 34px; color: var(--faint); margin-bottom: 6px; }

/* ---------- Chips y estados ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.done { background: var(--primary-soft); color: var(--primary-strong); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.mute { background: var(--mute-soft); color: var(--muted); }
.bg-ok { background: var(--ok); } .bg-warn { background: var(--warn); } .bg-bad { background: var(--bad); } .bg-done { background: var(--primary); } .bg-info { background: var(--info); } .bg-mute { background: var(--faint); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; cursor: pointer; color: var(--muted);
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { opacity: .7; font-weight: 500; margin-left: 4px; }

/* ---------- Progreso ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--line-2); position: relative; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--primary); }
.bar > b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .55; border-radius: 2px; }
.pv { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 12.5px; }

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-danger { color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); outline: none;
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=range] { width: 100%; accent-color: var(--primary); height: 32px; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; }
.switch input { width: 44px; height: 26px; accent-color: var(--primary); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 12px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--primary); border-color: var(--primary); }

/* ---------- Proyecto (tarjeta) ---------- */
.pcard { display: block; overflow: hidden; padding: 0; }
.pcard .cover { height: 92px; position: relative; display: flex; align-items: flex-end; padding: 12px 14px; color: #fff; }
.pcard .cover h3 { font-size: 17px; text-shadow: 0 1px 6px rgba(0,0,0,.25); }
.pcard .cover .code { position: absolute; top: 10px; left: 14px; font-size: 11.5px; font-weight: 700; opacity: .9; letter-spacing: .05em; }
.pcard .cover .pill { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.92); }
.pcard .body { padding: 14px; display: grid; gap: 10px; }

/* ---------- Captura por voz ---------- */
.capture { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.capture > * { min-width: 0; }
@media (min-width: 1000px) { .capture { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.line-nav { display: flex; align-items: center; gap: 8px; }
.line-nav .lbl { flex: 1; text-align: center; font-weight: 700; white-space: nowrap; font-size: 14.5px; }
.ftabs { position: relative; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px 4px; }
.ftabs::-webkit-scrollbar { display: none; }
.ftab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 112px; padding: 9px 12px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left;
}
.ftab b { font-size: 12.5px; }
.ftab small { font-size: 11.5px; color: var(--faint); max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftab.filled small { color: var(--muted); }
.ftab.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary-soft); }
.ftab.on b { color: var(--primary-strong); }
.field-box { min-height: 170px; }
.field-box textarea.input { min-height: 150px; font-size: 16px; }
.heard {
  border-radius: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--line); font-size: 14px; color: var(--muted); min-height: 44px;
}
.heard.live { border-color: var(--primary); color: var(--text); }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 2px; }
.mic {
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 40%, transparent);
  position: relative; transition: transform .15s;
}
.mic .i { width: 34px; height: 34px; }
.mic:active { transform: scale(.96); }
.mic.on { background: var(--bad); box-shadow: 0 8px 24px color-mix(in srgb, var(--bad) 40%, transparent); }
.mic.on::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--bad); opacity: .5; animation: pulse 1.4s infinite;
}
@keyframes pulse { 0% { transform: scale(.9); opacity: .6; } 100% { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mic.on::after { animation: none; } }
.mic-state { font-size: 13px; font-weight: 600; color: var(--muted); }
.cmd-help { font-size: 12.5px; color: var(--muted); }
.cmd-help code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-family: inherit; font-size: 12px; color: var(--text); white-space: nowrap; }
.cmd-help p { margin: 6px 0; line-height: 1.9; }
.sticky-mic { position: sticky; bottom: calc(var(--tab-h) + 12px); z-index: 5; }
@media (min-width: 900px) { .sticky-mic { bottom: 16px; } }
.citem { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line-2); cursor: pointer; }
.citem:first-child { border-top: 0; }
.citem.on { background: var(--primary-soft); }
.citem .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.citem .meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Fotos ---------- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb button .i { width: 14px; height: 14px; }
.thumb input { position: absolute; left: 0; right: 0; bottom: 0; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 4px 6px; outline: none; }
.thumb input::placeholder { color: rgba(255,255,255,.75); }
.add-photo { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); cursor: pointer; background: var(--surface); text-align: center; font-size: 12px; font-weight: 600; }
.add-photo .i { width: 26px; height: 26px; margin: 0 auto 4px; display: block; }

/* ---------- Bitácora / feed ---------- */
.feed-item { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px; border-top: 1px solid var(--line-2); }
.feed-item:first-child { border-top: 0; }
.feed-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.feed-ic .i { width: 18px; height: 18px; }
.feed-item .t { font-weight: 600; font-size: 14px; }
.feed-item .s { font-size: 12.5px; color: var(--muted); }
.feed-item p { margin: 6px 0 0; font-size: 14px; white-space: pre-line; }
.feed-photos { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.feed-photos img { width: 96px; height: 76px; object-fit: cover; border-radius: 10px; flex: none; cursor: zoom-in; }

/* ---------- Gantt ---------- */
.gantt-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); max-height: 70vh; }
.gantt { display: grid; position: relative; min-width: max-content; font-size: 12.5px; }
.g-head, .g-row { display: contents; }
.g-name {
  position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-2);
  padding: 8px 10px; width: min(44vw, 260px); display: flex; flex-direction: column; justify-content: center; cursor: pointer;
}
.g-name .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-name .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-name.group { background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); cursor: default; }
.g-hd { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.g-hd.g-name { z-index: 4; font-weight: 700; color: var(--muted); }
.g-scale { position: relative; height: 44px; }
.g-scale .m { position: absolute; top: 4px; font-size: 11px; font-weight: 700; color: var(--muted); padding-left: 4px; white-space: nowrap; }
.g-scale .w { position: absolute; bottom: 4px; font-size: 10.5px; color: var(--faint); padding-left: 3px; }
.g-track { position: relative; height: 46px; border-bottom: 1px solid var(--line-2); }
.g-track.group { height: 30px; background: var(--surface-2); }
.g-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.g-grid.month { background: var(--line); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; pointer-events: none; }
.g-today::before { content: "Hoy"; position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--accent); }
.g-plan { position: absolute; top: 9px; height: 12px; border-radius: 99px; background: var(--plan); }
.g-real { position: absolute; top: 24px; height: 12px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.g-real i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; }
.g-real.ok i { background: var(--ok); } .g-real.risk i { background: var(--warn); } .g-real.late i, .g-real.blocked i { background: var(--bad); }
.g-real.done i, .g-real.verify i { background: var(--primary); } .g-real.todo i { background: var(--faint); }
.g-ghost { position: absolute; top: 24px; height: 12px; border-radius: 99px; border: 1.5px dashed var(--bad); opacity: .7; }
.g-mile { position: absolute; top: 14px; width: 16px; height: 16px; transform: translateX(-8px) rotate(45deg); border-radius: 3px; }
.g-lbl { position: absolute; top: 22px; font-size: 11px; font-weight: 700; white-space: nowrap; padding-left: 6px; }

/* Cabecera de escala (los dos diseños) */
.gt-scale { position: sticky; top: 0; z-index: 3; height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); }
.gs-top, .gs-bot { position: relative; height: 32px; }
.gs-top { border-bottom: 1px solid var(--line-2); }
.gs-top span, .gs-bot span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--line-2); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.gs-top span { font-weight: 600; color: var(--text); justify-content: flex-start; padding-left: 8px; }
.gs-bot span { flex-direction: column; font-size: 10.5px; line-height: 1.15; }
.gs-bot span b { font-size: 12px; font-weight: 600; color: var(--text); }
.gs-bot span.we { background: var(--surface-2); }
.gs-bot span.now { background: var(--bad); color: #fff; font-weight: 700; }
.gs-bot span.now b { color: #fff; }

/* Gantt en tabla */
.gt .gantt { font-size: 13px; }
.gt-row { position: sticky; left: 0; z-index: 2; display: grid; align-items: stretch; height: 52px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-2); cursor: pointer; }
.gt-row > span { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 10px; border-right: 1px solid var(--line-2); color: var(--muted); font-variant-numeric: tabular-nums; background: inherit; }
.gt-row > span:last-child { border-right: 0; color: var(--text); }
.gt-row .gt-cod, .gt-row .gt-esq, .gt-row .gt-av { justify-content: center; font-size: 12px; }
.gt-row.b > span { font-weight: 700; color: var(--text); }
.gt-row:not(.gt-hd):hover { background: var(--surface-2); }
.gt-hd { top: 0; z-index: 4; height: 64px; cursor: default; border-bottom: 1px solid var(--line); }
.gt-hd > span { justify-content: center; font-size: 12px; font-weight: 600; color: var(--muted) !important; }
.gt-track { height: 52px; }
.gt-now { width: 2px; background: var(--bad); }
.gt-now::before { content: none; }
.gb { position: absolute; top: 10px; height: 32px; border-radius: 99px; overflow: hidden; display: flex; align-items: center; background: color-mix(in srgb, var(--gc) 42%, var(--surface)); }
.gb i { position: absolute; inset: 0 auto 0 0; background: var(--gc); }
.gb b { position: relative; padding: 0 14px; color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.gb.is-late { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--bad); }
.gb-ext { position: absolute; top: 10px; height: 32px; border: 2px dashed var(--bad); border-left: 0; border-radius: 0 99px 99px 0; opacity: .7; }
.gb-out { position: absolute; top: 0; height: 52px; display: flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.gm { position: absolute; top: 15px; width: 22px; height: 22px; border-radius: 5px; transform: rotate(45deg); background: var(--gc); box-shadow: 0 0 0 3px var(--surface); }
.gt-tag { max-width: 100%; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--gc) 16%, var(--surface)); color: color-mix(in srgb, var(--gc) 70%, var(--text)); }
.gc0 { --gc: #3B82F6; } .gc1 { --gc: #E8930C; } .gc2 { --gc: #14B8A6; } .gc3 { --gc: #8B5CF6; }
.gc4 { --gc: #E0457B; } .gc5 { --gc: #22A06B; } .gc6 { --gc: #EF6C3A; } .gc7 { --gc: #0EA5E9; }

/* Control de escala Año · Semestre · Mes · Semana · Día */
.zoom { display: flex; align-items: center; gap: 8px; }
.zoom .zb { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; }
.zoom .zb:disabled { opacity: .35; cursor: default; }
.zt { position: relative; display: flex; }
.zt::before { content: ""; position: absolute; left: 30px; right: 30px; top: 7px; height: 2px; background: var(--line); }
.zt button { position: relative; width: 60px; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.zt i { width: 2px; height: 16px; background: var(--faint); border-radius: 2px; }
.zt button.on { color: var(--text); font-weight: 700; }
.zt button.on i { width: 16px; height: 16px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
@media (max-width: 640px) { .zt button { width: 46px; font-size: 10px; } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); margin: 10px 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 8px; border-radius: 99px; display: inline-block; }

/* ---------- Curva S ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .ax { stroke: var(--line); }
.chart text { fill: var(--faint); font-size: 10px; }

/* ---------- Hoja inferior (sheet) ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(8, 16, 12, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; overflow-x: hidden; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 22px; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 19px; margin-bottom: 4px; }
.sheet .lead { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.sheet-foot { display: flex; gap: 10px; margin-top: 8px; position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--surface); padding: 10px 0 4px; }
.sheet-foot .btn { flex: 1; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 90dvh; border-radius: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 70;
  transition: .2s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ---------- Q&A seguimiento ---------- */
.qa-q { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; }
.qa-q .bot { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); display: grid; place-items: center; flex: none; }
.qa-q .bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 12px; font-weight: 600; }
.pct-big { font-size: 44px; font-weight: 800; letter-spacing: -.03em; text-align: center; }
.summary { background: var(--primary-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.summary div span:first-child { color: var(--muted); }

/* ---------- Informe (vista previa / impresión) ---------- */
.paper { background: #fff; color: #0D1B36; border-radius: 6px; padding: 32px; box-shadow: var(--shadow); border: 1px solid var(--line); font-size: 13px; }
.paper h1 { font-size: 22px; margin-bottom: 4px; }
.paper h2 { font-size: 15px; color: #0D4FA3; margin: 18px 0 8px; }
.paper table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.paper th { background: #0D4FA3; color: #fff; text-align: left; font-size: 12px; }
.paper th, .paper td { border: 1px solid #C9D3CE; padding: 5px 7px; vertical-align: top; }
.paper tr:nth-child(even) td { background: #F2F6F4; }
.paper .ph { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.paper .ph figure { margin: 0; text-align: center; font-size: 11px; color: #5E6B65; font-style: italic; }
.paper .ph img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 4px; }
.paper .sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; text-align: center; font-size: 12px; }
.paper .sign div { border-top: 1px solid #333; padding-top: 6px; }
.paper .brandline { display: flex; justify-content: space-between; border-bottom: 2px solid #0D4FA3; padding-bottom: 6px; margin-bottom: 18px; font-size: 11px; color: #5E6B65; }
.paper .brandline b { color: #0D4FA3; letter-spacing: .08em; }
@media (max-width: 600px) { .paper { padding: 16px; font-size: 12px; } .paper .ph { grid-template-columns: 1fr; } }

@media print {
  body { background: #fff; }
  .sidebar, .tabbar, .no-print, .toast, #sheetRoot { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; max-width: none; }
  .paper { box-shadow: none; border: 0; padding: 0; }
  @page { size: A4; margin: 16mm; }
}

/* ---- Acceso y sincronización con el equipo ---- */
.login-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: var(--bg); overflow: auto; }
.login { width: 100%; max-width: 400px; padding: 24px; }
.login .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login .brand img { width: 40px; height: 40px; border-radius: 10px; }
.login .brand small { display: block; font-size: 11px; color: var(--muted); }
.login h1 { font-size: 22px; margin: 0 0 6px; }
.login p.muted { margin: 0 0 16px; font-size: 14px; }
.login-msg { min-height: 1.3em; color: var(--bad); font-size: 13.5px; margin: 4px 0 10px; }
.sync-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: auto; background: var(--faint); flex: none; }
.sync-dot.ok { background: var(--primary); } .sync-dot.wait { background: #E0A100; } .sync-dot.off { background: var(--faint); } .sync-dot.err { background: #D64545; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.team-row:first-child { border-top: 0; }
.team-row .t { font-weight: 600; } .team-row .s { font-size: 12.5px; color: var(--muted); }
.team-row.off { opacity: .55; }

/* Asistente de bienvenida: profesión y áreas */
.wz-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12.5px; color: var(--faint); }
.wz-steps span { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); }
.wz-steps .on { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.wz-steps .done { color: var(--primary-strong); }
.wz-q { font-size: 18px; margin: 0 0 10px; }
.prof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 620px) { .prof-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.prof { display: grid; gap: 2px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.prof:hover { border-color: var(--primary); }
.prof.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.prof .e { font-size: 24px; line-height: 1.2; }
.prof small { color: var(--muted); font-size: 12.5px; }
.chips.wrap { flex-wrap: wrap; }
.chip-x { display: inline-grid; place-items: center; border: 0; background: none; color: inherit; padding: 0; margin-left: 6px; cursor: pointer; opacity: .7; }
.chip-x:hover { opacity: 1; }
.chip-x .i { width: 14px; height: 14px; }

/* ---- Modo demo ---- */
.demo-bar { position: sticky; top: 0; z-index: 50; padding: 8px 16px; font-size: 13px; text-align: center; background: #FFF4D6; color: #6B4E00; border-bottom: 1px solid #F0DB9A; }
.demo-bar a { font-weight: 700; color: inherit; text-decoration: underline; margin-left: 6px; }
.demo-bar select { font: inherit; font-size: 12.5px; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 6px; padding: 2px 4px; margin-left: 6px; max-width: 46vw; }
.demo-bar select option { color: #222; background: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-bar { background: #3A2F0F; color: #F3DC94; border-color: #5A4A18; } }
:root[data-theme="dark"] .demo-bar { background: #3A2F0F; color: #F3DC94; border-color: #5A4A18; }

/* ---- Fase 5: Gantt interactivo (dependencias, arrastre, línea base), Tablero Kanban y Calendario ---- */
.g-drag { cursor: grab; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.g-drag.dragging { cursor: grabbing; z-index: 2; opacity: .85; outline: 2px solid var(--primary); outline-offset: 2px; }
.g-h { position: absolute; top: -4px; bottom: -4px; width: 10px; cursor: ew-resize; z-index: 1; }
.g-h.l { left: -2px; } .g-h.r { right: -2px; }
.gb .g-h { top: 0; bottom: 0; }
.g-drag:hover .g-h::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 2px; border-radius: 2px; background: rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.g-tip { position: absolute; top: -2px; z-index: 5; transform: translateX(-50%); padding: 2px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.g-base { position: absolute; top: 39px; height: 4px; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--muted) 0 6px, transparent 6px 8px); opacity: .75; pointer-events: none; }
.gt-track .g-base { top: 44px; height: 5px; }
.g-dev { position: absolute; top: 34px; font-size: 10.5px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.gt-track .g-dev { top: 38px; }
.g-arrows { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; overflow: visible; }
.g-arrows path { fill: none; stroke: var(--muted); stroke-width: 1.5; marker-end: url(#gArrow); }
.g-arrows marker path { fill: var(--muted); stroke: none; }
.g-arrows path.bad { stroke: var(--bad); stroke-dasharray: 4 3; marker-end: url(#gArrowBad); }
.g-cycle, .g-cycle > span:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.g-warn { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); font-size: 13px; font-weight: 600; }
.g-hint { font-size: 12.5px; margin: 8px 2px; }
.g-key { display: inline-block; width: 22px; vertical-align: middle; margin-right: 6px; }
.g-key.arrow { height: 2px; background: var(--muted); position: relative; }
.g-key.arrow::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--muted); border-right: 0; }
.g-key.base { height: 5px; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--muted) 0 6px, transparent 6px 8px); }
.dep-add { display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; align-items: end; margin-top: 10px; }
.dep-lag { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); }
.dep-lag .input { width: 84px; padding: 8px; }
.dep-li { align-items: center; }
@media (max-width: 520px) { .dep-add { grid-template-columns: 1fr 96px; } .dep-add .btn { grid-column: 1 / -1; } }

.kb { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.kb-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 180px; scroll-snap-align: start; transition: background .15s, border-color .15s; }
.kb-col header { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; margin: 2px 2px 10px; }
.kb-col header .n { margin-left: auto; font-weight: 600; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.kb-col.kb-over { background: var(--primary-soft); border-color: var(--primary); border-style: dashed; }
.kb-dot { width: 10px; height: 10px; border-radius: 50%; }
.kb-dot.k-pendiente { background: var(--faint); } .kb-dot.k-en_proceso { background: var(--info); } .kb-dot.k-bloqueado { background: var(--bad); } .kb-dot.k-terminado { background: var(--ok); }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; box-shadow: var(--shadow); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.kb-card:hover { border-color: var(--primary); }
.kb-card .num-badge { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.kb-card .dot { margin-top: 6px; }
.kb-t { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-s { margin-top: 6px; font-size: 12px; color: var(--muted); }
.kb-tag { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: var(--info-soft); color: var(--info); font-weight: 600; font-size: 11px; }
.kb-bar { margin-top: 8px; height: 5px; }
.kb-src { opacity: .35; }
.kb-ghost { position: fixed; z-index: 100; pointer-events: none; transform: rotate(2deg); box-shadow: 0 10px 30px rgba(0,0,0,.25); cursor: grabbing; }
.kb-empty { padding: 18px 6px; text-align: center; font-size: 12.5px; color: var(--faint); }
@media (max-width: 860px) { .kb { grid-template-columns: repeat(4, 80vw); } }

.seg a.seg-a { flex: 1; text-align: center; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg a.seg-a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.cal-tit { font-size: 17px; margin: 0 0 0 6px; }
.cal-mes { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.cal-hd, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-hd span { padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-d { min-height: 108px; padding: 4px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.fuera { background: var(--surface-2); }
.cal-d.fuera .cal-n { color: var(--faint); }
.cal-n { align-self: flex-end; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: 12.5px; font-weight: 700; color: var(--text); }
.cal-n:hover { background: var(--surface-2); }
.cal-d.hoy .cal-n { background: var(--primary); color: var(--primary-ink); }
.cal-ev { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; padding: 2px 6px; border: 0; border-radius: 6px; font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--faint); }
.cal-ev span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-ev em { font-style: normal; color: var(--muted); }
.cal-ev .dot { width: 7px; height: 7px; }
.cal-ev .i-sm { width: 13px; height: 13px; flex: none; }
.cal-ev.k-reunion { background: var(--info-soft); border-left-color: var(--info); }
.cal-ev.k-hito { background: var(--ok-soft); border-left-color: var(--ok); }
.cal-ev.k-tarea { background: var(--warn-soft); border-left-color: var(--warn); }
.cal-ev.k-actividad { background: var(--primary-soft); border-left-color: var(--primary); }
.cal-ev.k-curso { background: transparent; border-left-color: var(--plan); color: var(--muted); }
.cal-mas { font-size: 11px; font-weight: 600; color: var(--muted); padding-left: 6px; }
.legend .cal-key { width: 14px; height: 10px; border-radius: 3px; }
.cal-key.k-reunion { background: var(--info); } .cal-key.k-hito { background: var(--ok); } .cal-key.k-tarea { background: var(--warn); } .cal-key.k-actividad { background: var(--primary); }
.cal-sem { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 260px; min-width: 0; }
.cal-col header { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-col header b { font-size: 17px; color: var(--text); }
.cal-col.hoy { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-col.hoy header b { color: var(--primary); }
.cal-evs { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.cal-sem .cal-ev { padding: 5px 7px; font-size: 12px; }
.cal-sem .cal-ev span:last-child { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cal-nada { color: var(--faint); font-size: 12px; text-align: center; padding: 8px; }
@media (max-width: 760px) {
  .cal-d { min-height: 64px; padding: 2px; }
  .cal-d .cal-ev span:last-child, .cal-d .cal-ev em { display: none; }
  .cal-d .cal-ev { padding: 3px; justify-content: center; }
  .cal-sem { grid-template-columns: 1fr; }
  .cal-col { min-height: 0; display: grid; grid-template-columns: 64px 1fr; }
  .cal-col header { flex-direction: column; align-items: center; border-bottom: 0; border-right: 1px solid var(--line-2); }
}
@media print { .g-h, .g-tip { display: none; } }

/* ---- Barra superior y búsqueda global ---- */
.main-col { min-width: 0; }
.appbar {
  position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2);
}
.appbar-brand img { width: 32px; height: 32px; border-radius: 9px; display: block; }
.search-trigger {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; text-align: left;
}
.search-trigger:hover { border-color: var(--primary); color: var(--text); }
.search-trigger .i { width: 18px; height: 18px; }
kbd { font: 600 11px/1 ui-monospace, monospace; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
@media (min-width: 900px) {
  .appbar { padding: 12px 32px; justify-content: flex-end; }
  .appbar-brand { display: none; }
}
.search-backdrop { align-items: flex-start !important; padding-top: max(8px, env(safe-area-inset-top)); }
.search-backdrop .sheet { border-radius: 0 0 22px 22px; animation: down .18s ease-out; }
@media (min-width: 700px) { .search-backdrop { padding-top: 8vh; } .search-backdrop .sheet { border-radius: 22px; max-height: 80dvh; } }
@keyframes down { from { transform: translateY(-20px); opacity: .6; } }
.search-backdrop .grab { display: none; }
.search-field { position: relative; display: block; margin-bottom: 12px; }
.search-field > .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field .input { padding-left: 42px; font-size: 16px; }
.search-res { min-height: 120px; }
.search-group { margin-bottom: 14px; }
.search-gh { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 4px 6px; }
.search-gh .n { font-weight: 600; }
button.li { width: 100%; border: 0; border-top: 1px solid var(--line-2); background: none; text-align: left; font: inherit; color: inherit; }
.search-hit .t, .search-hit .s { display: block; }
.search-hit.on { background: var(--primary-soft); }
.search-hit mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--primary-strong); border: 1px solid var(--line); }
.search-ic .i { width: 17px; height: 17px; }
.search-more { justify-content: center; color: var(--primary); font-weight: 600; font-size: 13.5px; }
.search-person { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.search-tip small { font-size: 12.5px; }

/* ---- Informes: logo del encabezado ---- */
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.logo-row .muted { font-size: 12.5px; }
.logo-prev { width: 64px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-prev img { max-width: 58px; max-height: 34px; object-fit: contain; }
.paper .brandline { align-items: center; gap: 10px; }
.paper .brandline img { height: 30px; max-width: 110px; object-fit: contain; }
.paper .brandline span { flex: 1; }
@media (max-width: 520px) { .rep-btns { display: grid; grid-template-columns: 1fr 1fr; } .rep-btns .btn { padding: 0 10px; font-size: 14px; } .rep-btns .btn-primary { grid-column: 1 / -1; } }

/* ---------- Fase 3: checklist, enlace para el cliente y su vista pública ---------- */
.ck-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; background: var(--surface-2); }
.ck-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 14px; }
.ck-row input, .ck-li input, .ck-ed-row input[type=checkbox] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.ck-row[hidden] { display: none; }
.ck-row.on span { text-decoration: line-through; color: var(--muted); }
.ck-add { display: flex; gap: 8px; margin-top: 6px; }
.ck-add .input { flex: 1; min-width: 0; min-height: 38px; }
.ck-ed { display: grid; gap: 6px; }
.ck-ed-row { display: flex; align-items: center; gap: 8px; }
.ck-ed-row .input { flex: 1; min-width: 0; min-height: 38px; }
.ck-li { cursor: pointer; }
.enl-nuevo { margin-top: 12px; background: var(--primary-soft); border-color: transparent; font-size: 13.5px; }
.cli .view.cli-view { padding-bottom: 40px; max-width: 1000px; }
.cli-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cli-head img { width: 26px; height: 26px; border-radius: 7px; }
.cli-h2 { font-size: 16px; margin: 22px 0 10px; }
.cli-foot { font-size: 12.5px; text-align: center; margin-top: 28px; }
.cli-acta summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.cli-acta summary::-webkit-details-marker { display: none; }
.cli-acta summary small { display: block; margin-top: 2px; }
.cli-acta .num-badge { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.cli-table { overflow-x: auto; }
.cli-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cli-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cli-table td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.cg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 12px 10px; overflow: hidden; }
.cg-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px; align-items: center; min-height: 38px; border-top: 1px solid var(--line-2); }
.cg-row.cg-scale { border-top: 0; min-height: 26px; }
.cg-name { min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; }
.cg-name small { font-weight: 500; font-size: 11.5px; }
.cg-track { position: relative; height: 38px; }
.cg-scale .cg-track { height: 26px; }
.cg-scale .cg-track span { position: absolute; top: 6px; font-size: 11px; color: var(--muted); transform: translateX(3px); white-space: nowrap; }
.cg-track > b { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.cg-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; }
.cg-bar { position: absolute; top: 12px; height: 14px; border-radius: 99px; background: var(--plan); overflow: hidden; z-index: 1; }
.cg-bar > i { position: absolute; inset: 0 auto 0 0; background: var(--primary); }
.cg-bar.bad > i { background: var(--bad); } .cg-bar.warn > i { background: var(--warn); }
.cg-hito { position: absolute; top: 12px; width: 14px; height: 14px; background: var(--primary); transform: translateX(-7px) rotate(45deg); border-radius: 2px; z-index: 1; }
.cg-hito.bad { background: var(--bad); } .cg-hito.warn { background: var(--warn); } .cg-hito.mute, .cg-hito.ok { background: var(--info); }
@media (max-width: 560px) { .cg-row { grid-template-columns: 110px 1fr; } }

/* ---- Fase 4: firmas en actas, QR de verificación, horas y timesheet ---- */
.paper .firmas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; margin-top: 8px; text-align: center; font-size: 12px; }
.paper .firmas > div { display: flex; flex-direction: column; align-items: center; break-inside: avoid; }
.paper .firmas .img { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 70px; border-bottom: 1px solid #333; margin-bottom: 6px; }
.paper .firmas img { max-height: 66px; max-width: 100%; object-fit: contain; }
.paper .firmas i { color: #0D4FA3; font-size: 11px; padding-bottom: 6px; }
.paper .firmas span { color: #5E6B65; } .paper .firmas small { color: #7A8680; font-size: 10.5px; }
.paper .verif { display: flex; gap: 14px; align-items: center; margin-top: 26px; padding-top: 12px; border-top: 1px solid #E2E8E5; font-size: 11.5px; color: #5E6B65; break-inside: avoid; }
.paper .verif svg { flex: none; }
.paper .verif div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.paper .verif b { color: #0D4FA3; font-size: 13px; } .paper .verif a { color: #0D1B36; overflow-wrap: anywhere; } .paper .verif small { color: #8A9690; }
@media (max-width: 600px) { .paper .firmas { grid-template-columns: repeat(2, 1fr); } }

.sigpad { position: relative; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: #fff; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: 190px; cursor: crosshair; touch-action: none; }
.sigpad .base { position: absolute; left: 8%; right: 8%; bottom: 38px; border-top: 1px solid #C9D3CE; pointer-events: none; }
.sigpad .hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 12px; color: #8A9690; pointer-events: none; }
.firma-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.firma-row:first-child { border-top: 0; }
.firma-row img { width: 96px; height: 40px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.firma-row .s { font-size: 12.5px; color: var(--muted); }

.timer-chip { position: fixed; z-index: 40; right: 14px; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 28px); padding: 8px 8px 8px 14px; border-radius: 99px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 13.5px; }
.timer-chip a { display: flex; align-items: center; gap: 8px; min-width: 0; }
.timer-chip b { font-variant-numeric: tabular-nums; }
.timer-chip .ellipsis { max-width: 34vw; opacity: .85; }
.timer-chip button { border: 0; border-radius: 99px; background: var(--bad); color: #fff; padding: 6px 12px; font-weight: 700; cursor: pointer; }
@media (min-width: 900px) { .timer-chip { bottom: 18px; } }
@media print { .timer-chip { display: none !important; } }
.horas-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; font-size: 14px; }
.ts-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ts { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.ts th, .ts td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
.ts th:first-child, .ts td:first-child { text-align: left; white-space: normal; min-width: 220px; }
.ts thead th { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 600; }
.ts thead th.hoy { color: var(--primary-strong); }
.ts td.c { cursor: pointer; font-variant-numeric: tabular-nums; } .ts td.c:hover { background: var(--primary-soft); }
.ts td.z { color: var(--faint); }
.ts .grp td { background: var(--surface-2); font-weight: 700; font-size: 12.5px; color: var(--muted); }
.ts tfoot td, .ts td.tot { font-weight: 700; font-variant-numeric: tabular-nums; }
.ts tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }

/* ---------------------------------------------------------------- Fase 6: comentarios y compromisos sugeridos */
.cmt-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cmt-badge:empty { display: none; }
.cmt-badge.nuevo { color: var(--info); }
.cmt-badge.mencion { color: var(--bad); }
.cmt-badge b { font-weight: 800; }
.cmt-list { max-height: 46vh; overflow-y: auto; display: grid; gap: 8px; margin-bottom: 12px; }
.cmt { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 12px; margin-right: 32px; }
.cmt.mio { background: var(--primary-soft); border-color: transparent; margin: 0 0 0 32px; }
.cmt-h { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cmt-h .faint { font-size: 12px; flex: 1; }
.cmt-h .icon-btn { width: 28px; height: 28px; }
.cmt-t { font-size: 14.5px; margin-top: 2px; word-wrap: break-word; }
.cmt-t .mencion { color: var(--info); font-weight: 600; }
.cmt-input { position: relative; }
.cmt-sug { position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); padding: 4px; z-index: 5; display: grid; }
.cmt-sug button { text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.cmt-sug button.on, .cmt-sug button:hover { background: var(--surface-2); }
.sug-list { display: grid; gap: 10px; }
.sug { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.sug .field { margin-bottom: 8px; }
.sug.ok, .sug.no { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 12px; font-size: 13.5px; color: var(--muted); background: var(--surface-2); }
.sug.ok { color: var(--primary-strong); background: var(--primary-soft); border-color: transparent; }
.sug-cita { font-size: 12.5px; color: var(--faint); font-style: italic; margin: 0 0 8px; }

/* ---------- Ayuda contextual (js/ayuda.js) ---------- */
.ayuda-q {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 6px; vertical-align: middle; flex: none;
  border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  font: 700 13px/1 system-ui, sans-serif; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: opacity .2s, background .2s;
}
.ayuda-q.nueva { border-color: transparent; background: var(--info-soft); color: var(--info); }
.ayuda-q.tenue { opacity: .35; }
.ayuda-q:hover, .ayuda-q[aria-expanded="true"] { opacity: 1; background: var(--info); color: #fff; border-color: transparent; }
.ayuda-q:focus-visible, .ayuda-pop :focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.ayuda-pop {
  margin: 8px 0 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--text);
  border-left: 4px solid var(--info); font-size: 13.5px; line-height: 1.45; animation: ayuda-in .18s ease-out;
}
@keyframes ayuda-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .ayuda-pop { animation: none; } }
.ayuda-pop-h { display: flex; align-items: center; gap: 8px; }
.ayuda-pop-h b { flex: 1; font-size: 14px; outline: none; }
.ayuda-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--info); color: #fff; font: 700 12px/1 system-ui, sans-serif; flex: none; }
.ayuda-x { display: grid; place-items: center; width: 32px; height: 32px; margin: -6px -6px -6px 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.ayuda-x:hover { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--text); }
.ayuda-pop p { margin: 6px 0 0; }
.ayuda-ej { color: var(--muted); font-style: italic; }
.ayuda-ej span { font-style: normal; font-weight: 600; }
.ayuda-pop-f { display: flex; justify-content: flex-end; margin-top: 10px; }
.ayuda-pop-f .btn { background: var(--surface); }
@media print { .ayuda-q, .ayuda-pop { display: none !important; } }

/* ---------- Marca Encriptech: menús en azul empresarial sobre pantallas claras ---------- */
.sidebar { background: var(--menu-bg); border-right: 0; color: var(--menu-ink); }
.sidebar .brand img, .appbar-brand img { background: #fff; padding: 3px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.sidebar .brand b { color: #fff; }
.sidebar .brand small { color: var(--menu-muted); }
.sidebar .side-nav a { color: var(--menu-muted); position: relative; }
.sidebar .side-nav a:hover { background: var(--menu-hover); color: #fff; }
.sidebar .side-nav a.on { background: var(--menu-on); color: #fff; font-weight: 600; }
.sidebar .side-nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-cyan); }
.sidebar .side-cta { background: #fff; color: var(--brand-navy); }
.sidebar .side-cta:hover { background: #E4EDFA; }
.sidebar .sync-dot.ok { background: var(--brand-cyan); }
.sidebar .sync-dot.off { background: rgba(255, 255, 255, .4); }

@media (max-width: 899px) {
  .appbar { background: var(--menu-bg); border-bottom: 0; box-shadow: 0 2px 10px rgba(10, 43, 98, .18); }
  .appbar .search-trigger { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .85); }
  .appbar .search-trigger:hover { border-color: rgba(255, 255, 255, .5); color: #fff; }
}

.tabbar { background: var(--brand-navy); border-top: 0; backdrop-filter: none; box-shadow: 0 -2px 12px rgba(10, 43, 98, .18); }
.tabbar a { color: var(--menu-muted); position: relative; }
.tabbar a.on { color: #fff; }
.tabbar a.on:not(.fab)::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand-cyan); }
.tabbar a.fab span.b { background: #fff; color: var(--brand-navy); border-color: var(--brand-navy); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }

/* Pantalla de acceso: logo grande como en la app del celular */
.login-wrap {
  background:
    radial-gradient(900px 500px at 100% 0%, rgba(25, 185, 209, .12), transparent 60%),
    radial-gradient(800px 600px at 0% 100%, rgba(13, 79, 163, .10), transparent 60%),
    var(--bg);
}
.login { border-top: 4px solid var(--brand-blue); }
.login .brand { flex-direction: column; text-align: center; gap: 6px; padding: 0; margin-bottom: 20px; }
.login .brand img { width: 108px; height: 108px; border-radius: 0; }
.login .brand span { align-items: center; }
.login .brand b { font-size: 26px; color: var(--primary-strong); letter-spacing: -.01em; }
.login .brand small { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.login h1 { text-align: center; }
.login p.muted { text-align: center; }
.cli-head img { border-radius: 0; }

/* Inicio: franja de bienvenida con la marca */
.top.hello {
  position: relative; overflow: hidden; padding: 20px 18px; border-radius: var(--radius); color: #fff;
  background: var(--menu-bg);
  box-shadow: 0 8px 24px rgba(10, 43, 98, .18);
}
.top.hello::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(420px 200px at 85% 50%, rgba(25, 185, 209, .35), transparent 70%);
}
.top.hello > * { position: relative; z-index: 1; }
.top.hello .sub { color: rgba(255, 255, 255, .82); }
.top.hello h1 em { color: #8FE3F0; }
.top.hello .icon-btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .24); color: #fff; }
.top.hello .icon-btn:hover { background: rgba(255, 255, 255, .24); }
@media (max-width: 520px) { .top.hello { flex-wrap: wrap; } .top.hello > .grow { flex-basis: 100%; } .top.hello h1 { font-size: 23px; } }
