:root{--accent:#4a6ef2;--accent-2:#8b55f0;--ink:#0d0f1e;--muted:#6b7280;--border:rgba(20,30,90,.12);--gradient:linear-gradient(135deg,#4a6ef2,#8b55f0);--app-icon-url:none;font-family:'DM Sans',system-ui,'Segoe UI',sans-serif;color:var(--ink);background:#f5f6fc;font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid var(--border);border-radius:8px;background:white;padding:10px 15px;color:var(--ink);transition:.15s}button:hover{border-color:#b1bffd;background:#f7f5ff}button:focus-visible,a:focus-visible{outline:3px solid #b1bffd}button.primary{background:var(--accent);border-color:var(--accent);color:white}button.primary:hover{background:#3c5dce}button.ghost{border:0;background:none;color:var(--muted)}.titlebar{height:38px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding-left:22px;font-size:10px;letter-spacing:2px;position:fixed;inset:0 0 auto;z-index:10;-webkit-app-region:drag}.titlebar b{color:var(--accent)}.titlebar .titlehint{letter-spacing:.3px;color:var(--muted)}.titlebar div{display:flex;height:100%;-webkit-app-region:no-drag}.titlebar button{width:46px;border:0;border-radius:0;padding:0}.titlebar .close:hover{background:#e94c65;color:#fff}aside{position:fixed;left:0;top:38px;bottom:0;width:224px;background:#fff;border-right:1px solid var(--border);padding:30px 18px}.brand{display:flex;align-items:center;gap:12px;padding:5px 12px 42px;font-size:25px;font-weight:750;letter-spacing:-1px}.brandmark{background:var(--accent);color:#fff;border-radius:12px;width:42px;height:42px;text-align:center;line-height:40px;background-image:var(--app-icon-url);background-size:contain}.brand span:not(.brandmark){display:block;font-size:8px;letter-spacing:1.8px;color:var(--muted);margin-top:4px}aside>small{font-size:9px;letter-spacing:1.5px;color:#a3a3b0;padding-left:14px}nav{display:grid;gap:7px;margin-top:17px}nav button{display:flex;gap:14px;align-items:center;text-align:left;border:0;color:#81818f;font-size:13px;padding:14px}nav button.active{background:#edf1ff;color:var(--accent);font-weight:650}nav i{font-style:normal;font-size:19px;width:23px}.sidebottom{position:absolute;bottom:24px;left:28px;right:28px;font-size:10px;color:var(--muted)}.online{display:inline-block;background:#38b88b;border-radius:100%;width:6px;height:6px;margin-right:6px}.profile{margin-top:23px;padding-top:22px;border-top:1px solid var(--border);display:flex;gap:10px;color:var(--ink);font-size:12px;align-items:center}.profile>b{background:#edf1ff;color:var(--accent);padding:10px;border-radius:10px}.profile small{display:block;font-size:10px;color:var(--muted);margin-top:4px}main{margin:38px 0 0 224px;padding:38px 42px;max-width:1800px}h1{font-size:28px;letter-spacing:-1px;margin:6px 0 9px;font-weight:650}h2{font-size:16px;font-weight:650;margin:0}h3{font-size:14px}p{line-height:1.6}.muted,.subtitle{color:var(--muted);font-size:12px}.eyebrow{color:var(--accent);font-size:10px;font-weight:700;letter-spacing:1.8px}.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:30px}.actions{display:flex;gap:9px;align-items:center}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:28px}.stat,.panel{background:#fff;border:1px solid var(--border);border-radius:12px}.stat{padding:22px}.stathead{display:flex;justify-content:space-between;color:#81818f;font-size:11px}.stathead i{font-style:normal;color:var(--accent);font-size:18px}.stat strong{display:block;font-size:29px;font-weight:650;letter-spacing:-1px;margin:18px 0 10px}.stat small{font-size:10px;color:var(--muted)}.green{color:#2b9d77!important}.purple{color:var(--accent)}.columns{display:grid;grid-template-columns:minmax(0,2.15fr) minmax(250px,1fr);gap:22px}.panel{padding:22px;margin-bottom:22px}.panelhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.panelhead .muted{margin-top:6px}.filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}.filters button{font-size:11px;padding:8px 12px}.filters button.active{background:#edf1ff;color:var(--accent);border-color:#cdd7fc}table{width:100%;border-collapse:collapse;text-align:left;font-size:12px}th{font-weight:500;color:#9999a7;font-size:10px;padding:13px 10px;background:#fafafe;border-bottom:1px solid var(--border)}td{padding:18px 10px;border-bottom:1px solid #f0f0f6}tr:last-child td{border-bottom:0}tbody tr{cursor:pointer}tbody tr:hover{background:#faf9ff}.projectname{font-weight:600;margin-bottom:5px}.sub{font-size:10px;color:var(--muted)}.badge{display:inline-block;font-size:10px;border-radius:5px;padding:6px 8px;background:#edf1ff;color:#4a6ef2;white-space:nowrap}.phase0{background:#fff4e2;color:#c18b28}.phase1{background:#edecff;color:#7760d8}.phase2{background:#edf5ff;color:#518ac4}.phase3{background:#fff0e9;color:#cb855c}.phase4{background:#fff0f2;color:#d57084}.phase5,.phase6{background:#e9f7f0;color:#419d79}.progress{height:4px;background:#efedf6;border-radius:6px;margin-top:8px;width:85px}.progress div{height:4px;background:#8b55f0;border-radius:6px}.empty{text-align:center;padding:48px 16px;color:var(--muted)}.empty strong{color:var(--ink);display:block;margin:12px}.pipeline{display:flex;align-items:flex-end;gap:14px;height:130px;padding:15px 0 0}.bar{flex:1;text-align:center;font-size:9px;color:var(--muted)}.bar div{border-radius:5px 5px 0 0;background:#dce3fd;min-height:6px;margin-bottom:10px}.bar:nth-child(2) div{background:#4a6ef2}.bar b{display:block;color:var(--ink);font-size:12px;margin-bottom:6px}.task{padding:17px 0;border-bottom:1px solid var(--border);display:flex;gap:12px}.task:last-child{border:0}.taskicon{border:1px solid #dce3fd;background:#f0f3ff;color:#4a6ef2;border-radius:8px;min-width:32px;height:32px;text-align:center;line-height:30px}.task p{margin:0 0 5px;font-size:12px}.note{padding:18px;background:#f5f1ff;border-radius:8px;color:#82759f;font-size:11px;line-height:1.7}.note b{display:block;color:#685490;margin-bottom:5px}.search{width:250px}.clientgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.clientcard{cursor:pointer}.avatar{width:42px;height:42px;border-radius:12px;background:#edf1ff;color:var(--accent);display:grid;place-items:center;font-weight:650;margin-bottom:16px}.clientcard p{margin:6px 0}.detailgrid{display:grid;grid-template-columns:1.5fr 1fr;gap:22px}.phaseSteps{display:flex;justify-content:space-between;margin:25px 0 30px;gap:6px}.step{flex:1;border-top:3px solid #e2dfed;padding-top:12px;font-size:10px;color:var(--muted)}.step.done{border-color:var(--accent);color:var(--accent)}label{display:block;font-size:11px;color:#787887;margin:0 0 7px}input,select,textarea{width:100%;padding:11px 12px;border:1px solid #dfdfe9;background:white;border-radius:7px;color:var(--ink);outline:none}input:focus,select:focus,textarea:focus{border-color:#4a6ef2;box-shadow:0 0 0 3px #f3efff}textarea{min-height:100px;resize:vertical}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:17px}.full{grid-column:1/-1}.field{margin-bottom:17px}.check{display:flex;align-items:center;gap:10px;padding:12px 0;font-size:12px;color:var(--ink)}.check input{width:16px;height:16px;accent-color:var(--accent)}.amount{font-size:25px;font-weight:650;letter-spacing:-.7px}.line{display:flex;justify-content:space-between;padding:13px 0;border-bottom:1px solid var(--border);font-size:12px}.link{color:var(--accent);font-size:12px;word-break:break-all}.history{border-left:1px solid #e1daef;margin-left:5px;padding-left:18px}.history p{font-size:11px;margin:0 0 17px}.history small{display:block;color:var(--muted);margin-top:4px}dialog{width:min(690px,90vw);max-height:90vh;border:1px solid var(--border);border-radius:15px;padding:28px;box-shadow:0 25px 100px #27204030;color:var(--ink)}dialog::backdrop{background:#20203366;backdrop-filter:blur(4px)}.modalhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.modalfoot{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}#toast{position:fixed;bottom:24px;right:25px;background:#0d0f1e;color:white;border-radius:10px;padding:15px 22px;z-index:100;display:none;max-width:430px;font-size:12px}::-webkit-scrollbar{width:7px;height:7px}::-webkit-scrollbar-track{background:#f6f5fa}::-webkit-scrollbar-thumb{background:#d5cde5;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:#b3a1d7}.footer{font-size:10px;color:#a3a1b1;text-align:center;margin-top:28px}@media(max-width:1150px){main{padding:28px 24px}.stats{gap:10px}.stat{padding:16px}.columns{grid-template-columns:1fr}.clientgrid{grid-template-columns:repeat(2,1fr)}}

/* Identidad de emachuca.me; sin solicitudes externas para uso local. */
body{background:radial-gradient(ellipse at 95% 0,rgba(74,110,242,.07),transparent 55%),radial-gradient(ellipse at 30% 100%,rgba(139,85,240,.05),transparent 50%)}
h1,h2,h3,.brand{font-family:'Fraunces',Georgia,serif;font-weight:400}
h1{font-size:32px}h2{font-size:20px}h3{font-size:17px}
.brand{font-size:20px;gap:9px;padding:5px 0 34px;letter-spacing:-.6px}
.brand strong{display:block;font-weight:400;color:var(--accent)}
.brand span:not(.brandmark){font-family:'DM Sans',system-ui,sans-serif;font-size:7px;letter-spacing:.6px}
.brandmark{flex-shrink:0;background-color:var(--accent);background-image:var(--app-icon-url),var(--gradient);font-size:16px}
button{border-radius:999px}button.primary{background:var(--gradient);border-color:transparent;box-shadow:0 6px 18px -8px rgba(74,110,242,.4)}
button.primary:hover{filter:brightness(.94);background:var(--gradient)}
nav button.active{background:rgba(74,110,242,.09);color:var(--accent)}
.stat,.panel{border-radius:20px;background:rgba(255,255,255,.85);box-shadow:0 12px 35px -28px rgba(74,110,242,.3)}
.profile>b,.avatar,.filters button.active{background:rgba(74,110,242,.09);color:var(--accent)}
.progress div{background:var(--gradient)}.bar div{background:#dce3fd}.bar:nth-child(2) div{background:var(--accent)}
.note{background:linear-gradient(135deg,#edf1ff,#f3edff);color:#545f80}.note b{color:#35498f}
input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #4a6ef21f}
button:focus-visible,a:focus-visible{outline:3px solid #4a6ef280;outline-offset:2px}


.login-page{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:24px;box-sizing:border-box}.login-card{width:100%;max-width:460px;margin:0}.login-card h1{font-size:36px}.login-card input{width:100%;box-sizing:border-box}.login-card #turnstile{margin:24px 0}.login-card button{width:100%}.login-card #status{min-height:24px;overflow-wrap:anywhere}
@media(max-width:760px){aside{position:static;width:auto;height:auto;padding:16px}aside .sidebottom{display:none}#nav{display:flex;flex-wrap:wrap}#nav button{width:auto}main#main{margin-left:0;padding:20px}.titlebar{position:static}.columns,.detailgrid,.formgrid{grid-template-columns:1fr}.stats{grid-template-columns:1fr 1fr}.top{flex-wrap:wrap}.panel{overflow-x:auto}.phaseSteps{overflow-x:auto}}

/* Página 404: identidad compartida con el CRM. */
.not-found-page{min-height:100vh;min-height:100svh;display:flex;flex-direction:column}
.not-found-brand{padding:32px clamp(24px,6vw,80px)}
.not-found-brand a{display:inline-flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink)}
.not-found-brand img{flex-shrink:0;border-radius:12px}
.not-found-brand a>span{font-family:'Fraunces',Georgia,serif;font-size:23px;letter-spacing:-.6px}
.not-found-brand strong{font-weight:400;color:var(--accent)}
.not-found-brand small{display:block;margin-top:5px;font:9px 'DM Sans',system-ui,sans-serif;letter-spacing:1.5px;color:var(--muted)}
main.not-found-main{flex:1;display:grid;place-items:center;width:100%;max-width:none;margin:0;padding:24px}
.not-found-card{width:100%;max-width:720px;margin:0;padding:clamp(28px,6vw,64px);text-align:center;border-radius:28px;overflow:hidden}
.not-found-card .eyebrow{margin:0 0 16px}
.not-found-code{display:inline-block;font-family:'Fraunces',Georgia,serif;font-size:clamp(112px,23vw,180px);line-height:1.1;letter-spacing:-8px;color:var(--accent);background:var(--gradient);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.not-found-label{margin:20px 0 16px;font-size:9px;letter-spacing:1.6px;color:var(--muted)}
.not-found-card h1{font-size:clamp(32px,6vw,48px);line-height:1.12;letter-spacing:-1.4px;margin:0 0 20px}
.not-found-description{max-width:410px;margin:0 auto 28px;color:var(--muted);font-size:14px}
.not-found-action{display:inline-flex;align-items:center;justify-content:center;gap:24px;padding:14px 24px;border-radius:999px;background:var(--gradient);color:white;text-decoration:none;font-weight:600;box-shadow:0 8px 24px -12px #4a6ef280}
.not-found-action:hover{filter:brightness(.94)}
.not-found-action span{font-size:20px;line-height:1}
.not-found-help{max-width:330px;margin:24px auto 0;color:var(--muted);font-size:11px}
.not-found-footer{padding:28px 24px;text-align:center;color:var(--muted);font-size:10px;letter-spacing:.7px}
.not-found-footer span{margin:0 8px;color:var(--accent)}
@media(max-width:480px){.not-found-brand{padding:24px}.not-found-card{border-radius:22px}.not-found-footer{font-size:9px}.not-found-action{width:100%}}

.actions{flex-wrap:wrap}button:disabled{opacity:.45;cursor:not-allowed}button.danger{color:#b4233b}button.danger:hover{background:#fff0f2;border-color:#d57084}

/* Ritmo y escalas compartidos: dashboard, clientes, proyectos y formularios. */
:root{font-size:15px;--space-1:8px;--space-2:16px;--space-3:24px;--space-4:32px}
body{line-height:1.6}button{min-height:44px;padding:11px 20px;font-size:14px;line-height:1.4;font-weight:500;max-width:100%;white-space:normal;overflow-wrap:anywhere}
input,select,textarea{font-size:16px;line-height:1.5;padding:12px 14px;min-height:46px}textarea{min-height:120px;display:block}
label{font-size:13px;line-height:1.6;margin-bottom:8px;color:#545b70}h1{font-size:clamp(30px,3vw,40px);line-height:1.2;margin:8px 0 12px;letter-spacing:-.8px}h2{font-size:24px;line-height:1.3}h3{font-size:20px;line-height:1.4;margin:28px 0 16px}
p{margin:12px 0 20px}.muted,.subtitle{font-size:14px;line-height:1.65}.eyebrow{font-size:11px;line-height:1.5}.sub{font-size:12px;line-height:1.6}
main{padding:40px clamp(24px,3vw,48px)}.top{gap:24px;align-items:flex-start;margin-bottom:32px;flex-wrap:wrap}.top>div{min-width:0}.top .actions{padding-top:8px}.actions{gap:12px;row-gap:12px;flex-wrap:wrap}.actions>*{min-width:0}.search{max-width:100%;width:280px}
.stats{gap:20px;margin-bottom:32px;grid-template-columns:repeat(4,minmax(0,1fr))}.stat{padding:24px;min-width:0}.stathead{font-size:13px;gap:12px}.stat strong{font-size:clamp(26px,2.5vw,36px);line-height:1.2;margin:20px 0 12px;overflow-wrap:anywhere}.stat small{font-size:12px;line-height:1.6}
.panel{padding:28px;margin-bottom:24px;min-width:0}.panelhead{gap:16px;flex-wrap:wrap;margin-bottom:24px}.columns,.detailgrid{gap:24px}.columns>* ,.detailgrid>*{min-width:0}.clientgrid{gap:24px;grid-template-columns:repeat(3,minmax(0,1fr))}.clientcard p{margin:10px 0;font-size:14px}.clientcard h2{overflow-wrap:anywhere}
.filters{gap:10px;margin-bottom:24px}.filters button{font-size:13px;padding:10px 16px}.badge{font-size:12px;line-height:1.4;padding:7px 10px}table{font-size:14px;line-height:1.5}th{font-size:12px;line-height:1.5;padding:16px 12px}td{padding:20px 12px;vertical-align:top}.panel:has(table){overflow-x:auto}.projectname{margin-bottom:8px}.progress{margin-top:12px}
.task{padding:20px 0;gap:14px}.task p{font-size:14px;line-height:1.6;margin-bottom:8px}.taskicon{flex-shrink:0;width:36px;height:36px;line-height:34px}.note{font-size:14px;padding:20px;line-height:1.7}.bar{font-size:11px}.bar b{font-size:14px}.pipeline{height:160px;margin-bottom:16px}
.formgrid{gap:24px}.field{margin-bottom:24px}.check{font-size:14px;gap:12px;padding:14px 0}.check input{min-height:18px;width:18px;height:18px;flex-shrink:0}.line{font-size:14px;gap:20px;padding:16px 0}.line>*{min-width:0;overflow-wrap:anywhere}.link{font-size:14px;line-height:1.7}.history p{font-size:14px;margin-bottom:24px}.history small{font-size:12px;line-height:1.6;margin-top:8px}.phaseSteps{gap:12px;margin:32px 0}.step{font-size:12px;line-height:1.6;min-width:90px;padding-top:16px}.phaseSteps{overflow-x:auto;padding-bottom:8px}
dialog{width:min(740px,calc(100vw - 32px));padding:32px;max-height:calc(100dvh - 32px)}.modalhead{gap:16px;margin-bottom:28px}.modalhead button{flex-shrink:0}.modalfoot{gap:12px;margin-top:32px;flex-wrap:wrap}.footer{font-size:12px;line-height:1.7;margin-top:32px}#toast{font-size:14px;line-height:1.6;max-width:min(430px,calc(100vw - 32px));right:16px}
aside{overflow-y:auto;padding:28px 16px 200px}.brand{padding:4px 4px 32px;gap:10px}.brand span:not(.brandmark){font-size:9px;letter-spacing:.5px;line-height:1.6}.brandmark{width:40px;height:40px;line-height:40px}aside>small{font-size:10px;line-height:1.6}nav{gap:8px}nav button{font-size:14px;line-height:1.5;padding:12px;gap:10px}.sidebottom{position:static;margin-top:40px;font-size:12px}.profile{font-size:13px}.profile small{font-size:12px}.titlebar{gap:16px;padding-right:22px}
.login-card{padding:36px}.login-card h1{font-size:36px;margin-bottom:16px}.login-card .field{margin-bottom:24px}.login-card button{margin-top:8px}.login-card #status{font-size:14px}
@media(max-width:1200px){.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.clientgrid{grid-template-columns:repeat(2,minmax(0,1fr))}.detailgrid{grid-template-columns:1fr}}
@media(max-width:760px){.titlebar{height:auto;min-height:38px;padding:10px 16px;flex-wrap:wrap;letter-spacing:1px}aside{padding:20px 16px;overflow:visible}.brand{padding-bottom:20px}nav#nav{gap:8px;margin-top:12px}nav button{flex:1 1 140px}main#main{margin:0;padding:28px 16px}.top{gap:20px;margin-bottom:24px}.top .actions{width:100%;padding-top:0}.search{width:100%}.panel{padding:22px}.stats{gap:12px}.stat{padding:20px}.columns,.formgrid,.detailgrid,.clientgrid{grid-template-columns:1fr}.actions{gap:10px}.phaseSteps{justify-content:flex-start}dialog{padding:24px}.login-card{padding:28px}.panelhead h2{font-size:23px}}
@media(max-width:420px){.stats{grid-template-columns:1fr}.actions>button,.modalfoot>button{flex:1 1 100%}.titlehint{display:none}.panel{padding:20px}.login-page{padding:16px}.login-card{padding:24px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
