:root {
  --ink: #17324d;
  --paper: #e7f4ff;
  --paper-light: #f7fbff;
  --line: #b8cfe0;
  --blue: #1769a4;
  --acid: #d7ff42;
  --muted: #557087;
  --danger: #a7382d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .18em; }

.auth-gate { min-height: 100vh; padding: 32px 5vw; background: #d9edfc; color: var(--ink); }
.auth-brand, .brand { display: flex; align-items: center; gap: 10px; width: fit-content; color: inherit; text-decoration: none; font-size: 14px; font-weight: 900; letter-spacing: .18em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1.5px solid currentColor; border-radius: 50%; letter-spacing: 0; }
.auth-grid { min-height: calc(100vh - 94px); display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 8vw; }
.auth-intro h1, .hero h1 { margin: 0; max-width: 820px; font-size: clamp(64px, 8.5vw, 130px); line-height: .77; letter-spacing: -.08em; font-weight: 800; }
.auth-intro h1 em, .hero h1 em { color: var(--blue); -webkit-text-stroke: 0; font-family: Georgia, serif; font-weight: 400; }
.auth-intro > p:last-child { max-width: 500px; margin: 48px 0 0; color: var(--muted); font-family: Georgia, serif; font-size: 18px; line-height: 1.5; }
.auth-card { min-height: 520px; display: grid; align-items: center; padding: clamp(30px, 5vw, 64px); background: var(--paper-light); color: var(--ink); box-shadow: 0 24px 70px rgba(23,50,77,.12); }
.auth-loading { display: flex; flex-direction: column; align-items: center; gap: 15px; color: var(--muted); font-family: Georgia, serif; font-style: italic; }
.loader { width: 26px; height: 26px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-form h2 { margin: 0; font-size: clamp(38px, 4vw, 54px); line-height: .95; letter-spacing: -.055em; }
.form-lead { margin: 16px 0 28px; color: var(--muted); font-family: Georgia, serif; line-height: 1.45; }
.auth-form label { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.auth-form label > span, .field > span, .endpoint-box > span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.auth-form input, .field input, .field select, .field textarea, .token-form input { width: 100%; border: 1px solid var(--line); border-radius: 0; padding: 13px 14px; background: transparent; color: var(--ink); transition: border-color .15s, background .15s; }
.auth-form input:focus, .field input:focus, .field select:focus, .field textarea:focus, .token-form input:focus { border-color: var(--ink); background: white; outline: 0; }
.security-warning { margin: 20px 0; border-left: 4px solid #d69c1f; padding: 12px 14px; background: #fff4d2; color: #6e4c00; font-size: 12px; line-height: 1.45; }
.form-error { margin: 14px 0 0; border-left: 3px solid var(--danger); padding: 9px 12px; color: var(--danger); font-size: 12px; }
.auth-notice { margin: 18px 0 0; border-left: 3px solid #52733f; padding: 10px 12px; background: #eaf4df; color: #29451f; font-size: 12px; line-height: 1.45; }
.captcha-box { margin: 2px 0 18px; border: 1px solid var(--line); padding: 12px; background: #f8f8f2; }
.captcha-box > div { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.captcha-box img { width: 210px; max-width: 65%; height: 56px; object-fit: cover; border: 1px solid var(--line); background: #eef2e5; transition: opacity .15s; }
.captcha-box img.loading { opacity: .35; }
.captcha-box label { margin: 0; }
.captcha-refresh { border: 0; padding: 8px 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; text-align: left; cursor: pointer; }

.topbar { height: 84px; padding: 0 5vw; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; align-self: stretch; gap: 34px; }
.topbar nav a, .topbar nav button { display: flex; align-items: center; position: relative; border: 0; padding: 0; background: transparent; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.topbar nav .active { color: var(--ink); }
.topbar nav .active::after { position: absolute; content: ""; height: 3px; left: 0; right: 0; bottom: -1px; background: var(--ink); }
.live-dot { width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 3px rgba(215,255,66,.3); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.user-name { margin-right: 5px; font-family: Georgia, serif; font-size: 13px; font-style: italic; }
.primary-button { border: 0; border-radius: 999px; padding: 13px 20px; background: var(--ink); color: white; font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .2s, background .2s; }
.primary-button:hover { background: #30443a; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .5; transform: none; }
.primary-button.wide { width: 100%; margin-top: 6px; }
.text-button { border: 0; padding: 11px 12px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }

.hero { min-height: 350px; padding: 70px 5vw 54px; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; border-bottom: 1px solid var(--line); }
.hero-note { max-width: 300px; display: flex; gap: 13px; align-items: flex-start; }
.hero-note p { margin: 0; font-family: Georgia, serif; font-size: 17px; line-height: 1.45; }
.pulse-dot { width: 11px; height: 11px; flex: 0 0 auto; margin-top: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 5px rgba(215,255,66,.3); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.metrics article { min-height: 180px; position: relative; padding: 28px 5vw 30px; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics article > span { position: absolute; top: 28px; right: 28px; font-size: 10px; color: var(--muted); }
.metrics strong { display: block; font-size: 76px; line-height: 1; letter-spacing: -.07em; }
.metrics strong b { font: inherit; }
.metrics strong small { font-size: 28px; }
.metrics p { margin: 14px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.metrics .accent-metric { background: var(--acid); }

.task-section { padding: 70px 5vw 100px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 32px; }
h2 { margin: 0; font-size: clamp(42px, 5vw, 70px); line-height: .9; letter-spacing: -.06em; }
.search-field { position: relative; width: min(320px, 100%); }
.search-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search-field input { width: 100%; border: 0; border-bottom: 1.5px solid var(--ink); padding: 11px 34px 11px 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-field::after { position: absolute; content: "↗"; right: 3px; bottom: 11px; font-size: 18px; transform: rotate(45deg); }
.search-field input:focus { outline: 0; border-color: var(--acid); }
.toolbar { min-height: 55px; display: flex; justify-content: space-between; gap: 25px; }
.toolbar > p { margin: 8px 0 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.filters { display: flex; gap: 6px; }
.filters button { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.filters button:hover { border-color: var(--ink); color: var(--ink); }
.filters button.selected { border-color: var(--ink); background: var(--ink); color: white; }
.filters b { margin-left: 6px; border-radius: 99px; padding: 2px 6px; background: var(--acid); color: var(--ink); }
.error-banner { display: flex; justify-content: space-between; margin-bottom: 16px; border: 1px solid var(--danger); padding: 12px 15px; color: var(--danger); font-size: 12px; }
.task-table { border-top: 1.5px solid var(--ink); }
.task-row { min-height: 116px; display: grid; grid-template-columns: minmax(270px, 2.2fr) .8fr 1fr 1.12fr .9fr .7fr; align-items: center; column-gap: clamp(14px, 2vw, 28px); border-bottom: 1px solid var(--line); }
.table-head { min-height: 47px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.task-title { min-width: 0; display: flex; align-items: flex-start; gap: 18px; padding-block: 20px; }
.task-title > div { min-width: 0; }
.task-title strong { display: block; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.task-title small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.task-title p { margin: 8px 0 0; overflow: hidden; color: var(--muted); font-family: Georgia, serif; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.task-index { flex: 0 0 auto; padding-top: 1px; color: var(--muted); font-family: Georgia, serif; font-style: italic; }
.status { width: fit-content; padding: 7px 11px; border: 1px solid var(--ink); border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-completada { background: var(--ink); color: white; }
.status-pendiente { border-color: var(--line); color: var(--muted); }
.status-bloqueada { border-color: var(--danger); color: var(--danger); }
.progress-cell { display: flex; align-items: center; gap: 12px; }
.progress-track, .time-track { width: min(105px, 66%); height: 6px; overflow: hidden; background: #d8d6cc; }
.progress-track i, .time-track i { display: block; height: 100%; background: var(--ink); }
.progress-cell b, .time-cell b { font-size: 11px; }
.time-cell { display: flex; flex-direction: column; gap: 7px; }
.time-cell > div { display: flex; align-items: center; gap: 10px; }
.time-track i { background: var(--muted); }
.time-cell small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.time-cell.behind small { color: var(--danger); }
.due-cell { display: flex; flex-direction: column; gap: 6px; }
.due-cell time { font-family: Georgia, serif; font-size: 15px; font-style: italic; text-transform: uppercase; }
.due-cell time.overdue { color: var(--danger); }
.due-cell small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.row-actions { justify-self: end; display: flex; gap: 7px; }
.row-actions button { border: 1px solid var(--line); padding: 7px 10px; background: transparent; font-size: 9px; font-weight: 900; text-transform: uppercase; cursor: pointer; }
.row-actions button:hover { border-color: var(--ink); }
.row-actions .delete-button { width: 30px; height: 30px; padding: 0; border-radius: 50%; color: var(--danger); font-size: 16px; }
.state-panel, .empty-state { min-height: 270px; display: flex; align-items: center; justify-content: center; gap: 20px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; }
.empty-state { flex-direction: column; }
.empty-state strong { color: var(--line); font-family: Georgia, serif; font-size: 72px; font-style: italic; line-height: 1; }
.empty-state h3 { margin: 0; color: var(--ink); font-size: 22px; }
.empty-state p { max-width: 470px; margin: 0; font-family: Georgia, serif; line-height: 1.5; }
.outline-button { border: 1px solid var(--ink); border-radius: 999px; padding: 11px 16px; background: transparent; font-size: 11px; font-weight: 900; cursor: pointer; }

dialog { border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(24,37,30,.74); backdrop-filter: blur(8px); }
.dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--paper-light); color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.24); }
.dialog[open] { animation: rise-in .22s ease-out; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; padding: 32px 36px 26px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 45px; }
.dialog-header .eyebrow { margin-bottom: 10px; }
.close-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; padding: 0; background: transparent; font-size: 24px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 30px 36px 34px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-full { grid-column: 1 / -1; }
.field textarea { resize: vertical; line-height: 1.45; }
.progress-input > div { position: relative; }
.progress-input input { padding-right: 45px; }
.progress-input b { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); }
.dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 22px 36px; border-top: 1px solid var(--line); }
.dialog-footer > p { max-width: 240px; margin: 0; color: var(--muted); font-family: Georgia, serif; font-size: 12px; font-style: italic; }
.dialog-footer > div { display: flex; gap: 8px; }

.mcp-dialog { width: min(820px, calc(100% - 32px)); }
.mcp-content { padding: 32px 36px 40px; }
.mcp-intro { position: relative; margin-bottom: 30px; padding: 30px; background: var(--ink); color: white; }
.mcp-intro h3 { max-width: 560px; margin: 22px 0 10px; font-size: 28px; letter-spacing: -.04em; }
.mcp-intro p { max-width: 620px; margin: 0; color: #bdc5c0; font-family: Georgia, serif; line-height: 1.45; }
.mcp-badge { display: inline-flex; align-items: center; gap: 9px; border: 1px solid #526058; border-radius: 999px; padding: 7px 11px; color: var(--paper); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.mcp-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 3px rgba(215,255,66,.2); }
.endpoint-box { display: flex; flex-direction: column; gap: 9px; }
.endpoint-box > div, .token-reveal > div { display: flex; align-items: center; border: 1px solid var(--line); background: white; }
.endpoint-box code, .token-reveal code { min-width: 0; flex: 1; overflow: auto; padding: 14px; color: var(--ink); white-space: nowrap; }
.endpoint-box button, .token-reveal button { align-self: stretch; border: 0; border-left: 1px solid var(--line); padding: 0 15px; background: transparent; font-size: 10px; font-weight: 900; cursor: pointer; }
.token-section { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--line); }
.token-section h3 { margin: 0; font-size: 24px; }
.token-section .eyebrow { margin-bottom: 8px; }
.token-form { display: flex; gap: 8px; }
.token-form input { min-width: 240px; }
.token-reveal { margin-top: 20px; border: 1px solid var(--acid); padding: 16px; background: rgba(215,255,66,.13); }
.token-reveal p { margin: 0 0 10px; font-size: 12px; }
.token-list { margin-top: 16px; }
.token-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.token-row strong { display: block; font-size: 13px; }
.token-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.token-row code { color: var(--muted); font-size: 11px; }
.token-row button { border: 0; background: transparent; color: var(--danger); font-size: 10px; font-weight: 900; text-transform: uppercase; cursor: pointer; }
.token-empty { padding: 20px 0; color: var(--muted); font-family: Georgia, serif; font-style: italic; }
.prompt-examples { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.prompt-examples button { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 12px 0; background: transparent; color: var(--muted); text-align: left; font-family: Georgia, serif; font-style: italic; cursor: default; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translateX(-50%); border: 1px solid var(--acid); border-radius: 999px; padding: 11px 18px; background: var(--ink); color: white; box-shadow: 0 12px 40px rgba(0,0,0,.18); font-size: 12px; font-weight: 800; }

@media (max-width: 1080px) {
  .auth-grid { grid-template-columns: 1fr 1fr; gap: 4vw; }
  .task-row { grid-template-columns: minmax(240px, 2fr) .8fr 1fr 1fr .8fr; }
  .table-head > span:nth-child(4), .time-cell { display: none; }
}

@media (max-width: 820px) {
  .auth-gate { padding: 24px; }
  .auth-grid { display: block; padding-top: 60px; }
  .auth-intro { margin-bottom: 55px; }
  .auth-intro h1 { font-size: 68px; }
  .auth-intro > p:last-child { margin-top: 35px; }
  .auth-card { min-height: 0; padding: 32px 24px; }
  .topbar { grid-template-columns: 1fr 1fr; }
  .topbar nav, .user-name, #logoutButton { display: none; }
  .hero { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr; }
  .metrics article { min-height: 135px; border-right: 0; border-bottom: 1px solid var(--line); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .search-field { width: 100%; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; overflow-x: auto; padding-bottom: 5px; }
  .filters button { flex: 0 0 auto; }
  .toolbar > p { display: none; }
  .table-head { display: none; }
  .task-row { position: relative; grid-template-columns: 1fr auto; gap: 19px 25px; padding: 25px 0; }
  .task-title { grid-column: 1 / -1; padding: 0 70px 0 0; }
  .task-title p { white-space: normal; }
  .status, .progress-cell, .due-cell { grid-column: 1; }
  .time-cell { grid-column: 2; grid-row: 2 / span 2; display: flex; min-width: 112px; }
  .row-actions { position: absolute; right: 0; top: 24px; }
  .token-section { align-items: stretch; flex-direction: column; }
  .token-form input { min-width: 0; }
}

@media (max-width: 560px) {
  .auth-intro h1, .hero h1 { font-size: 62px; }
  .topbar { height: 72px; padding-inline: 20px; }
  .header-actions .primary-button { padding: 11px 14px; }
  .hero { min-height: 355px; padding: 58px 20px 42px; }
  .metrics article, .task-section { padding-inline: 20px; }
  .task-section { padding-top: 55px; }
  .task-row { grid-template-columns: 1fr; }
  .task-title { padding-right: 65px; }
  .status, .progress-cell, .time-cell, .due-cell { grid-column: 1; }
  .time-cell { grid-row: auto; }
  .dialog { width: 100%; max-height: 94vh; margin: auto 0 0; }
  .dialog-header { padding: 25px 20px 20px; }
  .dialog-header h2 { font-size: 38px; }
  .form-grid { grid-template-columns: 1fr; padding: 25px 20px; }
  .field-full { grid-column: 1; }
  .dialog-footer { align-items: stretch; flex-direction: column; padding: 20px; }
  .dialog-footer > div { justify-content: flex-end; }
  .mcp-content { padding: 24px 20px 32px; }
  .mcp-intro { padding: 24px 20px; }
  .token-form { flex-direction: column; }
  .token-row { grid-template-columns: 1fr auto; }
  .token-row code { grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Pulso 2: equipo, partes de trabajo y control de horas */
.metrics { grid-template-columns: repeat(4, 1fr); }
.metrics article { padding-inline: 3.2vw; }
.task-section { padding-bottom: 70px; }
.team-section { padding: 70px 5vw 110px; border-top: 1px solid var(--line); background: var(--paper-light); }
.task-row { grid-template-columns: minmax(260px, 2fr) minmax(100px, .85fr) .72fr .85fr .82fr .82fr minmax(170px, auto); column-gap: clamp(10px, 1.5vw, 24px); }
.task-row.is-blocked { box-shadow: inset 4px 0 0 var(--danger); }
.task-title .blocked-copy { color: var(--danger); font-style: italic; }
.status { appearance: none; background: transparent; cursor: pointer; }
.status:hover { background: white; }
.status-en_curso { background: rgba(215,255,66,.28); }
.people-cell { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.people-cell small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.unassigned { color: var(--muted); font-family: Georgia, serif; font-size: 12px; font-style: italic; }
.avatar-stack { display: flex; padding-left: 7px; }
.avatar-stack span, .mini-avatar { width: 30px; height: 30px; display: grid; flex: 0 0 auto; place-items: center; margin-left: -7px; border: 2px solid var(--paper); border-radius: 50%; background: var(--ink); color: white; font-size: 9px; font-weight: 900; }
.hours-cell { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hours-cell > div { display: flex; flex-direction: column; gap: 3px; }
.hours-cell strong { font-size: 13px; }
.hours-cell small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.hours-cell.over-hours strong, .hours-cell.over-hours small { color: var(--danger); }
.hours-track { width: 100%; height: 4px; overflow: hidden; background: #d8d6cc; }
.hours-track i { display: block; height: 100%; background: var(--ink); }
.hours-cell.over-hours .hours-track i { background: var(--danger); }
.row-actions { flex-wrap: wrap; justify-content: flex-end; }
.row-actions .work-button { border-color: var(--ink); background: var(--ink); color: white; }

.employee-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1.5px solid var(--ink); border-left: 1px solid var(--line); }
.employee-card { min-height: 310px; display: flex; flex-direction: column; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.employee-card.is-inactive { opacity: .58; }
.employee-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.employee-avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-family: Georgia, serif; font-size: 18px; font-style: italic; }
.employee-state { border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px; color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.employee-card h3 { margin: 28px 0 6px; font-size: 20px; letter-spacing: -.03em; }
.employee-card > p { min-height: 18px; margin: 0 0 14px; color: var(--muted); font-family: Georgia, serif; font-style: italic; }
.employee-card > a, .muted-email { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.muted-email { color: var(--muted); }
.employee-stats { display: flex; gap: 22px; margin-top: auto; padding-top: 28px; }
.employee-stats span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.employee-stats b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 20px; }
.employee-actions { display: flex; gap: 7px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.employee-actions button { border: 0; padding: 5px 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; cursor: pointer; }
.employee-actions button + button { margin-left: auto; color: var(--danger); }
.team-empty { grid-column: 1 / -1; min-height: 250px; display: grid; place-items: center; align-content: center; gap: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.team-empty strong { font-size: 24px; }
.team-empty p { margin: 0 0 10px; color: var(--muted); font-family: Georgia, serif; }

.task-dialog { width: min(800px, calc(100% - 32px)); }
.employee-picker { min-width: 0; margin: 0; border: 1px solid var(--line); padding: 16px; }
.employee-picker legend { padding: 0 8px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
#taskEmployeeOptions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.employee-option { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; border: 1px solid transparent; padding: 9px; cursor: pointer; }
.employee-option:hover { border-color: var(--line); background: white; }
.employee-option > input { width: 16px; height: 16px; accent-color: var(--ink); }
.employee-option .mini-avatar { margin: 0; border: 0; }
.employee-option b, .employee-option small { display: block; }
.employee-option b { font-size: 12px; }
.employee-option small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.field-hint { margin: 4px 0 0; color: var(--muted); font-family: Georgia, serif; font-size: 12px; font-style: italic; }
.toggle-field { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); padding: 14px; cursor: pointer; }
.toggle-field input { width: 18px; height: 18px; accent-color: var(--ink); }
.toggle-field b, .toggle-field small { display: block; }
.toggle-field b { font-size: 12px; }
.toggle-field small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }

.work-dialog { width: min(980px, calc(100% - 32px)); }
.work-layout { display: grid; grid-template-columns: .82fr 1.18fr; min-height: 520px; }
.work-form { display: flex; flex-direction: column; gap: 18px; padding: 28px 32px 34px; border-right: 1px solid var(--line); }
.work-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.work-history { min-width: 0; padding: 28px 32px 34px; background: var(--paper); }
.history-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; border-bottom: 1.5px solid var(--ink); padding-bottom: 12px; }
.history-heading span { font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.history-heading strong { font-family: Georgia, serif; font-size: 20px; font-style: italic; }
.work-log { padding: 16px 0; border-bottom: 1px solid var(--line); }
.work-log-head { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; }
.work-log-head .mini-avatar { margin: 0; border: 0; }
.work-log-head strong, .work-log-head small { display: block; }
.work-log-head strong { font-size: 12px; }
.work-log-head small { margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.work-log-head > b { font-size: 13px; }
.work-log-head button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--danger); font-size: 18px; cursor: pointer; }
.work-log p { margin: 11px 0 0 40px; color: var(--muted); font-family: Georgia, serif; font-size: 13px; line-height: 1.45; }
.history-empty { padding: 34px 10px; color: var(--muted); font-family: Georgia, serif; font-style: italic; text-align: center; }
.history-empty.error { color: var(--danger); }

.config-box { margin-top: 24px; border: 1px solid var(--line); background: var(--ink); color: white; }
.config-box > div { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #435047; padding: 10px 14px; color: #bdc5c0; font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.config-box button { border: 0; background: transparent; color: var(--acid); font-size: 9px; font-weight: 900; text-transform: uppercase; cursor: pointer; }
.config-box pre { margin: 0; overflow-x: auto; padding: 16px; color: var(--paper); font-size: 11px; line-height: 1.6; white-space: pre; }

@media (max-width: 1280px) {
  .task-row { grid-template-columns: minmax(240px, 2fr) .8fr .7fr .82fr .78fr .78fr minmax(110px, auto); }
  .row-actions .work-button { width: 100%; }
  .employee-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article { border-bottom: 1px solid var(--line); }
  .task-row { grid-template-columns: minmax(240px, 2fr) .8fr .75fr .8fr .8fr minmax(100px, auto); }
  .table-head > span:nth-child(4) { display: block; }
  .table-head > span:nth-child(5), .hours-cell { display: none; }
  .employee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .topbar nav { gap: 20px; }
  .task-row { grid-template-columns: 1fr auto; }
  .task-title { grid-column: 1 / -1; }
  .people-cell, .status, .progress-cell, .hours-cell, .due-cell { grid-column: 1; }
  .hours-cell { display: flex; }
  .row-actions { grid-column: 2; grid-row: 2 / span 4; align-self: start; flex-direction: column; }
  .row-actions .work-button { width: auto; }
  .work-layout { grid-template-columns: 1fr; }
  .work-form { border-right: 0; border-bottom: 1px solid var(--line); }
  #taskEmployeeOptions { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
  .metrics article { border-right: 0; }
  .team-section { padding-inline: 20px; }
  .employee-grid { grid-template-columns: 1fr; }
  .work-dialog { width: 100%; max-height: 94vh; margin: auto 0 0; }
  .work-form, .work-history { padding-inline: 20px; }
  .work-form-row { grid-template-columns: 1fr; }
  .row-actions { position: static; grid-column: 1; grid-row: auto; flex-direction: row; justify-self: stretch; justify-content: flex-start; }
}

/* Pulso 3: cabecera compacta, vista densa y línea de actividad */
.topbar { height: 64px; }
.topbar .brand-mark { width: 28px; height: 28px; }
.hero { min-height: 0; padding: 25px 5vw 23px; align-items: center; }
.hero .eyebrow { margin-bottom: 8px; }
.hero h1 { max-width: none; font-size: clamp(38px, 4vw, 64px); line-height: .92; letter-spacing: -.065em; white-space: nowrap; }
.hero-note { max-width: 260px; align-items: center; }
.hero-note p { font-size: 13px; line-height: 1.35; }
.hero-note .pulse-dot { margin-top: 0; }
.metrics article { min-height: 92px; padding: 15px 3.2vw 14px; }
.metrics article > span { top: 15px; right: 18px; font-size: 8px; }
.metrics strong { font-size: 42px; }
.metrics strong small { font-size: 18px; }
.metrics p { margin-top: 5px; font-size: 9px; }
.task-section { padding: 30px 5vw 60px; }
.section-heading { margin-bottom: 17px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { font-size: clamp(42px, 4vw, 58px); }
.toolbar { min-height: 48px; align-items: flex-start; }
.toolbar-meta { display: flex; align-items: center; gap: 18px; }
.toolbar-meta > p { margin: 9px 0 0; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.sort-field { display: flex; align-items: center; gap: 8px; }
.sort-field span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.sort-field select { border: 0; border-bottom: 1px solid var(--line); padding: 7px 24px 7px 4px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; }
.task-row { min-height: 92px; grid-template-columns: minmax(260px, 2fr) minmax(100px, .85fr) .72fr .85fr .82fr .82fr minmax(210px, auto); }
.table-head { min-height: 38px; }
.task-title { padding-block: 13px; }
.row-actions { gap: 5px; }
.row-actions button { padding: 6px 8px; }

.status-history-dialog { width: min(780px, calc(100% - 32px)); }
.status-history-summary { display: flex; align-items: center; gap: 18px; padding: 18px 36px; border-bottom: 1px solid var(--line); background: var(--paper); }
.status-history-summary .status { flex: 0 0 auto; }
.status-history-summary p { margin: 0; color: var(--muted); font-family: Georgia, serif; font-size: 13px; line-height: 1.4; }
.status-history-list { padding: 10px 36px 34px; }
.status-history-entry { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 14px; padding: 20px 0 0; }
.status-history-entry::before { position: absolute; content: ""; width: 1px; left: 8px; top: 32px; bottom: -20px; background: var(--line); }
.status-history-entry:last-child::before { display: none; }
.history-marker { position: relative; z-index: 1; width: 17px; height: 17px; margin-top: 1px; border: 4px solid var(--paper-light); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.event-bloqueo .history-marker { background: var(--danger); }
.event-desbloqueo .history-marker { background: var(--acid); }
.history-entry-body { min-width: 0; border-bottom: 1px solid var(--line); padding: 0 0 18px; }
.status-history-entry:last-child .history-entry-body { border-bottom: 0; }
.history-entry-head { display: flex; justify-content: space-between; gap: 20px; }
.history-entry-head strong { font-size: 13px; }
.history-entry-head time { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.history-entry-body > p { margin: 9px 0 11px; color: var(--ink); font-family: Georgia, serif; font-size: 14px; line-height: 1.45; }
.history-entry-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.history-entry-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.history-entry-meta .history-duration { border-color: var(--acid); background: rgba(215,255,66,.22); color: var(--ink); }

@media (max-width: 1280px) {
  .task-row { grid-template-columns: minmax(240px, 2fr) .75fr .68fr .75fr .74fr .78fr minmax(135px, auto); }
  .row-actions .work-button { width: auto; }
}

@media (max-width: 820px) {
  .hero { min-height: 0; padding: 24px 5vw 22px; flex-direction: row; align-items: center; }
  .hero h1 { white-space: normal; }
  .hero-note { display: none; }
  .metrics article { min-height: 82px; }
  .task-section { padding-top: 26px; }
  .toolbar-meta { width: 100%; justify-content: space-between; }
  .toolbar-meta > p { display: block; }
  .status-history-summary, .status-history-list { padding-inline: 22px; }
}

@media (max-width: 560px) {
  .topbar { height: 64px; }
  .hero { padding: 22px 20px 20px; }
  .hero h1 { font-size: 42px; }
  .metrics article { min-height: 74px; padding: 11px 20px; }
  .metrics article > span { top: 11px; }
  .metrics strong { font-size: 34px; }
  .task-section { padding-top: 22px; }
  .toolbar-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  .history-entry-head { flex-direction: column; gap: 5px; }
}
