/* Pendiente — sistema de diseño */
:root{
  --bg:#f6f7fb; --surface:#ffffff; --surface-2:#f0f2f8; --border:#e3e6ef;
  --text:#14172b; --muted:#5d6380; --brand:#4f46e5; --brand-2:#7c3aed; --brand-soft:#eef0ff;
  --ok:#0f9d6b; --warn:#d97706; --bad:#dc2626; --info:#0284c7;
  --shadow:0 1px 2px rgba(20,23,43,.06),0 8px 24px rgba(20,23,43,.06);
  --radius:14px; --radius-sm:10px;
  --font:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#0d0f1a; --surface:#151829; --surface-2:#1c2036; --border:#2a2f4a;
  --text:#eceefb; --muted:#9aa0c0; --brand:#818cf8; --brand-2:#a78bfa; --brand-soft:#23264a;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.3);
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:var(--font);background:var(--bg);color:var(--text);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:var(--brand);text-decoration:none}
h1,h2,h3,h4{line-height:1.2;margin:0 0 .5em;letter-spacing:-.01em}
button,input,select,textarea{font:inherit;color:inherit}
.btn{display:inline-flex;align-items:center;gap:.5em;border:1px solid var(--border);background:var(--surface);padding:.55em 1em;border-radius:var(--radius-sm);cursor:pointer;font-weight:500;transition:.15s}
.btn:hover{border-color:var(--brand)}
.btn.primary{background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;border:0}
.btn.primary:hover{filter:brightness(1.08)}
.btn.ghost{background:transparent;border-color:transparent}
.btn.ghost:hover{background:var(--surface-2)}
.btn.sm{padding:.35em .7em;font-size:.85em}
.btn:disabled{opacity:.45;cursor:not-allowed}
.input,select.input,textarea.input{width:100%;border:1px solid var(--border);background:var(--surface);padding:.55em .8em;border-radius:var(--radius-sm);outline:none}
.input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px}
.muted{color:var(--muted)}
.badge{display:inline-flex;align-items:center;gap:.35em;padding:.15em .6em;border-radius:99px;font-size:.78em;font-weight:600;background:var(--surface-2);color:var(--muted)}
.badge.ok{background:color-mix(in srgb,var(--ok) 15%,transparent);color:var(--ok)}
.badge.warn{background:color-mix(in srgb,var(--warn) 15%,transparent);color:var(--warn)}
.badge.bad{background:color-mix(in srgb,var(--bad) 15%,transparent);color:var(--bad)}
.badge.info{background:color-mix(in srgb,var(--info) 15%,transparent);color:var(--info)}
.badge.brand{background:var(--brand-soft);color:var(--brand)}
.grid{display:grid;gap:16px}
.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.spacer{flex:1}
.logo{display:flex;align-items:center;gap:10px;font-weight:800;font-size:1.15rem;letter-spacing:-.02em;color:var(--text)}
.logo-mark{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,var(--brand),var(--brand-2));display:grid;place-items:center;color:#fff}

/* ---------- Landing ---------- */
.lp-nav{position:sticky;top:0;z-index:20;backdrop-filter:saturate(1.6) blur(12px);background:color-mix(in srgb,var(--bg) 80%,transparent);border-bottom:1px solid var(--border)}
.lp-nav .wrap{display:flex;align-items:center;gap:24px;height:64px}
.lp-nav nav a{color:var(--muted);font-weight:500;margin-right:18px}
.lp-nav nav a:hover{color:var(--text)}
.wrap{max-width:1180px;margin:0 auto;padding:0 20px}
.hero{padding:88px 0 56px;text-align:center;position:relative;overflow:hidden}
.hero::before{content:"";position:absolute;inset:-40% -10% auto;height:620px;background:radial-gradient(closest-side,color-mix(in srgb,var(--brand) 22%,transparent),transparent),radial-gradient(closest-side at 70% 40%,color-mix(in srgb,var(--brand-2) 18%,transparent),transparent);z-index:-1}
.hero h1{font-size:clamp(2.2rem,5.5vw,4rem);font-weight:800;letter-spacing:-.035em;max-width:900px;margin:18px auto}
.hero h1 span{background:linear-gradient(135deg,var(--brand),var(--brand-2));-webkit-background-clip:text;background-clip:text;color:transparent}
.hero p{font-size:1.15rem;color:var(--muted);max-width:680px;margin:0 auto 28px}
.hero .row{justify-content:center}
.hero-shot{margin:56px auto 0;max-width:1040px;border-radius:18px;border:1px solid var(--border);background:var(--surface);box-shadow:0 30px 80px -20px rgba(79,70,229,.35);padding:14px;text-align:left}
.shot-bar{display:flex;gap:6px;margin-bottom:12px}.shot-bar i{width:10px;height:10px;border-radius:50%;background:var(--border)}
.shot-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.shot-kpi{background:var(--surface-2);border-radius:12px;padding:14px}.shot-kpi b{font-size:1.5rem;display:block}
.shot-cols{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px}
.shot-col{background:var(--surface-2);border-radius:12px;padding:10px;min-height:150px}
.shot-card{background:var(--surface);border:1px solid var(--border);border-radius:9px;padding:8px 10px;margin-top:8px;font-size:.85em}
.section{padding:72px 0}
.section h2{font-size:clamp(1.6rem,3.5vw,2.4rem);text-align:center;letter-spacing:-.025em}
.section .lead{text-align:center;color:var(--muted);max-width:640px;margin:0 auto 40px}
.features{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.feature .ico{width:44px;height:44px;border-radius:12px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;margin-bottom:14px}
.roles{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.role-card ul{padding-left:18px;margin:10px 0 0;color:var(--muted)}
.tech{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
.tech span{border:1px solid var(--border);background:var(--surface);padding:.45em .9em;border-radius:99px;font-weight:500}
.cta{background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;border-radius:24px;padding:56px 24px;text-align:center}
.cta p{opacity:.9}
.cta .btn{background:#fff;color:var(--brand);border:0}
footer.lp{border-top:1px solid var(--border);padding:28px 0;color:var(--muted);font-size:.9em}
@media (max-width:760px){.lp-nav nav{display:none}.shot-grid{grid-template-columns:repeat(2,1fr)}.shot-cols{grid-template-columns:1fr}}

/* ---------- App shell ---------- */
.app{display:grid;grid-template-columns:248px 1fr;min-height:100vh}
.sidebar{background:var(--surface);border-right:1px solid var(--border);padding:18px 14px;display:flex;flex-direction:column;gap:6px;position:sticky;top:0;height:100vh;overflow:auto}
.sidebar .logo{padding:4px 8px 16px}
.nav-label{font-size:.72em;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);padding:12px 10px 4px;font-weight:600}
.nav-item{display:flex;align-items:center;gap:10px;padding:.55em .75em;border-radius:10px;color:var(--muted);font-weight:500;cursor:pointer}
.nav-item:hover{background:var(--surface-2);color:var(--text)}
.nav-item.active{background:var(--brand-soft);color:var(--brand)}
.nav-item svg{width:18px;height:18px;flex:none}
.main{display:flex;flex-direction:column;min-width:0}
.topbar{height:64px;display:flex;align-items:center;gap:12px;padding:0 24px;border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--bg) 85%,transparent);backdrop-filter:blur(10px);position:sticky;top:0;z-index:10}
.topbar .search{max-width:360px}
.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:700;font-size:.8em;flex:none}
.content{padding:24px;max-width:1400px;width:100%}
.page-head{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:20px}
.page-head h1{font-size:1.6rem;margin:0}
.page-head p{margin:2px 0 0;color:var(--muted)}
.kpis{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.kpi .label{color:var(--muted);font-size:.85em;font-weight:500}
.kpi .value{font-size:1.9rem;font-weight:800;letter-spacing:-.03em}
.kpi .delta{font-size:.82em;font-weight:600}
.two{grid-template-columns:2fr 1fr}
.half{grid-template-columns:1fr 1fr}
@media (max-width:1000px){.two,.half{grid-template-columns:1fr}}
@media (max-width:820px){.app{grid-template-columns:1fr}.sidebar{position:fixed;inset:0 auto 0 0;width:260px;z-index:50;transform:translateX(-100%);transition:.2s}.sidebar.open{transform:none;box-shadow:var(--shadow)}.menu-btn{display:inline-flex!important}.content{padding:16px}.topbar{padding:0 16px}}
.menu-btn{display:none!important}
.chart-box{position:relative;height:280px}

/* tables */
.table-wrap{overflow:auto}
table.t{width:100%;border-collapse:collapse}
table.t th{text-align:left;font-size:.78em;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:600;padding:10px 12px;border-bottom:1px solid var(--border)}
table.t td{padding:12px;border-bottom:1px solid var(--border);vertical-align:middle}
table.t tr:hover td{background:var(--surface-2)}
.progress{height:8px;border-radius:99px;background:var(--surface-2);overflow:hidden;min-width:80px}
.progress i{display:block;height:100%;background:linear-gradient(90deg,var(--brand),var(--brand-2));border-radius:99px}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block}

/* kanban */
.kanban{display:grid;grid-template-columns:repeat(4,minmax(240px,1fr));align-items:start;gap:14px;overflow-x:auto;padding-bottom:8px}
.kcol{background:var(--surface-2);border-radius:var(--radius);padding:12px;min-height:420px;display:flex;flex-direction:column;gap:10px}
.kcol.drag-over{outline:2px dashed var(--brand);outline-offset:-4px}
.kcol h3{font-size:.9em;display:flex;align-items:center;gap:8px;margin:2px 4px}
.kcard{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px;cursor:grab;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.kcard:active{cursor:grabbing}
.kcard.dragging{opacity:.4}
.kcard h4{font-size:.95em;margin:0 0 6px}
.kcard .meta{display:flex;gap:6px;align-items:center;flex-wrap:wrap;font-size:.8em;color:var(--muted)}

/* gantt */
.gantt{display:grid;grid-template-columns:220px 1fr;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.gantt .g-head,.gantt .g-name{padding:10px 12px;border-bottom:1px solid var(--border);font-size:.88em;height:44px;display:flex;align-items:center}
.gantt .g-head{font-weight:600;color:var(--muted);background:var(--surface-2)}
.g-track{position:relative;height:44px;border-bottom:1px solid var(--border);background-image:linear-gradient(90deg,var(--border) 1px,transparent 1px);background-size:calc(100%/12) 100%}
.g-bar{position:absolute;top:10px;height:24px;border-radius:7px;color:#fff;font-size:.75em;font-weight:600;padding:3px 8px;white-space:nowrap;overflow:hidden}
.g-months{display:grid;grid-template-columns:repeat(12,1fr);height:44px;align-items:center;font-size:.78em;color:var(--muted);background:var(--surface-2);border-bottom:1px solid var(--border);font-weight:600}
.g-months span{text-align:center}
.g-today{position:absolute;top:0;bottom:0;width:2px;background:var(--bad);z-index:2}

/* calendar */
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.cal .dow{padding:10px;font-size:.78em;font-weight:600;color:var(--muted);text-transform:uppercase;background:var(--surface-2);border-bottom:1px solid var(--border)}
.cal .day{min-height:112px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);padding:6px;cursor:pointer;position:relative}
.cal .day:nth-child(7n){border-right:0}
.cal .day:hover{background:var(--surface-2)}
.cal .day.other{opacity:.45}
.cal .num{font-size:.85em;font-weight:600}
.cal .day.today .num{background:var(--brand);color:#fff;border-radius:99px;padding:1px 7px}
.ev{display:block;font-size:.75em;padding:2px 6px;border-radius:6px;margin-top:4px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:700px){.cal .day{min-height:70px}.ev{font-size:0;height:6px;padding:0}}

/* whiteboard */
.wb-wrap{position:relative;height:calc(100vh - 210px);min-height:480px;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--surface);background-image:radial-gradient(var(--border) 1px,transparent 1px);background-size:22px 22px}
.wb-wrap canvas{position:absolute;inset:0;touch-action:none}
.wb-tools{position:absolute;left:12px;top:12px;z-index:5;display:flex;flex-direction:column;gap:6px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:6px;box-shadow:var(--shadow)}
.wb-tools button{width:38px;height:38px;border-radius:9px;border:0;background:transparent;cursor:pointer;display:grid;place-items:center}
.wb-tools button.on{background:var(--brand-soft);color:var(--brand)}
.wb-tools .sw{width:20px;height:20px;border-radius:50%;border:2px solid var(--surface)}
.sticky{position:absolute;width:180px;min-height:140px;padding:12px;border-radius:6px;box-shadow:0 6px 16px rgba(0,0,0,.15);z-index:3;font-size:.9em;color:#1a1a1a;cursor:move}
.sticky [contenteditable]{outline:none;min-height:90px;cursor:text}
.sticky .x{position:absolute;right:6px;top:2px;border:0;background:none;cursor:pointer;opacity:.5}
.presence{display:flex}.presence .avatar{width:28px;height:28px;border:2px solid var(--surface);margin-left:-8px}

/* modal / toast */
.modal-bg{position:fixed;inset:0;background:rgba(10,12,25,.5);display:grid;place-items:center;z-index:100;padding:16px;animation:fade .15s}
.modal{background:var(--surface);border-radius:18px;border:1px solid var(--border);width:min(520px,100%);padding:24px;box-shadow:0 30px 60px rgba(0,0,0,.3)}
.modal .grid{gap:12px}
.modal label{font-size:.85em;font-weight:600;color:var(--muted);display:block;margin-bottom:4px}
.toast{position:fixed;bottom:20px;right:20px;background:var(--text);color:var(--bg);padding:12px 16px;border-radius:12px;z-index:200;box-shadow:var(--shadow);animation:fade .2s}
@keyframes fade{from{opacity:0;transform:translateY(6px)}}
.empty{text-align:center;padding:40px;color:var(--muted)}
.feed li{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}
.feed{list-style:none;margin:0;padding:0}
.ro-banner{background:var(--brand-soft);color:var(--brand);padding:8px 14px;border-radius:10px;font-size:.88em;font-weight:500;margin-bottom:16px}

/* login */
.login{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}
.login .side{background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;padding:48px;display:flex;flex-direction:column;justify-content:space-between}
.login .side .logo{color:#fff}.login .side .logo-mark{background:rgba(255,255,255,.2)}
.login .form{display:grid;place-items:center;padding:32px}
.role-pick{display:grid;gap:10px;margin:18px 0}
.role-opt{display:flex;gap:12px;align-items:center;border:1px solid var(--border);border-radius:12px;padding:12px;cursor:pointer;background:var(--surface)}
.role-opt:hover,.role-opt.sel{border-color:var(--brand);background:var(--brand-soft)}
@media (max-width:820px){.login{grid-template-columns:1fr}.login .side{display:none}}