/* Makena OS v2.0 · Liquid Glass sobre la noche Makena
   Noche #080A18 · Morado #4B30C6 · Morado luz #9D8FFF · Lima #CFE12F · Manrope
   Materiales: vidrio (paneles), vidrio claro (botones y píldoras), lente (lo activo).
   Todo pesa poco: un solo fondo fijo, desenfoque solo donde hay algo detrás que mostrar. */

@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #080A18;
  --text: #F5F4FF;
  --muted: rgba(232, 229, 255, 0.68);
  --muted-2: rgba(232, 229, 255, 0.5);
  --brand: #4B30C6;
  --brand-2: #6A4DF0;
  --brand-light: #A99CFF;
  --lime: #CFE12F;
  --lime-2: #DDEC5C;
  --danger: #FF8E85;
  --warn: #FFC870;

  /* vidrio */
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  --glass-solid: rgba(22, 24, 48, 0.72);
  --glass-strong: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  --glass-edge: rgba(255, 255, 255, 0.13);
  --glass-edge-2: rgba(255, 255, 255, 0.22);
  --hairline: rgba(255, 255, 255, 0.08);
  --well: rgba(4, 5, 16, 0.42);            /* campos y huecos: vidrio hundido */
  --shine: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  --lift: 0 18px 40px -22px rgba(2, 2, 14, 0.85), 0 2px 8px -4px rgba(2, 2, 14, 0.5);
  --blur: blur(26px) saturate(170%);
  --blur-soft: blur(16px) saturate(150%);

  /* radios concéntricos: panel 26 → fila 16 → píldora */
  --radius: 26px;
  --radius-sm: 16px;
  --radius-xs: 11px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  color: var(--text);
  background: var(--night);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}
/* El fondo es la luz que el vidrio refracta: morado Makena, violeta y un destello lima. Fijo, se pinta una vez. */
body::before {
  content: ""; position: fixed; inset: -10vh -10vw; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42vw 38vw at 12% 8%, rgba(75, 48, 198, 0.55), transparent 70%),
    radial-gradient(36vw 32vw at 92% 18%, rgba(157, 143, 255, 0.28), transparent 70%),
    radial-gradient(30vw 26vw at 78% 92%, rgba(207, 225, 47, 0.12), transparent 70%),
    radial-gradient(44vw 40vw at 30% 100%, rgba(52, 36, 160, 0.42), transparent 72%),
    linear-gradient(180deg, #0B0D22 0%, var(--night) 60%);
}
a { color: var(--brand-light); text-decoration: none; }
a:hover { color: var(--text); }
h1, h2, h3 { margin: 0; letter-spacing: -0.022em; line-height: 1.12; }
h1 { font-size: clamp(27px, 3.1vw, 38px); font-weight: 800; }
h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.012em; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 18px 0; }
small { font-size: 12.5px; }
::selection { background: rgba(169, 156, 255, 0.4); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 10px; }

/* ------------------------------------------------ material de vidrio */
.card, header, nav.tabbar, .weekwrap, .flash, .linkcard {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shine), var(--lift);
}

/* ------------------------------------------------ barra superior: cápsula flotante */
header {
  position: sticky; top: 12px; z-index: 30;
  display: flex; align-items: center; gap: 14px 22px;
  width: calc(100% - 28px); max-width: 1280px;
  margin: 12px auto 0;
  padding: 8px 10px 8px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(34, 33, 72, 0.7), rgba(16, 16, 40, 0.66));
  border-color: var(--glass-edge-2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.brand .logo { width: 22px; height: 22px; color: var(--text); }
.brand .word { font-weight: 800; letter-spacing: 0.17em; font-size: 14px; }
.brand .os {
  font-weight: 800; font-size: 10.5px; letter-spacing: 0.1em;
  color: #14160A; background: var(--lime);
  padding: 3px 7px; border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 18px -4px rgba(207, 225, 47, 0.6);
}
/* navegación como control segmentado; lo activo es una lente de vidrio más clara */
nav { display: flex; gap: 2px; flex: 1; }
nav.topnav {
  justify-content: center; flex-wrap: nowrap; min-width: 0;
  padding: 4px; border-radius: 17px; background: var(--well);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  flex: 0 1 auto; margin: 0 auto;
}
nav a {
  color: var(--muted); font-weight: 650; font-size: 13.5px; white-space: nowrap;
  padding: 7px 14px; border-radius: 13px;
  transition: color .18s, background .18s, box-shadow .18s;
}
nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
nav a.on {
  color: var(--text);
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 4px 14px -6px rgba(0, 0, 0, 0.7);
}
nav a .badge { margin-left: 5px; }
.spacepick { display: flex; align-items: center; gap: 6px; margin: 0; flex: none; }
.spacepick select { width: auto; min-height: 36px; padding: 6px 32px 6px 13px; font-size: 13px; font-weight: 700; border-radius: 13px; }
.spacepick button { min-height: 36px; }
.spacetag { font-size: 12px; font-weight: 750; color: #14160A; background: var(--lime); padding: 4px 11px; border-radius: 999px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spaceinput { width: 130px !important; min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.account { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; flex: none; }
.account .who { white-space: nowrap; }
form.inline { display: inline; margin: 0; }
.acclink { color: var(--muted); font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 12px; text-decoration: none; }
.acclink:hover, .acclink.on { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.hdrnew { display: none; }

/* ------------------------------------------------ estructura */
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 34px 28px 64px; flex: 1; display: flex; flex-direction: column; gap: 22px; }
footer { text-align: center; color: var(--muted-2); font-size: 12px; padding: 22px 22px 30px; }
.card {
  position: relative;
  border-radius: var(--radius);
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
a.card { color: var(--text); transition: border-color .18s, background .18s, transform .18s; }
a.card:hover { border-color: var(--glass-edge-2); background: var(--glass-strong); color: var(--text); }
.card.narrow { max-width: 760px; width: 100%; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
h2.section { margin-top: 10px; font-size: 19px; }
.muted { color: var(--muted-2); }
.pre { white-space: pre-wrap; color: var(--muted); }
.hint { color: var(--muted-2); font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; font-weight: 650; align-self: flex-start; padding: 6px 12px 6px 10px; margin-left: -10px; border-radius: 12px; }
.back:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.crumbs .back + .back { margin-left: 0; }
.flash {
  border-radius: var(--radius-sm); padding: 13px 18px; font-weight: 650;
  background: linear-gradient(180deg, rgba(169, 156, 255, 0.22), rgba(169, 156, 255, 0.1));
  border-color: rgba(169, 156, 255, 0.4);
}

/* ------------------------------------------------ intro de cada pantalla */
.intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 18px; }
.intro > div:first-child { display: flex; flex-direction: column; gap: 8px; max-width: 720px; min-width: 0; }
.intro p { color: var(--muted); font-size: 15.5px; max-width: 62ch; }
.intro .right { display: flex; align-items: center; gap: 10px; }
.intro p.meta { color: var(--muted); font-size: 14.5px; }
:not(.formgrid) > label + label, label + .actions, label + button, label + label.remember { margin-top: 12px; }
header:not(:has(.topnav)) { width: fit-content; padding-right: 18px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--brand-light); }

/* ------------------------------------------------ botones: vidrio con brillo */
button, .button {
  font: inherit; font-weight: 700; font-size: 14px; letter-spacing: -0.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 19px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px;
  color: #FFFFFF;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 6px rgba(20, 8, 90, 0.35), 0 8px 22px -10px rgba(75, 48, 198, 0.9);
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: filter .15s, transform .12s, background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
button:hover, .button:hover { filter: brightness(1.12); color: #FFFFFF; }
button:active, .button:active { transform: scale(0.97); }
button.secondary, .button.secondary {
  color: var(--text); border-color: var(--glass-edge);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 18px -12px rgba(0, 0, 0, 0.8);
}
button.secondary:hover, .button.secondary:hover { filter: none; background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)); border-color: var(--glass-edge-2); }
button.ghost, .button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
button.ghost:hover, .button.ghost:hover { filter: none; color: var(--danger); background: rgba(255, 142, 133, 0.1); }
button.small, .button.small { min-height: 34px; padding: 6px 14px; font-size: 13px; }
button[value="approve"], .login button {
  color: #15170A; border-color: rgba(255, 255, 255, 0.4);
  background: linear-gradient(180deg, var(--lime-2), var(--lime));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 6px rgba(90, 100, 0, 0.25), 0 8px 24px -10px rgba(207, 225, 47, 0.75);
}
button[value="approve"]:hover, .login button:hover { color: #15170A; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ------------------------------------------------ formularios: vidrio hundido */
label { display: flex; flex-direction: column; gap: 7px; font-weight: 700; font-size: 13px; color: var(--text); }
input, select, textarea {
  font: inherit; font-weight: 500; font-size: 15px; color: var(--text);
  background: var(--well);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  padding: 11px 14px; width: 100%; min-height: 46px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 100px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.18); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(169, 156, 255, 0.75); background: rgba(10, 10, 32, 0.6); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(169, 156, 255, 0.2); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
select option { background: #15173A; color: var(--text); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; box-shadow: none; accent-color: var(--lime); }
input[type=date] { color-scheme: dark; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.formgrid .wide, .formgrid > button { grid-column: 1 / -1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input { flex: 2 1 240px; width: auto; }
.toolbar select { flex: 1 1 170px; width: auto; }
/* píldoras de filtro y orden */
.filters, .sortbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters a, .sortbar a {
  color: var(--muted); font-size: 13px; font-weight: 650; padding: 7px 13px; border-radius: 999px; text-decoration: none;
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--hairline);
  transition: color .15s, background .15s, border-color .15s;
}
.filters a:hover, .sortbar a:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.filters a.on, .sortbar a.on {
  color: #15170A; border-color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, var(--lime-2), var(--lime));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 16px -8px rgba(207, 225, 47, 0.7);
}
.sortbar { margin: -8px 0 4px; font-size: 13px; }
.sortbar .sep { flex: 1; }

/* ------------------------------------------------ entrada */
.login { max-width: 440px; width: 100%; margin: 9vh auto 0; padding: 38px 34px; gap: 16px; text-align: left; }
.login-mark {
  width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--brand-2), var(--brand) 60%, #2B1A8C);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 30px -12px rgba(75, 48, 198, 0.9);
}
.login-mark .logo { width: 30px; height: 30px; color: #FFFFFF; }
.login h1 { font-size: 30px; }
.login p { color: var(--muted); }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.login form > * { margin-top: 0; }
.login button { min-height: 50px; font-size: 16px; margin-top: 4px; }

/* ------------------------------------------------ métricas y progreso */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { color: var(--text); gap: 2px; padding: 18px 20px; }
.metric strong { font-size: 38px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric.alert { border-color: rgba(255, 142, 133, 0.45); background: linear-gradient(180deg, rgba(255, 142, 133, 0.14), rgba(255, 142, 133, 0.04)); }
.metric.alert strong { color: var(--danger); }
/* el nivel es lo único con color sólido del resumen: vidrio teñido de morado Makena */
.metrics .metric:last-child {
  background: linear-gradient(160deg, rgba(106, 77, 240, 0.85), rgba(75, 48, 198, 0.78) 55%, rgba(43, 26, 140, 0.8));
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 18px 40px -18px rgba(75, 48, 198, 0.95);
}
.metrics .metric:last-child strong { color: var(--lime); text-shadow: 0 0 22px rgba(207, 225, 47, 0.35); }
.metrics .metric:last-child span { color: rgba(240, 236, 255, 0.86); }
.levelbar { gap: 12px; }
.levelbar > div:first-child { color: var(--muted); }
.levelbar b { color: var(--text); }
progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--well); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); }
progress::-webkit-progress-bar { background: var(--well); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #B9CC22, var(--lime-2)); border-radius: 999px; box-shadow: 0 0 12px rgba(207, 225, 47, 0.55); }
progress::-moz-progress-bar { background: var(--lime); border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: 12.5px; font-weight: 650; color: var(--muted); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hairline); padding: 5px 11px; border-radius: 999px; }
.chip.ok { color: var(--lime); border-color: rgba(207, 225, 47, 0.45); background: rgba(207, 225, 47, 0.08); }
.chip.warn { color: var(--warn); border-color: rgba(255, 200, 112, 0.45); background: rgba(255, 200, 112, 0.08); }

/* ------------------------------------------------ listas de actividades */
.list { padding: 8px; gap: 0; }
.taskline {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 14px; border-radius: var(--radius-sm); color: var(--text);
  position: relative;
  transition: background .15s;
}
.taskline + .taskline::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; border-top: 1px solid var(--hairline); }
.taskline:hover + .taskline::before, .taskline:hover::before { opacity: 0; }
.taskline > span:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.taskline b { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.taskline small { color: var(--muted-2); }
.taskline .right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.taskline .due { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.taskline.late::after { content: ""; position: absolute; left: 4px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--danger); box-shadow: 0 0 10px rgba(255, 142, 133, 0.6); }
.taskline.late .due { color: var(--danger); font-weight: 700; }
.latetext { color: var(--danger); }
.more { display: inline-flex; padding: 12px 14px 4px; font-weight: 700; font-size: 13.5px; }
.minilist { display: flex; flex-direction: column; margin: 0 -8px; }
.minilist .taskline { flex-direction: column; align-items: flex-start; gap: 8px; }
.minilist .taskline .right { flex-direction: row; align-items: center; gap: 10px; }
.minilist > a:not(.taskline) { padding: 8px; font-weight: 700; font-size: 13.5px; }
@media (hover: hover) {
  .taskline:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
}
.taskline:active { background: rgba(255, 255, 255, 0.1); }

/* estatus: píldoras de vidrio teñido */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 750; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--muted); white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.tag.big { font-size: 13px; padding: 7px 14px; }
.s-pendiente { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.s-enprogreso, .s-propuesta { background: rgba(169, 156, 255, 0.18); color: #D3CCFF; box-shadow: inset 0 0 0 1px rgba(169, 156, 255, 0.28); }
.s-enrevision { background: rgba(255, 200, 112, 0.15); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(255, 200, 112, 0.28); }
.s-cambiossolicitados { background: rgba(255, 142, 133, 0.15); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255, 142, 133, 0.28); }
.s-aprobada, .s-aceptada, .s-hecha { background: linear-gradient(180deg, var(--lime-2), var(--lime)); color: #15170A; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.s-cancelada, .s-archivada { background: transparent; color: var(--muted-2); box-shadow: inset 0 0 0 1px var(--hairline); }
.tag.src { background: transparent; box-shadow: inset 0 0 0 1px rgba(169, 156, 255, 0.5); color: var(--brand-light); font-size: 11px; padding: 2px 8px; }
.tag.prio-urgente { background: rgba(255, 142, 133, .15); color: var(--danger); }
.tag.prio-alta { background: rgba(255, 200, 112, .15); color: var(--warn); }

/* detalle */
.links { display: flex; flex-wrap: wrap; gap: 12px; }
.links:empty { display: none; }
.linkcard {
  display: flex; align-items: center; gap: 12px; flex: 1 1 300px; min-width: 0;
  padding: 14px 16px; border-radius: 20px; color: var(--text); font-size: 18px;
  transition: border-color .15s, background .15s;
}
.linkcard:hover { border-color: var(--glass-edge-2); background: var(--glass-strong); color: var(--text); }
.linkcard.primary { background: linear-gradient(160deg, rgba(106, 77, 240, 0.85), rgba(75, 48, 198, 0.8)); border-color: rgba(255, 255, 255, 0.24); }
.linkcard.primary small { color: rgba(240, 236, 255, 0.82); }
.linkcard span { display: flex; flex-direction: column; min-width: 0; }
.linkcard b { font-size: 14.5px; }
.linkcard small { color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history { display: block; padding: 12px 0; border-top: 1px solid var(--hairline); color: var(--muted); }
.history:first-of-type { border-top: 0; }
.history b { color: var(--text); }
.history small { display: block; color: var(--muted-2); margin-top: 2px; }
.history .tag { margin-left: 6px; }
.history p { margin-top: 4px; }
.history form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.quote { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--brand-light); border-radius: 4px 12px 12px 4px; background: rgba(169, 156, 255, 0.08); color: var(--text); }

/* ------------------------------------------------ resumen y equipo */
.feed { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 10px 0; border-top: 1px solid var(--hairline); color: var(--muted); }
.feed:first-of-type { border-top: 0; }
.feed b { color: var(--text); }
.feed small { margin-left: auto; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.mini { gap: 10px; padding: 18px; }
.who { display: flex; align-items: center; gap: 12px; }
.who h2 { font-size: 17px; }
.who small { display: block; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-weight: 800; font-size: 17px;
  background: linear-gradient(160deg, var(--brand-2), var(--brand) 60%, #2B1A8C);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 14px -6px rgba(75, 48, 198, 0.9);
}
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.agent .avatar { background: linear-gradient(160deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)); }
.nowline { display: flex; flex-direction: column; padding: 9px 12px; border-radius: 13px; color: var(--text); font-weight: 650; font-size: 14px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.nowline:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.nowline small { color: var(--muted-2); font-weight: 500; }
.twostat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.twostat > div { background: var(--well); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }
.twostat strong { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.twostat small { color: var(--muted-2); }

/* ------------------------------------------------ accesos */
.userrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.userrow:first-of-type { border-top: 0; }
.userrow b { margin-right: auto; }
.userrow form.inline { display: inline-flex; gap: 8px; align-items: center; }
.userrow select { width: auto; min-height: 36px; padding: 6px 36px 6px 12px; font-size: 13.5px; }
.userrow.inactive { opacity: 0.5; }

/* ------------------------------------------------ notas */
.note { padding: 14px 0; border-top: 1px solid var(--hairline); }
.note:first-of-type { border-top: 0; }
.noteopen { display: block; color: var(--text); text-decoration: none; }
.noteopen:hover p { color: var(--brand-light); }
.note .chips { margin: 6px 0; }
.note .chips .chip { text-decoration: none; }

/* ------------------------------------------------ bandeja Revisar */
.badge {
  display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px; border-radius: 999px;
  background: var(--lime); color: #15170A; font-size: 11px; font-weight: 800; text-align: center;
  box-shadow: 0 0 12px -2px rgba(207, 225, 47, 0.65);
}
.review { margin-bottom: 14px; }
.rhead { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.rtitle { flex: 1 1 260px; min-width: 0; }
.rtitle a { color: var(--text); text-decoration: none; font-size: 17px; font-weight: 750; }
.rtitle a:hover { color: var(--brand-light); }
.rtitle small { display: block; color: var(--muted); margin-top: 3px; }
.pick { display: flex; align-items: center; padding-top: 3px; margin: 0; }
.pick input { width: 20px; height: 20px; margin: 0; cursor: pointer; }
.review details { margin-top: 10px; color: var(--muted); }
.review summary { cursor: pointer; font-weight: 650; font-size: 13.5px; }
.ractions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.ractions input[name=note] { flex: 1 1 220px; margin: 0; }
.ractions .button { white-space: nowrap; }
#bulk { margin: 0; }

/* ------------------------------------------------ Personal y Tu día */
.psum { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text); text-decoration: none; padding: 16px 20px; }
.psum .chips { flex: 1; }
.psum .more { color: var(--brand-light); font-weight: 700; padding: 0; }
a.card.psum { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; }
a.card.psum .chips { justify-content: flex-start; }
.quickadd { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 12px; border-radius: 22px; }
.quickadd input, .quickadd select { margin: 0; }
.quickadd select { width: auto; }
.pgroup { padding: 18px 20px; }
.pgroup h2 { font-size: 15px; letter-spacing: .01em; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.pgroup .count { font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, 0.06); border-radius: 999px; padding: 1px 8px; }
.g-late h2 { color: var(--danger); }
.g-today h2 { color: var(--lime); }
.g-done { opacity: .8; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.prow:first-of-type { border-top: 0; }
.checkform { margin: 0; display: flex; }
button.check { width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--muted); background: rgba(255, 255, 255, 0.03); box-shadow: none; color: #15170A; font-size: 15px; font-weight: 900; line-height: 1; flex-shrink: 0; }
button.check:hover { filter: none; border-color: var(--lime); background: rgba(207, 225, 47, .15); }
button.check.on { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 12px -2px rgba(207, 225, 47, 0.7); }
.p-urgente button.check { border-color: var(--danger); }
.p-alta button.check { border-color: var(--warn); }
.ptitle { flex: 1; min-width: 0; color: var(--text); text-decoration: none; }
.ptitle b { display: block; font-weight: 650; }
.ptitle small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow.done .ptitle b { text-decoration: line-through; color: var(--muted); }
.pmeta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.pmeta small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.morelist { padding: 6px 20px; }
.morelist a { display: flex; justify-content: space-between; padding: 15px 0; border-top: 1px solid var(--hairline); color: var(--text); font-weight: 650; text-decoration: none; }
.morelist a:first-child { border-top: 0; }
.morelist a span { color: var(--muted); }
.spacepick.wide select { flex: 1; }
label.remember { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); cursor: pointer; }
label.remember input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
form label.remember { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 10px; margin: 4px 0 14px; }
form label.remember input { width: 20px; min-height: 0; height: 20px; padding: 0; margin: 0; }
.brief {
  padding: 18px 22px;
  background: linear-gradient(140deg, rgba(106, 77, 240, 0.32), rgba(255, 255, 255, 0.04) 58%);
  border-color: rgba(169, 156, 255, 0.32);
}
.briefhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.briefhead b { font-size: 18px; letter-spacing: -0.015em; }
.briefhead small { color: var(--muted); }
.bline { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--hairline); flex-wrap: wrap; }
.bline:first-of-type { border-top: 0; }
.blabel { min-width: 170px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.blabel b { color: var(--text); margin-left: 4px; }
.b-late .blabel, .b-late .blabel b { color: var(--danger); }
.b-today .blabel b, .b-win .blabel { color: var(--lime); }
.bitems { flex: 1; min-width: 0; font-size: 14px; }
.bitems a { color: var(--text); font-weight: 650; text-decoration: none; }
.bitems a:hover { color: var(--brand-light); }
.bitems small { color: var(--muted); }
.bitems i { color: var(--muted-2); font-style: normal; margin: 0 6px; }

/* ------------------------------------------------ recurrentes y semana */
.recrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--hairline); }
.recrow:first-of-type { border-top: 0; }
.recrow.paused { opacity: .6; }
.rectitle { flex: 1 1 220px; min-width: 0; }
.rectitle small { display: block; color: var(--muted); margin-top: 2px; }
.recnext { font-size: 13px; color: var(--muted); }
.recrow form.inline { display: flex; gap: 6px; margin: 0; }
.weeknav { display: flex; gap: 8px; flex-wrap: wrap; }
.weekwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table.week { width: 100%; min-width: 860px; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
table.week th, table.week td { border-bottom: 1px solid var(--hairline); border-left: 1px solid var(--hairline); padding: 8px; vertical-align: top; text-align: left; }
table.week thead th { color: var(--muted); font-weight: 700; font-size: 12.5px; background: rgba(255, 255, 255, 0.05); position: sticky; top: 0; }
table.week thead th small { display: block; font-weight: 500; color: var(--muted-2); }
table.week th.wperson { width: 130px; border-left: 0; font-weight: 700; color: var(--text); white-space: nowrap; }
table.week th.wperson .avatar { margin-right: 6px; vertical-align: middle; }
table.week th:last-child, table.week td.tot { width: 80px; }
table.week .today { background: rgba(207, 225, 47, .07); }
table.week thead th.today { color: var(--lime); }
table.week .weekend { background: rgba(0, 0, 0, .14); }
table.week tbody tr:last-child th, table.week tbody tr:last-child td { border-bottom: 0; }
.wchip { display: block; margin-bottom: 5px; padding: 5px 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); border-left: 3px solid rgba(255, 255, 255, 0.2); color: var(--text); font-weight: 650; font-size: 12px; line-height: 1.25; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wchip:hover { color: var(--text); background: rgba(255, 255, 255, 0.13); }
.wchip.p-urgente { border-left-color: var(--danger); }
.wchip.p-alta { border-left-color: var(--warn); }
.wchip.s-enrevision { background: rgba(169, 156, 255, .16); }
.wchip.s-cambiossolicitados { background: rgba(255, 200, 112, .13); }
.wchip.s-aprobada, .wchip.s-hecha { opacity: .45; text-decoration: line-through; }
.hrs { display: inline-block; font-size: 11px; color: var(--muted); font-weight: 700; }
.hrs.over { color: var(--danger); }
td.tot b { display: block; }
td.tot small { color: var(--muted); }

/* ------------------------------------------------ barra inferior (celular) */
nav.tabbar { display: none; }

/* ------------------------------------------------ responsivo */
@media (max-width: 1180px) {
  nav.topnav a { padding-left: 10px; padding-right: 10px; font-size: 13px; }
  header { gap: 12px 14px; }
}
@media (max-width: 1366px) { header .account .who { display: none; } }
@media (min-width: 721px) { .spacepick select { max-width: 170px; } }
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .formgrid { grid-template-columns: 1fr; }
  .taskline { flex-wrap: wrap; }
  .taskline .right { flex-direction: row; align-items: center; }
  .ractions > * { flex: 1 1 100%; }
}

/* Celular / iPhone: cápsula arriba con lo esencial y barra de pestañas flotante abajo */
@media (max-width: 720px) {
  body { font-size: 15px; }
  header {
    top: calc(8px + env(safe-area-inset-top));
    width: calc(100% - 20px); margin-top: calc(8px + env(safe-area-inset-top));
    padding: 7px 7px 7px 16px; border-radius: 22px; gap: 10px;
  }
  header .topnav, header .spacepick, header .account { display: none; }
  .hdrnew {
    display: inline-flex; margin-left: auto; width: 38px; height: 38px; border-radius: 50%;
    align-items: center; justify-content: center; color: #FFFFFF; font-size: 22px; font-weight: 600; line-height: 1;
    background: linear-gradient(180deg, var(--brand-2), var(--brand));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 16px -8px rgba(75, 48, 198, 0.95);
  }
  .hdrnew:hover { color: #FFFFFF; }
  .spacetag { margin-left: auto; }
  .spacetag + .hdrnew { margin-left: 0; }
  main { padding: 22px 16px calc(112px + env(safe-area-inset-bottom)); gap: 18px; }
  footer { display: none; }
  input, select, textarea { font-size: 16px; }
  button, .button { min-height: 44px; }
  button.check { width: 32px; height: 32px; min-height: 32px; }
  h1 { font-size: 28px; }
  /* la descripción de cada pantalla ya la conoce quien la usa a diario; en el celular se gana espacio */
  .intro { align-items: flex-end; gap: 12px; }
  .intro p:not(.meta) { display: none; }
  .intro > a.button[href="/tasks/new"] { display: none; }   /* vive como "+" en la cápsula de arriba */
  .intro .right .button { min-height: 38px; padding: 6px 14px; font-size: 13px; }
  .card { padding: 18px; border-radius: 24px; }
  .list { padding: 6px; }
  .metrics { gap: 10px; }
  .metric { padding: 14px 16px; border-radius: 22px; }
  .metric strong { font-size: 30px; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .toolbar input { grid-column: 1 / -1; }
  .toolbar select, .toolbar input { width: 100%; min-height: 44px; }
  .toolbar button { grid-column: 1 / -1; }
  .toolbar select:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }
  .filters, .sortbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 2px 16px; }
  .filters::-webkit-scrollbar, .sortbar::-webkit-scrollbar { display: none; }
  .filters a, .sortbar a, .sortbar span { flex-shrink: 0; }
  .sortbar .sep { flex: 0 0 4px; }
  .quickadd { grid-template-columns: 1fr 1fr; }
  .quickadd input[name=title] { grid-column: 1 / -1; }
  .quickadd button { grid-column: 1 / -1; }
  .pmeta .tag { display: none; }
  .psum { flex-direction: row; justify-content: space-between; flex-wrap: nowrap; }
  .psum .chips { flex-wrap: nowrap; overflow: hidden; }
  .blabel { min-width: 0; width: 100%; }
  .weeknav { width: 100%; }
  .login { margin-top: 4vh; padding: 28px 24px; }

  nav.tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; z-index: 40; gap: 2px; flex: none;
    left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 6px; border-radius: 30px;
    background: linear-gradient(180deg, rgba(40, 38, 82, 0.72), rgba(16, 16, 40, 0.8));
    -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
    border-color: var(--glass-edge-2);
    box-shadow: var(--shine), 0 20px 40px -14px rgba(0, 0, 0, 0.85);
  }
  nav.tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 54px; padding: 4px 2px; border-radius: 24px;
    color: var(--muted); font-size: 10.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
  }
  nav.tabbar a.on {
    color: var(--text);
    background: var(--glass-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  nav.tabbar a.on svg { stroke: var(--lime); filter: drop-shadow(0 0 6px rgba(207, 225, 47, 0.5)); }
  nav.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  nav.tabbar .badge { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; font-size: 10px; min-width: 18px; padding: 1px 5px; }
}
@media (display-mode: standalone) and (max-width: 720px) { header { margin-top: calc(6px + env(safe-area-inset-top)); } }

/* ------------------------------------------------ accesibilidad y respaldo */
/* Sin desenfoque disponible, o si la persona pidió menos transparencia: superficies sólidas, mismo diseño. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, header, nav.tabbar, .weekwrap, .flash, .linkcard { background: var(--glass-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  body::before { background: var(--night); }
  .card, header, nav.tabbar, .weekwrap, .flash, .linkcard { background: #171933; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: rgba(240, 238, 255, 0.86); --muted-2: rgba(240, 238, 255, 0.72); --glass-edge: rgba(255, 255, 255, 0.35); --hairline: rgba(255, 255, 255, 0.2); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } button:active, .button:active { transform: none; } }

/* v2.1.1 · asistentes agrupados por responsable en Equipo */
.agentgroup h3 { margin: 0 0 4px; font-size: 15px; }
.agentrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.agentgroup h3 + .agentrow { border-top: 0; }
.agentinfo { min-width: 0; }
.agentrow .button { flex: none; }

/* v2.2 · chat con los asistentes IA en su actividad */
.chat .msgs { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px 8px; margin: 10px 0 12px; }
.chat .msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; border: 1px solid var(--hairline); }
.chat .msg small { display: block; color: var(--muted-2); font-size: 11.5px; margin-bottom: 2px; }
.chat .msg p { margin: 0; }
.chat .msg.agent { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border-bottom-left-radius: 6px; }
.chat .msg.human { align-self: flex-end; background: rgba(169, 156, 255, 0.18); border-color: rgba(169, 156, 255, 0.35); border-bottom-right-radius: 6px; }
.chat .msg.typing p { color: var(--muted); font-style: italic; }
.chat .chatform textarea { width: 100%; resize: vertical; }
@media (prefers-reduced-motion: no-preference) { .chat .msg.typing p { animation: chatpulso 1.4s ease-in-out infinite; } }
@keyframes chatpulso { 50% { opacity: .45; } }

/* v2.2.1 · cancelar varias actividades */
.bulkbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 10px; }
.bulkbar input[name=note] { flex: 1 1 220px; }
.pickrow { display: flex; align-items: center; gap: 10px; }
.pickrow .taskline { flex: 1; min-width: 0; }
.bulkbar .pick { gap: 6px; white-space: nowrap; padding-top: 0; }

/* v2.3 · 👍/👎 a las entregas de los asistentes */
.rateform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.rateform input[name=porque] { flex: 1 1 200px; }
.rateform button { font-size: 18px; padding: 6px 14px; }

/* v2.4.2: número de actividad visible */
.meta .tid { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
small .tid { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }

/* v2.7: imágenes adjuntas en el chat de los asistentes y en 🎓 Entrenar */
img.adjunto { display: block; max-width: min(320px, 100%); max-height: 260px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--hairline); object-fit: contain; }
.chat .chatform .adjuntar { display: block; margin: 6px 0; font-size: .9em; }
.chat .chatform .adjuntar input[type=file] { display: block; margin-top: 4px; max-width: 100%; }

/* v2.7.1: Personal · marcar varias como hechas */
.pbulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.pbulk .pselbar { display: none; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.pbulk label.button { cursor: pointer; }
.pbulk .pselbar .pick { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font-weight: 650; color: var(--muted); padding: 0 6px; }
.ppick { display: none !important; padding: 0; margin: 0; }
.ppick input { width: 22px; height: 22px; margin: 0; cursor: pointer; }
#selmode:checked ~ .pbulk .pselon { display: none; }
#selmode:checked ~ .pbulk .pselbar { display: flex; }
#selmode:checked ~ .pgroup .ppick { display: flex !important; }
#selmode:checked ~ .pgroup:not(.g-done) .prow .checkform { display: none; }
#selmode:checked ~ .pbulk { position: sticky; top: 84px; z-index: 15; padding: 8px 10px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(34, 33, 72, 0.78), rgba(16, 16, 40, 0.74)); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 30px -16px rgba(0, 0, 0, 0.8); }
#selmode:focus-visible ~ .pbulk .pselon { outline: 2px solid var(--lime); outline-offset: 3px; }
@media (max-width: 720px) { #selmode:checked ~ .pbulk { top: calc(70px + env(safe-area-inset-top)); } .pbulk .pselbar button { flex: 1; } }

/* v2.8 · tablero de los asistentes */
.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.grid th { color: var(--muted); font-weight: 600; }
table.grid tr.warnrow td { background: rgba(255, 142, 133, 0.10); }

/* v2.9 · campos guiados del pedido a un asistente */
fieldset.guia { border: 1px solid var(--hairline); border-radius: 16px; padding: 12px 14px; margin: 4px 0; display: grid; gap: 10px; }
fieldset.guia legend { padding: 0 6px; font-weight: 700; }
fieldset.guia[hidden] { display: none; }
section.card.highlight { box-shadow: 0 0 0 2px rgba(207, 225, 47, 0.55); }   /* v2.10: la junta del lunes resalta ese día */

/* ------------------------------------------------ CRM (v2.11) */
.crmnav { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--hairline); align-self: flex-start; }
.crmnav a { color: var(--muted); font-weight: 700; font-size: 13.5px; padding: 9px 16px; border-radius: 999px; text-decoration: none; min-height: 20px; }
.crmnav a.on { color: var(--text); background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.crmquick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.crmquick input { width: 170px; }
.crmsplit { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.crmbar { display: flex; flex-direction: column; gap: 6px; }
.crmbar > div { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 650; color: var(--muted); }
.crmbar b { color: var(--text); font-variant-numeric: tabular-nums; }
progress.win::-webkit-progress-value { background: var(--lime); }
.crmbar progress:not(.win)::-webkit-progress-value { background: var(--brand-light); box-shadow: none; }
.crmbar progress:not(.win)::-moz-progress-bar { background: var(--brand-light); }
.crmgrid { display: grid; grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
main:has(.crmgrid), main:has(.crmboard) { max-width: 1440px; }
.crmlist { padding: 16px 10px; }
.crmsearch { margin: 0 6px; }
.crmlist .chips { padding: 0 6px; }
.taskline.sel { background: rgba(255, 255, 255, 0.09); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.crmthread { padding: 0; overflow: hidden; gap: 0; }
.crmhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--hairline); }
.crmhead > div { display: flex; flex-direction: column; gap: 2px; }
.crmhead small { color: var(--muted-2); }
.crmmsgs { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; min-height: 360px; max-height: 62vh; overflow-y: auto; }
.bubble { display: flex; flex-direction: column; gap: 4px; max-width: 78%; }
.bubble small { color: var(--muted-2); font-size: 12px; font-weight: 650; }
.bubble p { margin: 0; padding: 11px 15px; color: var(--text); font-size: 14.5px; line-height: 1.5; }
.bubble.in { align-self: flex-start; }
.bubble.in p { background: rgba(255, 255, 255, 0.07); border-radius: 16px 16px 16px 5px; }
.bubble.out { align-self: flex-end; align-items: flex-end; }
.bubble.out p { background: rgba(75, 48, 198, 0.62); border-radius: 16px 16px 5px 16px; }
.crmsend { display: flex; gap: 10px; align-items: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--hairline); margin: 0; }
.crmsend textarea { flex: 1; min-width: 0; resize: vertical; }
.crmcard form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.crmboard { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.crmcol { padding: 16px; gap: 8px; }
.crmcol h2 { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin: 0 0 4px; }
.nowline.late small { color: var(--danger); }
@media (max-width: 1100px) {
  .crmgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .crmcard { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .crmgrid, .crmsplit { grid-template-columns: minmax(0, 1fr); }
  .crmquick input { width: 100%; }
  .bubble { max-width: 92%; }
}
.crmwho { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crmwho form { display: flex; align-items: center; gap: 8px; margin: 0; }
.crmperfil { border-top: 1px solid var(--hairline); padding-top: 12px; }
.crmperfil h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 8px; }
.crmperfil dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.crmperfil dt { color: var(--muted-2); font-weight: 650; }
.crmperfil dd { margin: 0; color: var(--text); }
.crmdrop { display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 14px; transition: background .15s; }
.crmdrop.sobre { background: rgba(169, 156, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(169, 156, 255, 0.35); }
.crmtarjeta { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 13px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); cursor: grab; }
.crmtarjeta.moviendo { opacity: .45; }
.crmtarjeta > a { display: flex; flex-direction: column; color: var(--text); font-weight: 650; font-size: 14px; text-decoration: none; }
.crmtarjeta > a small { color: var(--muted-2); font-weight: 500; }
.crmtarjeta.late > a small { color: var(--danger); }
.crmmover { display: flex; gap: 6px; margin: 0; }
.crmmover select { flex: 1; min-width: 0; min-height: 32px; padding: 4px 8px; font-size: 12.5px; }

/* v0.5 · add-on Campañas */
.crmtabs { display: flex; gap: 6px; flex-wrap: wrap; align-self: flex-end; }
.crmtabs a { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); box-shadow: inset 0 0 0 1px var(--hairline); text-decoration: none; }
.crmtabs a.on { color: var(--text); background: rgba(169, 156, 255, 0.18); box-shadow: inset 0 0 0 1px rgba(169, 156, 255, 0.5); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; min-height: 0; }
table.grid td a { font-weight: 650; }

/* v0.7 · archivos y plantillas */
.crmimg { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 12px; margin: 6px 0; }
.bubble audio { width: min(300px, 100%); margin: 6px 0; display: block; }
.crmadjunto { margin-top: 8px; }
.crmadjunto input[type=file] { font-size: 13px; }
.crmplantilla { margin-top: 10px; border-top: 1px solid var(--hairline); padding-top: 8px; }
.crmplantilla summary { cursor: pointer; font-weight: 700; font-size: 14px; }

/* v0.8 · conocimiento */
.crmconoc { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.crmconoc.apagado { opacity: .5; }
.crmconoc .crmquick { margin-top: 4px; }

/* v0.9 · contactos y formularios */
.crmfiltros select, .crmfiltros input { width: auto; min-width: 140px; }
.crmfiltros input[name=q] { min-width: 220px; flex: 1; }
.crmlote { position: sticky; bottom: 70px; }
.crmcodigo { white-space: pre-wrap; font-size: 12px; background: rgba(0,0,0,.25); padding: 12px; border-radius: 10px; overflow-x: auto; }
section.card.apagado { opacity: .55; }
