:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;line-height:1.4;color:#17242b;background:#f4f6f7;font-synthesis:none;--ink:#0b0e11;--ink-soft:#151b20;--accent:#008fb2;--accent-strong:#006f8e;--accent-light:#e3f4f8;--silver:#a9abb1;--paper:#fff;--surface:#f4f6f7;--line:#dce3e7;--muted:#53636d;--danger:#ad3f41;--radius:14px}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;max-width:100%}body.overlay-open{overflow:hidden}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:wait}a{color:var(--accent-strong)}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}::selection{background:#a8deec;color:#0b0e11}:focus-visible{outline:3px solid #29b6d5;outline-offset:2px}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background:#9eaeb6;border-radius:10px}::-webkit-scrollbar-track{background:#eef2f3}
.boot,.fatal,.loading-state{min-height:100dvh;display:flex;align-items:center;justify-content:center;gap:12px;color:var(--muted);padding:25px;text-align:center}.fatal{flex-direction:column}.fatal button{border:0;background:var(--ink);color:white;padding:12px 18px;border-radius:10px}.spinner{width:21px;height:21px;border:2px solid #cbdde3;border-top-color:var(--accent);border-radius:50%;animation:spin .65s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.auth-logo,.header-brand img,.brand img{clip-path:inset(2.2% 4.5% 4% 4.5%)}
.open-hint{min-height:100dvh;display:grid;place-items:center;padding:24px;background:var(--surface)}.open-hint-card{background:white;max-width:520px;padding:clamp(28px,6vw,50px);border:1px solid var(--line);border-radius:var(--radius)}.open-hint-brand{display:block;color:var(--ink);font-size:1.4rem;letter-spacing:.12em;margin-bottom:30px}.open-hint-brand span{color:var(--accent)}.open-hint h1{font-size:1.8rem;line-height:1.2;letter-spacing:-.025em;margin:0 0 14px}.open-hint p{color:var(--muted);line-height:1.6}.open-hint a{display:inline-block;margin-top:12px;background:var(--accent-strong);color:white;text-decoration:none;border-radius:10px;padding:12px 18px;font-weight:700}.open-hint-small{font-size:.83rem;margin-top:23px}.open-hint code{background:#edf2f3;padding:2px 5px;border-radius:4px;color:var(--ink)}

/* Acceso */
.auth-layout{min-height:100dvh;background:#080a0c}.auth-story{height:270px;padding:20px 24px 42px;background:#080a0c;color:white;display:flex;flex-direction:column;align-items:center;justify-content:center}.auth-logo{width:136px;height:138px;object-fit:contain;mix-blend-mode:screen}.auth-message{text-align:center}.auth-story h1{font-size:1.34rem;line-height:1.2;letter-spacing:-.02em;margin:7px 0 0}.auth-story p,.auth-footer{display:none}.auth-panel{position:relative;background:var(--paper);border-radius:25px 25px 0 0;margin-top:-23px;min-height:calc(100dvh - 247px);padding:31px 24px calc(35px + env(safe-area-inset-bottom));display:flex;justify-content:center}.auth-card{width:min(100%,420px)}.auth-heading{margin-bottom:27px}.auth-heading h2{font-size:1.68rem;line-height:1.12;letter-spacing:-.03em;margin:0 0 8px;color:var(--ink)}.auth-heading p{margin:0;color:var(--muted);font-size:.92rem}.auth-logo-mobile{display:none}.auth-card .form-field{display:block;margin-bottom:16px}.auth-card .form-field span{display:block;font-size:.84rem;font-weight:700;margin-bottom:7px}.auth-card input{height:50px;width:100%;padding:0 14px;border:1px solid #c5d0d6;border-radius:11px;background:#fff;color:var(--ink);font-size:1rem}.auth-card input:focus{outline:0;border-color:var(--accent);box-shadow:0 0 0 3px #d4f0f6}.auth-help{font-size:.78rem;color:var(--muted);text-align:center;line-height:1.5;margin:18px 0 0}

/* Estructura y navegación */
.shell{min-height:100dvh}.workspace{min-width:0}.topbar{position:sticky;top:0;z-index:12;height:calc(64px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 16px 0;display:flex;align-items:center;gap:11px;background:#080a0c;color:#fff}.header-brand{display:flex;align-items:center;gap:8px;font-size:.91rem;font-weight:800;letter-spacing:.14em}.header-brand img{height:44px;width:44px;object-fit:cover;mix-blend-mode:screen}.header-menu{margin-left:auto;width:44px;height:44px;display:grid;place-items:center;border:1px solid #38444c;border-radius:12px;background:#171c20;color:#e7f3f6}.header-menu svg{width:22px;height:22px}.crumb,.top-user{display:none}.main{padding:22px 16px calc(102px + env(safe-area-inset-bottom));max-width:1500px;margin:auto;min-height:calc(100dvh - 64px)}
.bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:18;height:calc(68px + env(safe-area-inset-bottom));padding:3px 3px env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(5,minmax(0,1fr));background:rgba(255,255,255,.97);border-top:1px solid #d5dee2;box-shadow:0 -7px 24px rgba(13,31,39,.06)}.bottom-tab{border:0;background:transparent;color:#65747d;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;min-width:0;font-size:.63rem;font-weight:700;letter-spacing:.01em;border-radius:10px;min-height:60px}.bottom-tab svg{width:23px;height:23px}.bottom-tab.active{color:var(--accent-strong);background:#e7f5f8}.bottom-tab:active{transform:scale(.96)}
.sidebar{position:fixed;inset:0;z-index:31;background:#0a0d10;color:#edf6f8;display:flex;flex-direction:column;transform:translateY(105%);transition:transform .28s cubic-bezier(.2,.8,.2,1);height:100dvh;padding-top:env(safe-area-inset-top);border-radius:22px 22px 0 0;overflow:hidden}.sidebar.open{transform:translateY(0)}.sidebar .brand{height:88px;padding:12px 18px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #2e373d}.brand img{width:63px;height:63px;object-fit:contain;mix-blend-mode:screen}.brand strong{font-size:.9rem;letter-spacing:.1em;display:block}.brand small{display:block;font-size:.72rem;color:#aab8be;margin-top:3px}.drawer-close{margin-left:auto;border:1px solid #435058;background:#192127;color:white;width:44px;height:44px;border-radius:11px;display:grid;place-items:center}.sidebar-profile{display:flex;align-items:center;gap:11px;padding:14px 20px;border-bottom:1px solid #263038}.avatar,.top-avatar{width:37px;height:37px;display:grid;place-items:center;background:#183e49;color:#75d5ec;border-radius:11px;font-weight:800;flex-shrink:0}.sidebar-profile b,.sidebar-profile small{display:block}.sidebar-profile b{font-size:.88rem}.sidebar-profile small{font-size:.73rem;color:#a4b3ba;margin-top:2px}.sidebar nav{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:10px 12px 22px}.nav-group{margin-bottom:6px}.nav-label{padding:17px 10px 7px;color:#90a2aa;text-transform:uppercase;letter-spacing:.1em;font-size:.65rem;font-weight:800}.nav-link{width:100%;min-height:47px;display:flex;align-items:center;gap:12px;border:0;border-radius:10px;padding:8px 11px;background:transparent;text-align:left;color:#d9e4e8;font-size:.84rem}.nav-link>.nav-symbol{width:24px;height:24px;display:grid;place-items:center;color:#8ba9b2}.nav-link>.nav-symbol svg{height:19px;width:19px}.nav-link>svg:last-child{margin-left:auto;width:15px;height:15px;opacity:.48}.nav-link.active{background:#173d49;color:#fff}.nav-link.active>.nav-symbol{color:#45c6e5}.nav-link:hover{background:#19272e}.sidebar-bottom{padding:12px 18px calc(15px + env(safe-area-inset-bottom));border-top:1px solid #263038}.logout{min-height:46px;width:100%;display:flex;align-items:center;gap:11px;border:0;background:transparent;color:#cedde2;text-align:left;font-size:.86rem}.nav-scrim{position:fixed;inset:0;z-index:29;border:0;background:rgba(0,0,0,.55)}

/* Acciones y encabezados */
.page-heading{display:flex;flex-direction:column;gap:16px;margin-bottom:20px}.page-heading h1{margin:0;color:var(--ink);font-size:1.72rem;line-height:1.15;letter-spacing:-.025em}.page-heading p{margin:6px 0 0;color:var(--muted);font-size:.86rem}.primary,.secondary,.destructive{min-height:46px;padding:0 17px;border-radius:11px;border:1px solid transparent;display:inline-flex;align-items:center;justify-content:center;gap:9px;font-size:.88rem;font-weight:700;text-decoration:none;white-space:nowrap}.primary{background:var(--accent-strong);color:#fff}.primary:hover{background:#005a76}.primary:active,.secondary:active{transform:scale(.985)}.primary svg,.secondary svg{width:18px;height:18px}.primary.wide{width:100%;height:51px;margin-top:8px}.secondary{background:white;color:#194954;border-color:#b9ccd3}.destructive{background:var(--danger);color:white}.page-heading .primary{width:100%}.text-action{min-height:40px;display:inline-flex;align-items:center;gap:4px;border:0;background:none;color:var(--accent-strong);font-size:.8rem;font-weight:750;padding:0}.text-action svg{width:15px;height:15px}

/* Inicio */
.dashboard-lead{margin-bottom:20px}.dashboard-lead span{color:#667680;font-size:.79rem}.dashboard-lead h1{color:var(--ink);font-size:2rem;line-height:1.1;letter-spacing:-.03em;margin:8px 0 5px}.dashboard-lead p{color:var(--muted);margin:0;font-size:.89rem}.overview-top{display:grid;gap:12px;margin-bottom:20px}.intro-panel{background:#0b0e11;color:white;border-radius:16px;padding:22px;min-height:205px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}.intro-panel:after{content:"";position:absolute;right:-54px;top:-71px;width:170px;height:170px;border:1px solid rgba(77,209,239,.2);border-radius:50%;pointer-events:none}.intro-heading{display:flex;align-items:center;gap:9px;color:#aee4f1;font-size:.83rem;font-weight:650}.intro-heading svg{width:21px;height:21px;color:#40c5e5}.intro-number{font-size:3.75rem;font-weight:760;letter-spacing:-.04em;line-height:1;color:#fff;font-variant-numeric:tabular-nums}.intro-number small{display:block;font-size:.76rem;font-weight:500;color:#aabac1;letter-spacing:0;margin-top:4px}.intro-link{border:0;background:none;color:#54d0ec;display:flex;align-items:center;gap:8px;padding:0;min-height:35px;font-weight:700;font-size:.8rem;align-self:flex-start}.intro-link svg{width:16px;height:16px}.overview-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{min-width:0;background:white;border:1px solid var(--line);border-radius:var(--radius);padding:15px;display:flex;flex-direction:column;min-height:118px}.metric:nth-child(3){grid-column:1/-1}.metric-icon{color:var(--accent-strong);margin-bottom:7px}.metric-icon svg{width:18px;height:18px}.metric small{color:var(--muted);font-size:.74rem}.metric strong{display:block;color:var(--ink);font-size:clamp(1.15rem,5vw,1.55rem);line-height:1.13;letter-spacing:-.025em;margin-top:auto;padding-top:8px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.metric .danger-text{color:var(--danger)}.dashboard-grid{display:grid;gap:17px}.panel{background:white;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:15px 17px;border-bottom:1px solid var(--line)}.section-head h2{font-size:1rem;line-height:1.2;margin:0;color:var(--ink)}.project-line{padding:14px 17px;display:flex;align-items:center;justify-content:space-between;gap:9px;border-bottom:1px solid #e9eef0}.project-line:last-child{border-bottom:0}.project-identity{display:flex;align-items:center;gap:10px;min-width:0;flex:1}.project-monogram{width:35px;height:35px;display:grid;place-items:center;flex-shrink:0;background:#e1f1f5;color:#006e8a;border-radius:9px;font-weight:800}.project-identity>div:last-child{min-width:0}.project-identity strong{display:block;color:#23343c;font-size:.84rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-identity small{display:block;color:var(--muted);font-size:.7rem;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-meta{display:flex;flex-direction:column;align-items:flex-end;gap:4px}.project-meta strong{font-size:.72rem;white-space:nowrap;font-variant-numeric:tabular-nums;color:#384b54}.badge{display:inline-flex;align-items:center;width:max-content;max-width:100%;padding:5px 8px;border-radius:7px;font-size:.69rem;line-height:1.1;font-weight:750}.badge.green{background:#e0f3e8;color:#176b49}.badge.amber{background:#fff1d9;color:#885317}.badge.red{background:#f9e4e5;color:#a3393e}.badge.neutral{background:#e8eff2;color:#445f6b}.activity-list{padding:1px 17px}.activity-row{display:flex;gap:11px;align-items:flex-start;padding:13px 0;border-bottom:1px solid #e9eef0;color:#3e515a;font-size:.8rem;line-height:1.45}.activity-row:last-child{border-bottom:0}.activity-row strong{color:#1a2b34}.activity-row small{display:block;margin-top:4px;color:#687a83}.activity-dot{height:10px;width:10px;margin-top:5px;border-radius:50%;background:var(--accent);flex-shrink:0}

/* Registros */
.project-progress{margin-top:17px}.project-progress-label{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px}.project-progress-label span{color:#526670;font-size:.76rem;font-weight:650}.project-progress-label strong{color:#075f7a;font-size:.93rem;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}.project-progress progress,.project-progress-empty{display:block;width:100%;height:10px;border:0;border-radius:999px;overflow:hidden;background:#e1e9ec}.project-progress progress{-webkit-appearance:none;appearance:none}.project-progress progress::-webkit-progress-bar{background:#e1e9ec;border-radius:999px}.project-progress progress::-webkit-progress-value{background:#008fb2;border-radius:999px}.project-progress progress::-moz-progress-bar{background:#008fb2;border-radius:999px}
.table-panel{background:transparent}.table-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.search{height:47px;width:100%;display:flex;align-items:center;gap:10px;padding:0 13px;background:white;border:1px solid #cad7dc;border-radius:11px;color:#53727e}.search svg{width:19px;height:19px}.search input{border:0;outline:0;min-width:0;flex:1;background:transparent;color:var(--ink);font-size:.9rem}.search input::placeholder{color:#667984;opacity:1}.table-count{display:none;color:var(--muted);font-size:.76rem}.mobile-records{display:grid;gap:11px}.record-card{background:white;border:1px solid var(--line);border-radius:var(--radius);padding:16px;min-width:0}.record-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.record-card-head>div:first-child{min-width:0;flex:1}.record-card h2{margin:0;color:var(--ink);font-size:1rem;line-height:1.3;overflow-wrap:anywhere}.record-card-head span:not(.badge),.user-card-head span:not(.badge){display:block;color:#657782;font-size:.72rem;margin-top:5px}.record-card-head .badge{flex-shrink:0;margin-top:1px}.record-amount{margin-top:15px;font-size:1.4rem;font-weight:760;color:#006f8e;font-variant-numeric:tabular-nums;letter-spacing:-.02em}.record-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 15px;margin:17px 0 0}.record-facts div{min-width:0}.record-facts dt{font-size:.69rem;color:#647680;margin-bottom:2px}.record-facts dd{margin:0;color:#253943;font-size:.8rem;overflow-wrap:anywhere}.record-actions{display:flex;align-items:center;gap:4px;border-top:1px solid #e9eef0;margin-top:16px;padding-top:9px}.record-actions button{min-height:43px;display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:1;border:0;background:transparent;color:#196d85;font-size:.77rem;font-weight:700;border-radius:8px}.record-actions button:active{background:#e3f4f8}.record-actions button.danger{flex:0 0 44px;color:var(--danger)}.record-actions svg{width:17px;height:17px}.table-wrap{display:none}.user-card-head{display:flex;align-items:center;gap:10px}.user-card-head>div{flex:1;min-width:0}.user-role{margin-top:13px;padding-top:11px;border-top:1px solid var(--line);font-size:.8rem;color:#526670}.num{font-variant-numeric:tabular-nums}.muted,.date-cell{color:#7c8c94}
table{width:100%;border-collapse:collapse;min-width:760px}th{text-align:left;padding:13px 15px;background:#f6f9fa;color:#5e6f79;letter-spacing:.05em;font-size:.68rem;text-transform:uppercase;white-space:nowrap}td{padding:15px;border-top:1px solid #e8eef0;color:#344a54;font-size:.81rem;max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}td:first-child{font-weight:700;color:#1b3039}.actions-col{text-align:right;min-width:134px}.icon-btn{border:0;background:transparent;color:#276f85;min-height:40px;min-width:40px;border-radius:8px}.icon-btn:hover{background:#e7f5f8}.icon-btn.danger{color:var(--danger)}.icon-btn svg{height:18px;width:18px}
.empty{text-align:center;padding:48px 20px;color:var(--muted);background:white;border:1px solid var(--line);border-radius:var(--radius)}.empty-symbol{height:49px;width:49px;margin:0 auto 13px;background:#e8f4f7;color:var(--accent-strong);border-radius:13px;display:grid;place-items:center}.empty-symbol svg{height:24px;width:24px}.empty strong{display:block;color:#273b44;font-size:.9rem}.empty p{margin:6px auto 0;max-width:260px;font-size:.79rem;line-height:1.5}.panel .empty{border:0;border-radius:0}.audit-panel{padding:0 16px}.audit-item{display:flex;align-items:flex-start;gap:11px;padding:16px 0;border-bottom:1px solid var(--line);font-size:.83rem;color:#4b5e68}.audit-item:last-child{border-bottom:0}.audit-item small{display:block;color:#788991;margin-top:4px;font-size:.72rem}.audit-icon{width:28px;height:28px;display:grid;place-items:center;background:#e0f2f6;border-radius:8px;color:#006f8e;font-weight:800;flex-shrink:0}
.settings-grid{display:grid;gap:15px}.settings-panel{padding:19px}.settings-panel h2{margin:0 0 7px;font-size:1.05rem;color:var(--ink)}.settings-panel p,.settings-panel small{color:var(--muted);font-size:.8rem;line-height:1.5}.settings-panel p{margin:0 0 21px}.settings-panel small{display:block;margin-top:12px}.settings-panel .form-field{display:block;margin-bottom:18px}.settings-panel .form-field span{display:block;margin-bottom:7px;font-weight:700;font-size:.83rem}.settings-panel input{width:100%;min-height:48px;border-radius:10px;border:1px solid #c8d6dc;padding:0 13px}.settings-link{width:100%;justify-content:space-between;margin-bottom:10px}

/* Hojas de edición */
.dialog-backdrop{position:fixed;inset:0;z-index:40;background:rgba(4,12,16,.58);display:flex;align-items:flex-end;justify-content:center;padding:0}.dialog{width:100%;max-height:94dvh;overflow-y:auto;overscroll-behavior:contain;background:#fff;border-radius:22px 22px 0 0;box-shadow:0 -15px 40px rgba(0,0,0,.2)}.dialog:before{content:"";display:block;width:34px;height:4px;border-radius:4px;background:#c1ccd1;margin:9px auto 0}.dialog-header{position:sticky;top:0;z-index:2;background:#fff;display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:19px 20px 17px;border-bottom:1px solid var(--line)}.dialog h2{font-size:1.16rem;line-height:1.2;color:var(--ink);margin:0 0 5px}.dialog-header p,.dialog.small>p{color:var(--muted);font-size:.8rem;line-height:1.5;margin:0}.dialog-close{width:44px;height:44px;display:grid;place-items:center;border:0;background:#edf2f4;color:#364e59;border-radius:10px;flex-shrink:0}.dialog.small{padding:19px 20px 0}.dialog.small .dialog-close{float:right;margin-top:-5px}.dialog.small>h2{padding-top:8px}.dialog.small>p{margin:10px 0 21px;clear:both}.record-form{display:grid;grid-template-columns:1fr;gap:16px;padding:20px 20px 0}.form-field label{display:block;color:#344a54;font-size:.8rem;font-weight:750;margin-bottom:7px}.form-field input,.form-field select,.form-field textarea{width:100%;min-height:48px;padding:11px 13px;border:1px solid #c8d5db;border-radius:10px;background:#fff;color:var(--ink);font-size:1rem;outline:0}.form-field textarea{resize:vertical;min-height:92px}.form-field input:focus,.form-field select:focus,.form-field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #d5eff5}.required{color:var(--danger)}.dialog-actions{grid-column:1/-1;position:sticky;bottom:0;background:white;border-top:1px solid var(--line);padding:13px 0 calc(14px + env(safe-area-inset-bottom));display:flex;gap:9px;justify-content:flex-end;z-index:2}.dialog-actions>*{flex:1}.dialog.small .dialog-actions{margin:0 -20px;padding:13px 20px calc(14px + env(safe-area-inset-bottom))}.file-list{max-height:35dvh;overflow:auto;padding:0 20px}.file-row{display:flex;align-items:center;gap:8px;min-height:55px;border-bottom:1px solid var(--line)}.file-row a{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--accent-strong);font-size:.84rem;font-weight:700}.file-row small{color:var(--muted);font-size:.68rem}.file-form{padding:15px 20px calc(20px + env(safe-area-inset-bottom));display:grid;gap:11px}.file-form label{display:block;color:#344a54;font-weight:700;font-size:.82rem}.file-form input{max-width:100%;font-size:.8rem}.file-form .primary{width:100%}
#toast{position:fixed;z-index:60;left:16px;right:16px;bottom:calc(84px + env(safe-area-inset-bottom));background:#14232a;color:#fff;border-radius:11px;padding:13px 16px;font-size:.82rem;opacity:0;transform:translateY(12px);pointer-events:none;box-shadow:0 10px 25px rgba(0,0,0,.2);transition:opacity .22s,transform .22s}#toast.show{opacity:1;transform:translateY(0)}#toast.error{background:#8f3336}

@media(min-width:600px){.main{padding:29px 28px 115px}.overview-top{grid-template-columns:minmax(220px,1fr) minmax(0,1.4fr)}.overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metric:nth-child(3){grid-column:1/-1}.dashboard-grid{grid-template-columns:1fr 1fr}.mobile-records{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-grid{grid-template-columns:1fr 1fr}.dialog{width:min(100%,620px)}.dialog-backdrop{align-items:center;padding:20px}.dialog{max-height:min(90dvh,850px);border-radius:18px}.dialog:before{display:none}.dialog.small{max-width:420px}.record-form{grid-template-columns:1fr 1fr}.record-form .form-field.full{grid-column:1/-1}#toast{left:auto;right:24px;bottom:25px;max-width:390px}}
@media(min-width:950px){.shell{display:flex}.sidebar{position:sticky;top:0;inset:auto;z-index:10;width:246px;height:100vh;transform:none;border-radius:0;padding-top:0;flex-shrink:0}.sidebar .brand{height:96px}.brand img{height:68px;width:68px}.drawer-close,.bottom-nav,.header-brand,.header-menu,.nav-scrim{display:none}.workspace{flex:1;min-width:0}.topbar{height:70px;padding:0 32px;position:sticky}.crumb,.top-user{display:flex;align-items:center;gap:8px;font-size:.82rem}.crumb{color:#a9bbc2}.crumb span{color:#60737b}.crumb strong{color:white}.top-user{margin-left:auto;color:#c8d9df}.status-dot{height:7px;width:7px;background:#41c7e7;border-radius:50%}.top-avatar{width:31px;height:31px;margin-left:8px}.main{padding:34px clamp(26px,3vw,48px) 80px}.page-heading{flex-direction:row;align-items:center}.page-heading .primary{width:auto}.overview-top{grid-template-columns:minmax(250px,.9fr) minmax(480px,1.6fr);gap:17px}.intro-panel{min-height:220px}.overview-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.metric:nth-child(3){grid-column:auto}.metric{min-height:220px;padding:20px}.metric strong{font-size:clamp(1.25rem,1.7vw,1.8rem)}.dashboard-grid{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:17px}.table-panel{background:white;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.table-tools{padding:14px 18px;margin:0;border-bottom:1px solid var(--line)}.search{max-width:365px}.table-count{display:block}.mobile-records{display:none}.table-wrap{display:block;overflow-x:auto}.settings-grid{max-width:1000px}.dialog-actions>*{flex:0 0 auto;min-width:125px}#toast{bottom:24px}}
@media(max-width:350px){.record-facts{grid-template-columns:1fr}.bottom-tab{font-size:.58rem}.bottom-tab svg{width:20px;height:20px}.metric strong{font-size:1.1rem}}
@media(max-width:599px){.metric:nth-child(2) strong{font-size:clamp(.88rem,3.8vw,1.28rem);white-space:nowrap;letter-spacing:-.04em}}
.record-amount{overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Refinamientos de experiencia móvil */
.mobile-page-label{min-width:0;display:flex;flex-direction:column;justify-content:center;line-height:1.1}.mobile-page-label small{color:#95aab4;font-size:.63rem;letter-spacing:.05em}.mobile-page-label strong{color:#fff;font-size:.94rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}.header-brand span{display:none}.header-brand img{height:40px;width:40px}.module-search{height:47px;margin:12px 18px 0;padding:0 12px;display:flex;align-items:center;gap:9px;border:1px solid #43545b;border-radius:11px;background:#171f23;color:#8ed9e9}.module-search svg{width:19px;height:19px}.module-search input{min-width:0;flex:1;border:0;background:transparent;outline:0;color:#fff;font-size:1rem}.module-search input::placeholder{color:#b2c2c8}.sidebar .nav-link[hidden],.sidebar .nav-group[hidden],.module-no-results[hidden]{display:none}.module-no-results{color:#c5d5db;text-align:center;font-size:.9rem;padding:24px 16px}
.quick-section{margin:0 0 20px}.quick-section h2{font-size:.86rem;color:#455a64;margin:0 0 10px}.quick-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.quick-link{min-width:0;min-height:86px;padding:9px 2px;border:1px solid var(--line);border-radius:12px;background:#fff;color:#203740;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;box-shadow:0 3px 12px rgba(13,31,39,.025)}.quick-link>span{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#e8f6f9;color:var(--accent-strong)}.quick-link svg{width:19px;height:19px}.quick-link b{font-size:.66rem;line-height:1.1;overflow:hidden;text-overflow:ellipsis;max-width:100%}.quick-link:active{background:#edf8fa;transform:scale(.98)}
.page-skeleton{padding-top:10px;display:grid;gap:13px}.page-skeleton span{display:block;background:linear-gradient(100deg,#e9eff1 8%,#f8fafb 22%,#e9eff1 37%);background-size:220% 100%;animation:skeleton 1.5s ease infinite;border-radius:14px}.page-skeleton span:first-child{width:52%;height:27px;margin-bottom:9px}.page-skeleton span:nth-child(2){height:46px}.page-skeleton span:nth-child(3),.page-skeleton span:nth-child(4){height:120px}@keyframes skeleton{to{background-position-x:-220%}}
.empty-action{margin-top:18px}.search input[type=search]::-webkit-search-cancel-button{cursor:pointer}.record-actions button{min-height:46px}.record-facts dd,.record-card h2{line-height:1.4}.dialog-backdrop{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
@media(min-width:600px){.quick-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.quick-link{min-height:80px;flex-direction:row;gap:10px;justify-content:flex-start;padding:12px}.quick-link b{font-size:.82rem}.quick-section{margin-bottom:23px}}
@media(min-width:950px){.mobile-page-label{display:none}.header-brand span{display:inline}.module-search{margin-top:8px}.quick-section{max-width:740px}.sidebar .nav-link{min-height:44px}}
@media(max-width:350px){.quick-link b{font-size:.59rem}.quick-grid{gap:5px}.quick-link>span{width:31px;height:31px}}
@media(prefers-reduced-motion:reduce){.page-skeleton span{animation:none}}

/* Navegación por jornada y áreas */
.nav-frequent{padding:2px 0 14px;border-bottom:1px solid #263038;margin-bottom:10px}.nav-frequent-title,.nav-all-title{padding:12px 10px 7px;color:#b9cbd2;font-size:.75rem;font-weight:800}.nav-all-title{padding-top:8px}.nav-group{margin:0 0 4px}.nav-group>summary{min-height:45px;padding:9px 11px;display:flex;align-items:center;justify-content:space-between;list-style:none;color:#c7d8de;font-size:.8rem;font-weight:750;border-radius:9px;cursor:pointer}.nav-group>summary::-webkit-details-marker{display:none}.nav-group>summary:after{content:'';width:7px;height:7px;border-right:1.5px solid #8ba9b2;border-bottom:1.5px solid #8ba9b2;transform:rotate(45deg);margin:0 5px 3px 12px;transition:transform .18s}.nav-group[open]>summary:after{transform:rotate(225deg)}.nav-group>summary>span{margin-left:auto;color:#91a9b2;font-size:.72rem}.nav-group>summary:hover,.nav-group>summary:focus-visible{background:#17252c}.nav-group-links{padding:2px 0 8px 10px}.nav-link[hidden],.nav-group[hidden],.nav-frequent[hidden],.nav-all-title[hidden]{display:none!important}
.nav-group-links .nav-symbol{display:none}.nav-group-links .nav-link{padding-left:17px}

/* Formularios con contexto */
.record-form{gap:0}.form-section,.user-fields{grid-column:1/-1}.form-section{border:0;border-top:1px solid var(--line);margin:0;padding:18px 0 21px;min-width:0}.form-section:first-of-type{border-top:0;padding-top:0}.form-section legend{padding:0 0 13px;color:var(--ink);font-size:.91rem;font-weight:800}.form-section-fields,.user-fields{display:grid;gap:16px}.field-hint{display:block;margin-top:6px;color:var(--muted);font-size:.72rem;line-height:1.4}.draft-note,.form-error{grid-column:1/-1;margin:0 0 15px;padding:12px 14px;border-radius:10px;font-size:.8rem;line-height:1.45}.draft-note{background:#e8f4f7;color:#245366}.form-error{background:#fcebec;color:#853439;border:1px solid #e9b5b8}.form-error[hidden]{display:none}.flow-banner{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px 15px;margin-bottom:17px;background:#e4f4f8;border-radius:12px;color:#174557}.flow-banner strong,.flow-banner span{display:block}.flow-banner strong{font-size:.84rem}.flow-banner span{font-size:.75rem;line-height:1.4;margin-top:4px}.flow-banner button{min-height:44px;padding:0 8px;border:0;background:transparent;color:#075d78;font-weight:750;font-size:.76rem}
.form-field [aria-invalid="true"]{border-color:var(--danger);box-shadow:0 0 0 2px #f7dfe0}
@media(min-width:600px){.form-section-fields,.user-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.form-section-fields .full{grid-column:1/-1}}

/* Proyectos: alertas, plazo y ficha */
.alert-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.alert-chips.compact{margin-top:6px}
.alert-chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:6px 9px;border-radius:8px;font-size:.72rem;line-height:1.25;font-weight:700;background:#e8eff2;color:#445f6b}
.alert-chip svg{width:14px;height:14px}.alert-chips.compact .alert-chip{padding:3px 7px;font-size:.66rem}
.alert-chip.overdue,.alert-chip.critical{background:#f9e4e5;color:#a3393e}.alert-chip.warning,.alert-chip.overBudget{background:#fff1d9;color:#885317}.alert-chip.receivable{background:#e3f4f8;color:#075f7a}
.deadline-line{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin:12px 0 0;font-size:.76rem;color:#3c525d}.deadline-line svg{width:15px;height:15px;color:#6b7f89}
.deadline-line.overdue,.deadline-line.critical{color:var(--danger)}.deadline-line.warning{color:#885317}
.cell-note{display:block;color:var(--muted);font-size:.7rem;margin-top:2px}
.record-actions .sheet-action{color:var(--ink)}
.count-pill{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;margin-left:4px;border-radius:999px;background:var(--danger);color:#fff;font-size:.7rem;vertical-align:middle}
.alerts-panel{margin:0 0 18px}.alerts-panel .section-head h2{display:flex;align-items:center;gap:7px}.alerts-panel .section-head h2 svg{color:var(--danger)}
.alert-list{display:flex;flex-direction:column}
.alert-row{display:flex;align-items:center;gap:12px;width:100%;min-height:58px;padding:11px 17px;border:0;border-bottom:1px solid #edf1f3;background:#fff;text-align:left;color:inherit}
.alert-row:last-child{border-bottom:0}.alert-row:active,.alert-row:hover{background:#f6fafb}.alert-row>svg{color:#8a9aa2;width:16px;height:16px}
.alert-level{flex:0 0 auto;min-width:86px;padding:4px 7px;border-radius:7px;font-size:.66rem;font-weight:800;text-align:center;background:#e8eff2;color:#445f6b}
.alert-row.overdue .alert-level,.alert-row.critical .alert-level{background:#f9e4e5;color:#a3393e}.alert-row.warning .alert-level,.alert-row.overBudget .alert-level{background:#fff1d9;color:#885317}.alert-row.receivable .alert-level{background:#e3f4f8;color:#075f7a}
.alert-text{flex:1;min-width:0}.alert-text strong{display:block;font-size:.84rem;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.alert-text small{display:block;color:var(--muted);font-size:.74rem;margin-top:2px}
.project-sheet .dialog-header h2{margin:2px 0 7px}.sheet-kicker{display:block;color:var(--muted);font-size:.74rem;font-weight:650}
.sheet-alerts{padding:14px 20px 0;margin:0}
.sheet-section{padding:17px 20px;border-bottom:1px solid #edf1f3}
.sheet-section h3{display:flex;align-items:center;gap:7px;margin:0 0 13px;font-size:.88rem;color:var(--ink)}.sheet-section h3 svg{width:17px;height:17px;color:var(--accent-strong)}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.sheet-head h3{margin-bottom:8px}
.kv-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;margin:0}
.kv-grid div{min-width:0}.kv-grid dt{font-size:.69rem;color:#647680;margin-bottom:2px}.kv-grid dd{margin:0;font-size:.84rem;color:#253943;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.dual-bar{display:grid;grid-template-columns:118px 1fr 44px;align-items:center;gap:10px;margin-top:12px;font-size:.74rem;color:#526670}
.dual-bar b{text-align:right;color:#075f7a;font-variant-numeric:tabular-nums}
.dual-bar progress{width:100%;height:8px;border:0;border-radius:999px;overflow:hidden;background:#e1e9ec;-webkit-appearance:none;appearance:none}
.dual-bar progress::-webkit-progress-bar{background:#e1e9ec;border-radius:999px}.dual-bar progress::-webkit-progress-value{background:#008fb2;border-radius:999px}.dual-bar progress::-moz-progress-bar{background:#008fb2;border-radius:999px}
.dual-bar:first-of-type progress::-webkit-progress-value{background:#a9abb1}.dual-bar:first-of-type progress::-moz-progress-bar{background:#a9abb1}
.extension-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.extension-list li{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:11px 12px;border:1px solid var(--line);border-radius:10px}
.extension-list strong{font-size:.82rem;color:var(--ink)}.extension-list small{display:block;color:var(--muted);font-size:.72rem;margin-top:2px}.extension-list p{margin:6px 0 0;font-size:.8rem;color:#33474f}
.extension-form{margin-top:12px;padding:14px;border-radius:10px;background:var(--surface)}.extension-form .dialog-actions{padding:12px 0 0;border:0;position:static;background:none}
.latest-progress{padding:11px 12px;border-left:3px solid var(--accent);background:var(--accent-light);border-radius:0 10px 10px 0;margin-bottom:12px}
.latest-progress strong{font-size:.8rem;color:#075f7a}.latest-progress p{margin:5px 0 0;font-size:.82rem}.latest-progress small{display:block;color:var(--muted);margin-top:4px;font-size:.72rem}
.doc-counts{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.doc-counts li{display:flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid var(--line);border-radius:9px;font-size:.78rem}.doc-counts b{color:var(--accent-strong)}
.sheet-empty{margin:0;font-size:.8rem}
.project-sheet>.dialog-actions{margin:0;padding:13px 20px calc(14px + env(safe-area-inset-bottom))}
.extension-form .dialog-actions{margin:0}
.file-form select{min-height:44px;border:1px solid #c7d3d8;border-radius:10px;padding:0 10px;background:#fff;color:var(--ink)}
@media(max-width:350px){.kv-grid{grid-template-columns:1fr}.dual-bar{grid-template-columns:96px 1fr 40px}}
.form-field input[readonly]{background:#eef3f5;color:#3c525d}

/* Ventas y cobros (v4) */
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.alert-chip.uninvoiced,.alert-row.uninvoiced .alert-level{background:#fff4e5;color:#8a4b00}
.revenue-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.revenue-item{border:1px solid var(--line);border-radius:11px;padding:11px 12px;display:grid;gap:8px}
.revenue-main{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.revenue-main strong{display:block;font-size:.88rem;color:var(--ink)}
.revenue-main small{display:block;font-size:.74rem;color:var(--muted);margin-top:2px;overflow-wrap:anywhere}
.allocation-list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.allocation-list li{display:inline-flex;align-items:center;gap:2px;padding:2px 2px 2px 10px;border-radius:999px;background:var(--accent-light);color:var(--accent-strong);font-size:.75rem;font-weight:650}
.allocation-list .icon-btn{width:32px;height:32px;min-height:32px}
.allocation-form{display:grid;grid-template-columns:minmax(0,1fr) 110px auto;gap:6px}
.allocation-form select,.allocation-form input{min-height:40px;min-width:0;border:1px solid var(--line);border-radius:9px;padding:0 9px;font:inherit;font-size:.8rem;background:white}
.allocation-form button{min-height:40px;padding:0 12px}
.sheet-subhead{font-size:.76rem;color:var(--muted);margin:14px 0 8px;text-transform:uppercase;letter-spacing:.04em}
.finance-panel{margin-bottom:16px}
.finance-panel .section-head h2 svg{color:var(--accent)}
.finance-panel h3{font-size:.8rem;margin:0 0 10px;color:var(--ink)}
.month-picker input{min-height:40px;border:1px solid var(--line);border-radius:9px;padding:0 9px;font:inherit;font-size:.82rem;background:white;color:var(--ink)}
.finance-kpis{display:grid;grid-template-columns:1fr;gap:1px;background:var(--line);border-bottom:1px solid var(--line)}
.finance-kpi{background:white;padding:14px 17px;display:grid;gap:3px}
.finance-kpi small{font-size:.72rem;color:var(--muted)}
.finance-kpi strong{font-size:1.35rem;font-variant-numeric:tabular-nums;color:var(--ink)}
.finance-kpi span{font-size:.72rem;color:var(--muted)}
.finance-trend,.finance-columns,.margin-table{padding:15px 17px;border-bottom:1px solid var(--line)}
.trend-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}
.trend-head h3{margin:0}
.trend-legend{display:flex;gap:12px;font-size:.72rem;color:var(--muted)}
.trend-legend span{display:inline-flex;align-items:center;gap:5px}
.swatch{width:10px;height:10px;border-radius:3px;display:inline-block}
.swatch.income,.trend-bars .income{background:#008fb2}
.swatch.outflow,.trend-bars .outflow{background:#c2410c}
.trend-rows{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.trend-rows li{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:10px;font-size:.76rem;color:var(--muted)}
.trend-rows li.current .trend-month{color:var(--ink);font-weight:750}
.trend-rows b{font-variant-numeric:tabular-nums;color:#253943;font-weight:650;min-width:88px;text-align:right}
.trend-bars{display:grid;gap:2px}
.trend-bars .bar{display:block;height:8px;border-radius:0 4px 4px 0;min-width:0}
.trend-table{margin-top:10px;font-size:.78rem}
.trend-table summary{cursor:pointer;color:var(--accent-strong);font-weight:700;min-height:32px;display:flex;align-items:center}
.trend-table table,.margin-table table{width:100%;border-collapse:collapse;font-size:.78rem}
.trend-table th,.trend-table td,.margin-table th,.margin-table td{padding:7px 8px;border-bottom:1px solid var(--line);text-align:left}
.trend-table .num,.margin-table .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.finance-columns{display:grid;gap:18px}
.account-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.account-list div{display:flex;justify-content:space-between;gap:8px;font-size:.8rem}
.account-list small{color:var(--muted)}
.account-list b{font-variant-numeric:tabular-nums}
.share{display:block;height:6px;border-radius:999px;background:var(--surface);margin-top:4px;overflow:hidden}
.share span{display:block;height:100%;background:#008fb2;border-radius:999px}
.table-wrap.always{display:block;overflow-x:auto}
.margin-table small{color:var(--muted)}
.link-btn{border:0;background:none;padding:0;min-height:32px;font:inherit;color:var(--accent-strong);font-weight:700;text-align:left;cursor:pointer}
.finance-note{margin:0;padding:12px 17px;font-size:.72rem;color:var(--muted)}
@media(min-width:600px){.finance-kpis{grid-template-columns:repeat(3,1fr)}.finance-columns{grid-template-columns:1fr 1fr}}
.trend-rows b.danger-text,.finance-kpi strong.danger-text{color:var(--danger)}
.allocation-form{grid-template-columns:minmax(0,1fr) auto}.allocation-form select{grid-column:1/-1}
/* Ficha de proveedor: sucursales con contactos editables */
.supplier-sheet .branch-search{margin-bottom:12px}
.branch-list{display:flex;flex-direction:column;gap:8px}
.branch-item{border:1px solid #e2e9ec;border-radius:12px;background:#fff}
.branch-item[open]{border-color:#b9ccd3}
.branch-item summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:10px 14px;cursor:pointer;list-style:none}
.branch-item summary::-webkit-details-marker{display:none}
.branch-item summary strong{display:block;font-size:.88rem;color:var(--ink)}
.branch-item summary small{display:block;margin-top:2px;font-size:.74rem;color:var(--muted)}
.branch-item summary .badge{flex-shrink:0}
.branch-body{padding:0 14px 14px;border-top:1px solid #edf1f3}
.branch-body p{margin:12px 0 0;font-size:.82rem;color:#253943}
.branch-links{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:10px;font-size:.82rem}
.branch-contacts{display:grid;gap:12px;margin-top:14px}
.branch-contact{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0;padding:0;border:0}
.branch-contact legend{padding:0;margin-bottom:6px;font-size:.76rem;font-weight:750;color:var(--ink)}
.branch-contacts .secondary{justify-self:start}
@media(max-width:350px){.branch-contact{grid-template-columns:1fr}}
.count-pill.neutral{background:#e6eef1;color:#194954}
/* Ficha de compra: documento, reparto por obra y líneas editables */
.purchase-sheet .mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.74rem;overflow-wrap:anywhere}
.purchase-sheet .kv-grid small{display:block;font-size:.7rem}
.sheet-note{margin:12px 0 0;padding:10px 12px;border-radius:10px;background:#f4f7f8;font-size:.8rem;color:#253943}
.purchase-next{margin:14px 20px 0;display:flex;flex-direction:column;align-items:stretch;gap:10px}
.purchase-next .primary{width:100%}
.allocation-list,.purchase-lines{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.allocation-list li,.purchase-lines li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid #edf1f3;font-size:.84rem}
.allocation-list li:last-child,.purchase-lines li:last-child{border-bottom:0}
.purchase-lines li div{min-width:0}.purchase-lines strong{display:block;font-size:.82rem;color:var(--ink)}
.purchase-lines small{display:block;margin-top:2px;font-size:.72rem;color:var(--muted)}
.purchase-lines b{flex-shrink:0}
.purchase-line{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 12px;padding:12px;border:1px solid #e2e9ec;border-radius:12px}
.purchase-line legend{padding:0 4px;font-size:.74rem;font-weight:750;color:var(--muted)}
.purchase-line .full{grid-column:1/-1}
.purchase-line .line-remove{position:absolute;top:-14px;right:8px;background:#fff}
.lines-sum{margin:4px 0 12px;font-size:.8rem;font-weight:700}
.lines-sum.ok{color:#1f6b3a}.lines-sum.off{color:var(--danger)}
#lines-form>.secondary{width:100%}
@media(min-width:900px){.purchase-line{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Tarjetas de Proyectos, Compras y Proveedores (v7) */
.tone-ok{--tone:#008fb2;--tone-text:#006f8e}.tone-warn{--tone:#d18b1f;--tone-text:#8a5208}.tone-late{--tone:#c2474a;--tone-text:#a3393e}.tone-done{--tone:#2f8a5b;--tone-text:#1f6b45}.tone-paused,.tone-none{--tone:#a9abb1;--tone-text:#53636d}
.card-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr))}
.table-panel.is-cards{background:transparent;border:0;border-radius:0;overflow:visible}
.project-card,.expense-card,.supplier-card{position:relative;display:flex;flex-direction:column;min-width:0;background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px 18px 6px;transition:border-color .2s,box-shadow .25s,transform .25s cubic-bezier(.2,.8,.2,1)}
.project-card h2,.expense-card h2,.supplier-card h2{margin:10px 0 0;font-size:1.1rem;line-height:1.25;letter-spacing:-.015em;color:var(--ink)}
.card-title{display:inline;border:0;background:none;padding:0;margin:0;font:inherit;color:inherit;text-align:left;overflow-wrap:anywhere;border-radius:4px}
.card-title:hover{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px;text-decoration-color:var(--accent)}
.project-card .record-actions,.expense-card .record-actions,.supplier-card .record-actions{margin-top:auto;padding-top:6px}
.project-card>.record-actions,.expense-card>.record-actions,.supplier-card>.record-actions{border-top:1px solid #e9eef0;margin-top:auto}
.project-card .card-facts,.supplier-card .card-facts{margin-bottom:14px}
.card-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;margin:16px 0 0}
.card-facts div{min-width:0}.card-facts dt{font-size:.69rem;color:#647680;margin-bottom:2px}
.card-facts dd{margin:0;font-size:.86rem;font-weight:650;color:#1d3039;overflow-wrap:anywhere}
.card-facts dd small{display:block;font-size:.72rem;font-weight:650;color:var(--muted);margin-top:2px}
.card-facts dd small.warning{color:#8a5208}.card-facts dd small.critical,.card-facts dd small.overdue{color:var(--danger)}
.record-actions .count-pill{margin-left:0}
@media(hover:hover){.project-card:hover,.expense-card:hover,.supplier-card:hover{border-color:#b9ccd3;box-shadow:0 14px 30px -20px rgba(11,14,17,.45);transform:translateY(-2px)}.record-actions button:hover{background:#eef7f9}}

/* Proyecto: la franja superior y la cinta toman el color del ritmo de obra */
.project-card{padding-top:20px;overflow:hidden}
.project-card:before{content:"";position:absolute;left:0;right:0;top:0;height:4px;background:var(--tone)}
.pc-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.pc-meta{display:flex;align-items:center;gap:8px;min-width:0;font-size:.76rem;color:var(--muted)}
.pc-meta>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pc-code{flex-shrink:0;padding:3px 7px;border-radius:6px;background:var(--ink);color:#fff;font-size:.68rem;font-weight:800;letter-spacing:.04em}
.tape{margin-top:16px}
.tape-read{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:10px}
.tape-value{display:flex;align-items:baseline;font-size:2.75rem;font-weight:800;line-height:.9;letter-spacing:-.055em;color:var(--ink);font-variant-numeric:tabular-nums}
.tape-value small{font-size:1.05rem;font-weight:750;letter-spacing:0;margin-left:3px;color:var(--muted)}
.tone-none .tape-value{color:#a5b2b8}
.tape-note{padding-bottom:3px;font-size:.78rem;font-weight:750;line-height:1.25;color:var(--tone-text);text-align:right}
.tape-track{position:relative;height:16px;border-radius:5px;background:#e6ecef}
.tape-track:after{content:"";position:absolute;inset:auto 0 0;height:6px;background:repeating-linear-gradient(90deg,transparent 0 calc(10% - 1px),rgba(11,14,17,.22) calc(10% - 1px) 10%);pointer-events:none}
.tape-fill{position:absolute;left:0;top:0;bottom:0;width:var(--fill,0%);border-radius:5px;background:var(--tone,var(--accent))}
.tape-mark{position:absolute;z-index:1;top:-6px;bottom:-6px;left:var(--mark,0%);width:3px;margin-left:-1.5px;border-radius:2px;background:var(--ink);box-shadow:0 0 0 2px #fff}
.tape-legend{display:flex;justify-content:flex-end;margin-top:10px;font-size:.72rem;color:var(--muted)}
.tape-legend span{display:inline-flex;align-items:center;gap:6px}
.key-mark{display:inline-block;width:3px;height:12px;border-radius:2px;background:var(--ink)}
.project-card .alert-chips{margin:0 0 12px}

/* Compras */
.ec-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:.76rem;color:var(--muted)}
.review-state{display:inline-flex;align-items:center;gap:6px;padding:4px 9px 4px 8px;border-radius:999px;font-size:.72rem;font-weight:750;background:#fff1d9;color:#7a4a10}
.review-state:before{content:"";width:7px;height:7px;border-radius:50%;background:#d18b1f}
.is-approved .review-state{background:#e0f3e8;color:#176b49}.is-approved .review-state:before{background:#2f8a5b}
.ec-route{display:flex;align-items:center;gap:7px;min-width:0;margin:8px 0 0;font-size:.8rem;color:#3c525d}
.ec-route span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ec-route svg{width:14px;height:14px;color:#8a9aa2}
.ec-total{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin-top:16px}
.ec-total strong{font-size:1.6rem;font-weight:800;letter-spacing:-.035em;color:var(--ink)}
.ec-doc{margin:4px 0 14px;font-size:.74rem;color:var(--muted)}
.expense-card .ec-total+.record-actions{margin-top:14px}

/* Proveedores */
.sc-head{display:flex;align-items:flex-start;gap:13px}
.sc-head>div{min-width:0}
.sc-head h2{margin-top:1px}
.sc-head p{margin:4px 0 0;font-size:.78rem;line-height:1.35;color:var(--muted)}
.sc-mono{flex-shrink:0;width:46px;height:46px;display:grid;place-items:center;border-radius:12px;background:var(--ink);color:#5fd3ee;font-weight:800;letter-spacing:.03em}
.sc-reach{display:grid;gap:6px;margin-top:15px}
.reach{display:flex;align-items:center;gap:10px;min-width:0;min-height:44px;padding:0 12px;border-radius:10px;background:var(--surface);color:var(--ink);font-size:.84rem;font-weight:650;text-decoration:none;transition:background .15s}
.reach span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reach svg{width:17px;height:17px;color:var(--accent-strong)}
.reach:hover,.reach:active{background:var(--accent-light)}
.supplier-card .sc-reach+.record-actions,.supplier-card .sc-head+.record-actions{margin-top:16px}

/* Filtros por estado */
.filter-bar{display:flex;gap:8px;margin:0 -16px 14px;padding:2px 16px;overflow-x:auto;scrollbar-width:none}
.filter-bar::-webkit-scrollbar{display:none}
.filter-option{flex-shrink:0;display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:0 8px 0 15px;border:1px solid #cad7dc;border-radius:999px;background:#fff;color:#2c4450;font-size:.84rem;font-weight:700;transition:background .18s,color .18s,border-color .18s}
.filter-option b{min-width:26px;height:26px;display:grid;place-items:center;padding:0 7px;border-radius:999px;background:#e8eff2;color:#2c4450;font-size:.74rem;font-variant-numeric:tabular-nums;transition:inherit}
.filter-option[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.filter-option[aria-pressed="true"] b{background:#1d4855;color:#7fe0f5}
.filter-bar.with-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin:0 0 14px;padding:0;overflow:visible}
.with-totals .filter-option{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 8px;padding:12px 12px 12px 14px;border-radius:14px;text-align:left}
.with-totals .filter-option small{grid-column:1/-1;font-size:1.08rem;font-weight:800;letter-spacing:-.02em;color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.with-totals .filter-option[aria-pressed="true"] small{color:#fff}

/* Inicio: avance en proyectos recientes */
.mini-progress{display:flex;align-items:center;gap:8px;margin-top:7px}
.mini-track{position:relative;flex:0 1 150px;height:6px;border-radius:3px;background:#e6ecef;overflow:hidden}
.mini-progress b{font-size:.69rem;font-weight:700;color:#3c525d;white-space:nowrap;font-variant-numeric:tabular-nums}

/* Tabla de Compras */
th.num-col,td.num-col{text-align:right}
td.num-col{font-weight:750;color:var(--ink)}
tbody tr{transition:background .15s}
tbody tr:hover td{background:#f6fafb}

/* Movimiento: entrada de sección, apertura de hojas y respuesta al toque */
@keyframes rise{from{opacity:0;transform:translateY(12px)}}
@keyframes fade-in{from{opacity:0}}
@keyframes tape-grow{from{width:0}}
@keyframes mark-in{from{opacity:0;transform:scaleY(0)}}
@keyframes sheet-up{from{opacity:0;transform:translateY(48px)}}
@keyframes pop-in{from{opacity:0;transform:translateY(14px) scale(.98)}}
.main.is-entering>*{animation:fade-in .3s ease both}
.main.is-entering .records>*{animation:rise .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i,0)*50ms)}
.main.is-entering .tape-fill,.main.is-entering .mini-track .tape-fill{animation:tape-grow 1s cubic-bezier(.25,.8,.25,1) both;animation-delay:calc(var(--i,0)*50ms + 150ms)}
.main.is-entering .tape-mark{animation:mark-in .35s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i,0)*50ms + 850ms)}
.main.is-entering .dashboard-lead,.main.is-entering .quick-section,.main.is-entering .overview-top,.main.is-entering .alerts-panel{animation:rise .5s cubic-bezier(.2,.8,.2,1) both}
.main.is-entering .quick-section{animation-delay:60ms}.main.is-entering .overview-top{animation-delay:120ms}.main.is-entering .alerts-panel{animation-delay:180ms}
.dialog-backdrop.is-opening{animation:fade-in .22s ease both}
.dialog-backdrop.is-opening .dialog{animation:sheet-up .4s cubic-bezier(.2,.9,.25,1) both}
@media(min-width:600px){.dialog-backdrop.is-opening .dialog{animation-name:pop-in;animation-duration:.3s}.filter-bar:not(.with-totals){margin:0 0 14px;padding:2px 0;flex-wrap:wrap}}
.primary,.secondary,.destructive,.filter-option,.quick-link,.bottom-tab,.nav-link,.record-actions button,.icon-btn{transition:background-color .15s,color .15s,border-color .15s,transform .12s}
.filter-option:active,.reach:active,.record-actions button:active,.icon-btn:active{transform:scale(.97)}
#toast{transition:opacity .25s,transform .3s cubic-bezier(.2,.9,.25,1)}
@media(min-width:950px){.card-grid{gap:16px}.table-panel.is-cards .table-tools{padding:0;margin:0 0 16px;border:0}.with-totals{max-width:760px}}
@media(prefers-reduced-motion:reduce){.project-card,.expense-card,.supplier-card{transition:none}.project-card:hover,.expense-card:hover,.supplier-card:hover{transform:none}}
.record-actions .sheet-action{flex:1;justify-content:flex-start;padding:0 10px}
.record-actions .icon-action{flex:0 0 44px;width:44px}
td.wrap{white-space:normal;min-width:120px;line-height:1.35}
@media(max-width:599px){.filter-bar.with-totals{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.with-totals .filter-option{padding:10px 9px;gap:3px 4px;font-size:.74rem}.with-totals .filter-option b{min-width:22px;height:22px;padding:0 5px;font-size:.68rem}.with-totals .filter-option small{font-size:.86rem;letter-spacing:-.03em}}

/* Menú del teléfono: pantalla propia con áreas en cuadrícula (v8) */
.app-menu{position:fixed;z-index:17;top:0;left:0;right:0;bottom:calc(68px + env(safe-area-inset-bottom));display:flex;flex-direction:column;background:#eef2f3;padding-top:env(safe-area-inset-top)}
.menu-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 10px;background:#eef2f3}
.menu-head h2{margin:0;font-size:2rem;line-height:1.05;letter-spacing:-.035em;color:var(--ink);outline:0}
.menu-close{width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:50%;background:#dfe6e9;color:var(--ink)}
.menu-scroll{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:4px 16px 28px}
.menu-profile{position:relative;display:flex;align-items:center;gap:13px;padding:16px;border-radius:18px;background:var(--ink);color:#fff;overflow:hidden}
.menu-profile img{position:absolute;right:-18px;top:50%;width:112px;height:112px;transform:translateY(-50%);object-fit:contain;mix-blend-mode:screen;opacity:.22;pointer-events:none}
.menu-profile>div{position:relative;min-width:0}
.menu-profile b{display:block;font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.menu-profile small{display:block;margin-top:3px;font-size:.76rem;color:#a9bcc4}
.menu-avatar{position:relative;flex-shrink:0;width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:#008fb2;color:#fff;font-size:1.15rem;font-weight:800}
.menu-search{display:flex;align-items:center;gap:10px;height:48px;margin:14px 0 4px;padding:0 14px;border-radius:14px;background:#fff;border:1px solid #d3dde1;color:#53727e}
.menu-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px #d5eff5}
.menu-search svg{width:19px;height:19px}
.menu-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font-size:1rem}
.menu-area{margin-top:20px}
.menu-area h3{margin:0 0 9px 2px;font-size:.84rem;font-weight:750;color:#3c525d}
.menu-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.menu-tile{min-width:0;min-height:96px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:13px 6px 10px;border:1px solid #e0e7ea;border-radius:16px;background:#fff;color:#1d3039;text-align:center}
.menu-icon{width:40px;height:40px;flex-shrink:0;display:grid;place-items:center;border-radius:12px;background:#e3f4f8;color:var(--accent-strong)}
.menu-icon svg{width:21px;height:21px}
.menu-label{font-size:.74rem;font-weight:650;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.menu-tile[aria-current="page"]{background:var(--ink);border-color:var(--ink);color:#fff}
.menu-tile[aria-current="page"] .menu-icon{background:#173d49;color:#5fd3ee}
.menu-tile:active,.menu-row:active{transform:scale(.96)}
.menu-list{display:flex;flex-direction:column;border-radius:16px;background:#fff;border:1px solid #e0e7ea;overflow:hidden}
.menu-row{display:flex;align-items:center;gap:12px;min-height:58px;padding:9px 14px 9px 10px;border:0;border-bottom:1px solid #edf1f3;background:#fff;color:#1d3039;font-size:.9rem;font-weight:650;text-align:left}
.menu-row:last-child{border-bottom:0}
.menu-row .menu-icon{width:36px;height:36px;border-radius:10px}
.menu-row>span:nth-child(2){flex:1}
.menu-row>svg:last-child{width:17px;height:17px;color:#9aabb2}
.menu-row[aria-current="page"]{background:#e9f5f8}
.menu-tile[hidden],.menu-row[hidden],.menu-area[hidden],.menu-empty[hidden]{display:none}
.menu-empty{margin:28px 0 0;text-align:center;font-size:.86rem;color:var(--muted)}
.menu-logout{width:100%;display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;margin-top:24px;border:1px solid #ecd2d3;border-radius:16px;background:#fff;color:var(--danger);font-size:.9rem;font-weight:750}
.menu-tile,.menu-row,.menu-logout,.menu-close{transition:background-color .15s,transform .12s}
@keyframes menu-in{from{opacity:0;transform:translateY(22px)}}
@keyframes tile-in{from{opacity:0;transform:translateY(8px) scale(.96)}}
.app-menu.is-opening{animation:menu-in .32s cubic-bezier(.2,.9,.25,1) both}
.app-menu.is-opening .menu-tile,.app-menu.is-opening .menu-row{animation:tile-in .36s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i,0)*18ms + 90ms)}
@media(min-width:430px){.menu-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:949px){.sidebar{display:none}}
@media(min-width:950px){.app-menu{display:none}}
@media(max-width:350px){.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.menu-profile img{right:12px;width:58px;height:58px;opacity:.95;clip-path:inset(2.2% 4.5% 4% 4.5%)}
.menu-profile>div{padding-right:62px}

/* Inicio: parte del día y capítulos (v9) */
.home{display:grid;gap:16px}
.home-hero{position:relative;overflow:hidden;padding:22px 20px 20px;border-radius:22px;background:var(--ink);color:#fff}
.home-hero:after{content:"";position:absolute;right:-70px;top:-90px;width:230px;height:230px;border-radius:50%;border:1px solid rgba(95,211,238,.18);pointer-events:none}
.home-date{margin:0;font-size:.8rem;color:#8fb3bf}
.home-date:first-letter{text-transform:uppercase}
.home-hero h1{margin:6px 0 0;font-size:1.05rem;font-weight:700;color:#b9d8e1;letter-spacing:-.01em}
.home-story{position:relative;max-width:34ch;margin:10px 0 0;font-size:clamp(1.3rem,5.4vw,1.85rem);font-weight:680;line-height:1.28;letter-spacing:-.022em;color:#f2f8fa}
.home-hero .primary{margin-top:18px}
.home-band{display:flex;gap:3px;height:16px;margin-top:22px}
.band-seg{flex:1 1 0;min-width:8px;border-radius:4px;background:var(--tone)}
.band-legend{display:flex;flex-wrap:wrap;gap:6px 14px;margin:12px 0 0;padding:0;list-style:none;font-size:.76rem;color:#c3d6dc}
.band-legend li{display:inline-flex;align-items:center;gap:6px}
.band-legend i{width:10px;height:10px;border-radius:3px;background:var(--tone)}
.band-legend b{color:#fff;font-variant-numeric:tabular-nums}
.home-hero .tone-none,.band-seg.tone-none{--tone:#56646b}
.home-columns{display:grid;gap:16px}
.home-col{display:grid;gap:16px;align-content:start}
.home-chapter{min-width:0;padding:18px;border-radius:18px;background:#fff;border:1px solid var(--line)}
.chapter-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.chapter-head h2{margin:0;font-size:1.15rem;line-height:1.2;letter-spacing:-.02em;color:var(--ink)}
.chapter-head .count-pill{margin-left:auto;background:#f9e4e5;color:#a3393e}
.chapter-head .count-pill+.text-action{margin-left:0}
.chapter-lead{margin:6px 0 14px;font-size:.84rem;line-height:1.45;color:var(--muted);max-width:60ch}
.chapter-calm{margin:12px 0 0;padding:14px;border-radius:12px;background:#eef7f2;color:#1f5f3f;font-size:.86rem;line-height:1.45}

/* Qué atender hoy */
.todo-list{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:6px}
.todo-row{--t:#445f6b;--tb:#e8eff2;width:100%;display:flex;align-items:center;gap:12px;min-height:60px;padding:10px 12px;border:0;border-radius:14px;background:#f5f8f9;text-align:left;color:var(--ink);transition:background .15s,transform .12s}
.todo-row:hover{background:#edf3f5}.todo-row:active{transform:scale(.98)}
.todo-row.tone-overdue,.todo-row.tone-critical{--t:#a3393e;--tb:#f9e4e5}
.todo-row.tone-warning,.todo-row.tone-overBudget{--t:#8a5208;--tb:#fff1d9}
.todo-row.tone-receivable,.todo-row.tone-uninvoiced{--t:#8a4b00;--tb:#fff4e5}
.todo-icon{flex-shrink:0;width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:var(--tb);color:var(--t)}
.todo-icon svg{width:19px;height:19px}
.todo-text{flex:1;min-width:0}
.todo-text strong{display:block;font-size:.88rem;line-height:1.25;overflow-wrap:anywhere}
.todo-text small{display:block;margin-top:2px;font-size:.76rem;color:var(--muted)}
.todo-row>svg:last-child{width:16px;height:16px;color:#9aabb2}
.todo-more{margin-top:8px}
.todo-more summary{min-height:40px;display:flex;align-items:center;cursor:pointer;color:var(--accent-strong);font-size:.82rem;font-weight:750}

/* Cómo van las obras */
.work-list{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.work-row{width:100%;display:grid;gap:9px;padding:12px 4px;border:0;border-bottom:1px solid #edf1f3;background:none;text-align:left;color:var(--ink);border-radius:0}
.records-item:last-child .work-row{border-bottom:0}
.work-row:hover strong{text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:3px}
.work-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.work-top strong{display:flex;align-items:center;gap:7px;min-width:0;font-size:.9rem;line-height:1.25}
.work-top b{font-size:1.15rem;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.work-row .tape-track{height:10px;border-radius:4px}
.work-row .tape-track:after{height:4px}
.work-row .tape-fill{border-radius:4px}
.work-row .tape-mark{top:-5px;bottom:-5px}
.work-row small{font-size:.75rem;font-weight:650;color:var(--tone-text)}

/* Cómo está el dinero */
.flow-bars{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.flow-bars li{display:grid;grid-template-columns:82px minmax(0,1fr) auto;align-items:center;gap:10px;font-size:.8rem}
.flow-label{color:#3c525d;font-weight:650}
.flow-track{height:12px;border-radius:4px;background:#eef2f3;overflow:hidden}
.flow-fill{display:block;height:100%;width:var(--w,0%);border-radius:4px;background:var(--ink)}
.flow-invoiced .flow-fill{background:#5fb8cf}.flow-collected .flow-fill{background:#008fb2}.flow-cost .flow-fill{background:#c2410c}
.flow-bars b{min-width:70px;text-align:right;font-variant-numeric:tabular-nums;color:var(--ink)}
.money-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 0;padding-top:14px;border-top:1px solid #edf1f3}
.money-facts dt{font-size:.72rem;color:var(--muted)}
.money-facts dd{margin:3px 0 0;font-size:1rem;font-weight:800;letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--ink)}
.money-facts dd.danger-text{color:var(--danger)}

/* Lo que viene: línea de tiempo de entregas */
.ahead-list{list-style:none;margin:0;padding:0;position:relative}
.ahead-list:before{content:"";position:absolute;left:5px;top:10px;bottom:10px;width:2px;background:#e1e8eb}
.ahead-list li{position:relative;display:grid;grid-template-columns:104px minmax(0,1fr);gap:10px;padding:8px 0 8px 22px}
.ahead-list li:before{content:"";position:absolute;left:0;top:14px;width:12px;height:12px;border-radius:50%;background:var(--tone);box-shadow:0 0 0 3px #fff}
.ahead-when b{display:block;font-size:.82rem;color:var(--ink)}
.ahead-when small{display:block;font-size:.72rem;color:var(--muted);margin-top:1px}
.ahead-what{min-width:0;border:0;background:none;padding:0;text-align:left;color:var(--ink)}
.ahead-what strong{display:block;font-size:.86rem;line-height:1.25;overflow-wrap:anywhere}
.ahead-what small{display:block;margin-top:2px;font-size:.74rem;color:var(--muted)}
.ahead-what:hover strong{text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:3px}
.home-activity .activity-list{padding:4px 0 0}
.home .finance-panel{margin:0;border-radius:18px}

/* Entrada del Inicio: la franja de obras se dibuja de izquierda a derecha y luego las barras */
@keyframes band-draw{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes grow-w{from{width:0}}
.main.is-entering .home-hero{animation:fade-in .35s ease both}
.main.is-entering .home-band{animation:band-draw 1.1s cubic-bezier(.3,.7,.2,1) .2s both}
.main.is-entering .home-columns{animation:rise .5s cubic-bezier(.2,.8,.2,1) .25s both}
.main.is-entering .flow-fill{animation:grow-w .9s cubic-bezier(.25,.8,.25,1) .5s both}
.main.is-entering .work-row .tape-fill{animation-delay:calc(var(--i,0)*60ms + 450ms)}
.main.is-entering .work-row .tape-mark{animation-delay:calc(var(--i,0)*60ms + 1100ms)}

@media(min-width:600px){.home-hero{padding:28px 30px 26px}}
@media(min-width:1100px){.home-columns{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}.home-hero{padding:32px 36px 28px}}
.money-facts dd small{display:block;margin-top:2px;font-size:.72rem;font-weight:600;letter-spacing:0;color:var(--muted)}
@media(min-width:950px){.sidebar{top:0;align-self:flex-start}.home-story{max-width:40ch}}

/* Auditoría (v10): avisos de respaldo y gestión de usuarios */
.sheet-note.warn{display:flex;align-items:flex-start;gap:8px;background:#fff1d9;color:#7a4a10;font-weight:650}
.sheet-note.warn svg{width:16px;height:16px;margin-top:1px}
.sheet-note.xml{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.sheet-note.xml span{min-width:0;overflow-wrap:anywhere}
.sheet-note.xml svg{width:16px;height:16px;vertical-align:-3px}
#user-password-form{display:grid;gap:4px}
#user-password-form .field-hint{margin:2px 0 14px;font-size:.76rem;color:var(--muted)}
#user-password-form .form-field span{display:block;margin-bottom:7px;color:#344a54;font-size:.8rem;font-weight:750}
.user-actions{margin-top:12px}
td .user-actions{border:0;margin:0;padding:0;justify-content:flex-end}
td .user-actions button{flex:0 0 auto;padding:0 10px}

/* v11 · Cotización emitida al crear un proyecto */
.quote-file{grid-column:1/-1}.quote-file input[type=file]{width:100%;min-height:48px;padding:7px;border:1px dashed var(--line);border-radius:10px;background:white;color:var(--muted);font-size:.8rem;cursor:pointer}.quote-file input[type=file]::file-selector-button{margin-right:12px;min-height:34px;padding:0 14px;border:0;border-radius:8px;background:#e4f4f8;color:#075d78;font-weight:750;font-size:.78rem;cursor:pointer}.quote-file input[type=file]:focus-visible{outline:2px solid #075d78;outline-offset:2px}

/* v12 · Crear el registro relacionado sin salir del formulario */
.field-label-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:28px}.field-label-row label{margin:0}.field-add{display:inline-flex;align-items:center;gap:5px;min-height:32px;padding:0 10px;border:0;border-radius:999px;background:#e4f4f8;color:#075d78;font-size:.74rem;font-weight:750;white-space:nowrap;cursor:pointer;transition:background .15s}.field-add:hover{background:#d2ecf3}.field-add:focus-visible{outline:2px solid #075d78;outline-offset:2px}.field-add svg{width:14px;height:14px}.flow-note{display:flex;gap:8px;align-items:flex-start}.flow-note svg{flex:none;width:16px;height:16px;margin-top:1px}

/* Facturas leídas con IA: subir, revisar el desglose y guardar */
.read-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.read-grid input{width:100%}
@media(max-width:420px){.read-grid{grid-template-columns:1fr}}
.invoice-read{display:flex;flex-direction:column;gap:10px}
.invoice-preview{display:block;max-width:100%;max-height:340px;margin:0 auto;border:1px solid #e2e9ec;border-radius:10px;object-fit:contain;background:#f4f7f8}
.read-warnings{display:block;margin:0;padding:10px 12px 10px 28px}
.read-warnings li{margin:2px 0}
#extraction-form .form-section{border:0;padding:0}

/* Subir factura con IA: tarjeta principal, botón flotante, lectura en curso y desglose */
.manual-row{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 22px;margin:-6px 0 16px}.manual-entry{color:var(--muted);font-size:.8rem}.manual-entry svg{width:15px;height:15px}
.scan-card{--glow:#3fd0f0;position:relative;overflow:hidden;display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px 16px;align-items:center;margin:0 0 18px;padding:20px 18px 18px;border-radius:20px;color:#fff;background:radial-gradient(120% 90% at 0% 0%,#14526a 0%,rgba(20,82,106,0) 60%),linear-gradient(155deg,#0b0e11 30%,#10303b);box-shadow:0 18px 40px -24px rgba(0,111,142,.75);animation:rise .45s cubic-bezier(.2,.9,.25,1) both;transition:transform .2s,box-shadow .2s}
.scan-card:after{content:"";position:absolute;inset:0;border-radius:inherit;border:1.5px dashed transparent;pointer-events:none;transition:border-color .2s}
.scan-card.is-dragging{transform:scale(1.01);box-shadow:0 0 0 3px rgba(63,208,240,.45),0 18px 40px -20px rgba(0,111,142,.9)}.scan-card.is-dragging:after{border-color:var(--glow)}
.scan-art{position:relative;width:66px;height:80px}
.scan-frame{position:absolute;inset:0;display:grid;place-items:center;overflow:hidden;border-radius:12px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.14)}
.scan-frame svg{width:40px;height:40px;stroke-width:1.4;color:#d9f6fd}
.scan-beam{position:absolute;left:0;right:0;top:0;height:45%;background:linear-gradient(180deg,rgba(63,208,240,0),rgba(63,208,240,.32));border-bottom:2px solid var(--glow,#3fd0f0);box-shadow:0 6px 14px -2px rgba(63,208,240,.7);animation:beam 2.4s cubic-bezier(.45,0,.55,1) infinite alternate;pointer-events:none}
.scan-spark{position:absolute;top:-9px;right:-11px;width:26px;height:26px;display:grid;place-items:center;border-radius:50%;background:var(--glow);color:#06242d;box-shadow:0 0 0 4px rgba(63,208,240,.18);animation:twinkle 2.8s ease-in-out infinite}
.scan-spark svg{width:15px;height:15px;fill:currentColor;stroke-width:1}
.scan-kicker{display:inline-flex;align-items:center;gap:5px;color:#8fe6f8;font-size:.7rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.scan-kicker svg{width:13px;height:13px;fill:currentColor;stroke-width:1}
.scan-copy h2{margin:4px 0 5px;font-size:1.18rem;line-height:1.2;letter-spacing:-.015em}
.scan-copy p{margin:0;color:#b9cdd4;font-size:.82rem;line-height:1.45}
.scan-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:10px}
.scan-primary,.scan-secondary{min-height:54px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:800;font-size:.92rem;border:1px solid transparent;transition:transform .15s,background .2s,box-shadow .2s}
.scan-primary{background:linear-gradient(180deg,#14b5dc,#0090b4);color:#fff;box-shadow:0 10px 22px -10px rgba(20,181,220,.9),inset 0 1px 0 rgba(255,255,255,.25)}
.scan-secondary{background:rgba(255,255,255,.06);color:#e9f8fc;border-color:rgba(255,255,255,.22)}
.scan-primary:active,.scan-secondary:active{transform:scale(.97)}
.scan-primary:focus-visible,.scan-secondary:focus-visible{outline:3px solid var(--glow);outline-offset:2px}
.scan-drop-hint{display:none}
@media(hover:hover) and (pointer:fine){.scan-actions [data-pick=camera]{display:none}.scan-actions{grid-template-columns:auto;justify-content:start}.scan-secondary{background:linear-gradient(180deg,#14b5dc,#0090b4);border-color:transparent;color:#fff;padding:0 26px;box-shadow:0 10px 22px -10px rgba(20,181,220,.9)}.scan-primary:hover,.scan-secondary:hover{transform:translateY(-1px)}.scan-drop-hint{display:flex;align-items:center;gap:6px;grid-column:1/-1;margin:0;color:#8fb0ba;font-size:.76rem}.scan-drop-hint svg{width:15px;height:15px}}
@media(min-width:700px){.scan-card{grid-template-columns:auto minmax(0,1fr) auto;padding:22px 24px}.scan-actions{grid-column:auto;grid-template-columns:auto auto}.scan-art{width:72px;height:88px}}
.scan-fab{position:fixed;right:16px;bottom:calc(84px + env(safe-area-inset-bottom));z-index:17;height:56px;padding:0 20px 0 16px;border:0;border-radius:999px;display:inline-flex;align-items:center;gap:8px;background:linear-gradient(180deg,#14b5dc,#0090b4);color:#fff;font-weight:800;font-size:.9rem;box-shadow:0 14px 28px -10px rgba(0,111,142,.85);opacity:0;transform:translateY(18px) scale(.85);pointer-events:none;transition:opacity .25s,transform .35s cubic-bezier(.2,1.3,.4,1)}
.scan-fab.is-visible{opacity:1;transform:none;pointer-events:auto}.scan-fab:active{transform:scale(.94)}
.scan-fab svg{width:22px;height:22px}
@media(min-width:950px){.scan-fab{display:none}}
@keyframes beam{from{transform:translateY(-100%)}to{transform:translateY(125%)}}
@keyframes twinkle{0%,100%{transform:scale(1) rotate(0)}50%{transform:scale(1.15) rotate(18deg)}}
@keyframes ring{to{transform:rotate(360deg)}}
@keyframes draw{to{stroke-dashoffset:0}}
@keyframes pop{0%{transform:scale(.6)}60%{transform:scale(1.12)}100%{transform:scale(1)}}
.check-draw path{stroke-dasharray:1;stroke-dashoffset:1;animation:draw .4s .1s ease-out forwards}

/* Lectura en curso */
.reading-sheet{padding:8px 22px 0;text-align:center}
.reading-sheet h2{margin:18px 0 6px;font-size:1.25rem;color:var(--ink);outline:0}
.reading-art{position:relative;width:156px;height:196px;margin:18px auto 0;border-radius:16px;overflow:hidden;background:#0b0e11;box-shadow:0 20px 40px -22px rgba(0,60,80,.8)}
.reading-art img{width:100%;height:100%;object-fit:cover;opacity:.92}
.reading-art .scan-beam{display:none}.reading-art.is-scanning .scan-beam{display:block;animation-duration:1.7s}
.reading-art.is-scanning{animation:breathe 2.4s ease-in-out infinite}
.reading-doc{height:100%;display:grid;place-content:center;justify-items:center;gap:8px;color:#d9f6fd;background:linear-gradient(160deg,#10303b,#0b0e11)}.reading-doc svg{width:54px;height:54px;stroke-width:1.3}.reading-doc b{font-size:.75rem;letter-spacing:.14em;color:#8fe6f8}
.corner{position:absolute;width:22px;height:22px;border:3px solid #3fd0f0;pointer-events:none}.corner.tl{top:8px;left:8px;border-right:0;border-bottom:0;border-radius:8px 0 0 0}.corner.tr{top:8px;right:8px;border-left:0;border-bottom:0;border-radius:0 8px 0 0}.corner.bl{bottom:8px;left:8px;border-right:0;border-top:0;border-radius:0 0 0 8px}.corner.br{bottom:8px;right:8px;border-left:0;border-top:0;border-radius:0 0 8px 0}
.has-error .corner{border-color:#e08a8c}
.reading-hint{margin:0 auto;max-width:30ch;color:var(--muted);font-size:.84rem}
.reading-error{display:flex;gap:8px;align-items:flex-start;text-align:left;margin:4px 0 0;padding:12px 14px;border-radius:12px;background:#fbe9e9;color:#7d2a2d;font-size:.86rem;font-weight:650}.reading-error svg{width:18px;height:18px;margin-top:1px}
.read-steps{list-style:none;margin:20px auto 22px;padding:0;max-width:300px;display:grid;gap:12px;text-align:left}
.read-step{display:flex;align-items:center;gap:12px;color:#8a99a1;font-size:.88rem;transition:color .25s}
.step-dot{position:relative;flex:0 0 26px;height:26px;border-radius:50%;border:2px solid #d3dee3;display:grid;place-items:center;transition:background .25s,border-color .25s}
.step-dot svg{width:15px;height:15px;stroke:#fff;stroke-width:2.6;opacity:0}
.read-step.active{color:var(--ink);font-weight:750}
.read-step.active .step-dot{border-color:#cfe9f0}.read-step.active .step-dot:after{content:"";position:absolute;inset:-2px;border-radius:50%;border:2px solid transparent;border-top-color:var(--accent);border-right-color:var(--accent);animation:ring .8s linear infinite}
.read-step.done{color:#1f6b3a}
.read-step.done .step-dot{background:#1f8a4c;border-color:#1f8a4c;animation:pop .35s ease-out}.read-step.done .step-dot svg{opacity:1}
.read-step.failed{color:var(--danger);font-weight:750}.read-step.failed .step-dot{background:var(--danger);border-color:var(--danger)}.read-step.failed .step-dot svg{opacity:1;width:13px;height:13px}
.reading-sheet .dialog-actions{margin:0 -22px;padding-left:22px;padding-right:22px}
@keyframes breathe{50%{box-shadow:0 20px 46px -16px rgba(20,181,220,.65)}}

/* Desglose leído */
.read-kicker{display:inline-flex;align-items:center;gap:5px;color:var(--accent-strong)!important}.read-kicker svg{width:14px;height:14px;fill:currentColor;stroke-width:1}
.read-summary{margin:16px 16px 4px;padding:18px;border-radius:18px;color:#fff;background:radial-gradient(110% 80% at 100% 0%,#14526a 0%,rgba(20,82,106,0) 55%),linear-gradient(160deg,#0b0e11 35%,#10303b)}
.read-summary-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.read-status{display:inline-flex;align-items:center;gap:6px;padding:5px 10px 5px 6px;border-radius:999px;background:rgba(63,208,240,.14);color:#8fe6f8;font-size:.74rem;font-weight:800}
.read-status svg{width:18px;height:18px;padding:2px;border-radius:50%;background:#1f8a4c;stroke:#fff;stroke-width:2.8}
.read-thumb{flex:0 0 auto;width:58px;height:72px;border-radius:10px;overflow:hidden;border:1px solid rgba(255,255,255,.25);display:block;background:#0b0e11;transition:transform .2s}.read-thumb:active{transform:scale(.95)}
.read-thumb img{width:100%;height:100%;object-fit:cover}
.read-thumb-doc{height:100%;display:grid;place-content:center;justify-items:center;gap:2px;color:#d9f6fd}.read-thumb-doc svg{width:24px;height:24px}.read-thumb-doc b{font-size:.58rem;letter-spacing:.1em;color:#8fe6f8}
.read-summary-top>div{min-width:0}
.read-party{margin:10px 0 14px;font-size:1.05rem;font-weight:800;line-height:1.25;overflow-wrap:anywhere}
.read-total small{display:block;color:#9fbac3;font-size:.72rem;font-weight:700}
.read-total strong{display:block;font-size:2.1rem;line-height:1.1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.read-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px;margin:14px 0 0;padding-top:14px;border-top:1px solid rgba(255,255,255,.12)}
.read-facts dt{color:#8fa9b2;font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em}.read-facts dd{margin:2px 0 0;font-size:.86rem;font-weight:650;overflow-wrap:anywhere}
.read-warn{display:flex;gap:10px;margin:12px 16px 0;padding:12px 14px;border-radius:14px;background:#fff4e0;color:#6e430d;border:1px solid #f5dcae}.read-warn>svg{width:20px;height:20px;color:#c07a12;margin-top:1px}
.read-warn strong{font-size:.84rem}.read-warn ul{margin:4px 0 0;padding-left:16px;font-size:.8rem}
.read-lines{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}.read-line{min-width:0}
.read-line{border:1px solid #e2e9ec;border-radius:14px;background:#fff;transition:border-color .2s,box-shadow .2s}
.read-line[open]{border-color:#9fd3e0;box-shadow:0 10px 24px -18px rgba(0,111,142,.6)}
.read-line summary{list-style:none;display:flex;align-items:center;gap:10px;padding:12px;min-height:60px;cursor:pointer;border-radius:14px}
.read-line summary::-webkit-details-marker{display:none}
.read-line summary:focus-visible{outline:3px solid #9fd3e0;outline-offset:1px}
.line-index{flex:0 0 26px;height:26px;border-radius:8px;display:grid;place-items:center;background:var(--accent-light);color:var(--accent-strong);font-size:.74rem;font-weight:800}
.line-main{flex:1;min-width:0}.line-main strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.86rem;color:var(--ink);line-height:1.3}.line-main small{display:block;margin-top:2px;color:var(--muted);font-size:.74rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.read-line summary b{font-size:.88rem;color:var(--ink);white-space:nowrap}
.read-line summary>svg{width:16px;height:16px;color:#8a99a1;transition:transform .25s}.read-line[open] summary>svg{transform:rotate(90deg)}
.read-line-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:2px 12px 12px;animation:fade-in .25s ease}
.read-line-fields .full{grid-column:1/-1}
.line-drop{grid-column:1/-1;justify-self:start;color:var(--danger)}
.sum-pill{display:inline-flex;align-items:center;gap:6px;margin-top:12px;padding:7px 12px 7px 8px;border-radius:999px;font-size:.8rem;font-weight:750}
.sum-pill svg{width:18px;height:18px}
.sum-pill.ok{background:#e3f5ea;color:#1f6b3a}.sum-pill.ok svg{padding:2px;border-radius:50%;background:#1f8a4c;stroke:#fff;stroke-width:2.8}
.sum-pill.off{background:#fbe9e9;color:#8f3336}
.read-more{border-bottom:1px solid #edf1f3}
.read-more summary{list-style:none;display:flex;align-items:center;gap:12px;padding:16px 20px;cursor:pointer}
.read-more summary::-webkit-details-marker{display:none}
.read-more summary>svg:first-child{width:20px;height:20px;color:var(--accent-strong)}
.read-more summary span{flex:1;min-width:0}.read-more summary strong{display:block;font-size:.88rem;color:var(--ink)}.read-more summary small{color:var(--muted);font-size:.75rem}
.read-more summary>svg:last-child{width:16px;height:16px;color:#8a99a1;transition:transform .25s}.read-more[open] summary>svg:last-child{transform:rotate(90deg)}
.read-more-body{padding:0 20px 18px;animation:fade-in .25s ease}
.read-more-body h4{margin:16px 0 10px;font-size:.78rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.read-grid .full{grid-column:1/-1}
.read-actions{margin:0;padding:13px 16px calc(14px + env(safe-area-inset-bottom))}.read-actions .secondary{flex:0 0 auto}.read-actions .primary{flex:1}
.read-actions svg{width:18px;height:18px}
.primary.is-done{background:#1f8a4c;animation:pop .4s ease-out;opacity:1}.primary.is-done .check-draw{stroke-width:2.8}
.spinner.small{width:16px;height:16px;border-width:2px;border-color:rgba(255,255,255,.35);border-top-color:#fff}
.extraction-sheet.is-fresh .read-summary{animation:rise .45s .05s cubic-bezier(.2,.9,.25,1) both}
.extraction-sheet.is-fresh .read-warn{animation:rise .4s .15s both}
.extraction-sheet.is-fresh .read-line{animation:rise .4s calc(.2s + var(--i)*55ms) cubic-bezier(.2,.9,.25,1) both}
@media(min-width:600px){.read-summary{margin:18px 20px 4px;padding:20px 22px}.read-warn{margin:12px 20px 0}.read-party{font-size:1.15rem}}
@media(prefers-reduced-motion:reduce){.scan-beam,.scan-spark,.reading-art.is-scanning,.read-step.active .step-dot:after{animation:none!important}.scan-beam{transform:translateY(60%)}.check-draw path{stroke-dashoffset:0}}

/* Cuentas y Tarjetas: tarjetas, avisos de pago y ficha con movimientos */
.page-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px}.page-buttons .primary,.page-buttons .secondary{width:100%}
.acct-totals{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 22px}
.acct-totals div{padding:13px 14px;border-radius:14px;background:#fff;border:1px solid var(--line)}
.acct-totals small{display:block;color:var(--muted);font-size:.72rem;font-weight:650}
.acct-totals strong{display:block;margin-top:4px;color:var(--ink);font-size:clamp(1rem,4.6vw,1.3rem);letter-spacing:-.02em}
.acct-totals strong.neg{color:#a3393e}
.acct-section{margin-bottom:26px}.acct-section .chapter-head{margin-bottom:12px}.acct-section .chapter-head .count-pill{background:#e6eef1;color:#194954}
/* Carril de tarjetas: en el teléfono se desliza de lado, una tarjeta casi completa a la vez. */
.card-rail{display:grid;grid-auto-flow:column;grid-auto-columns:min(84%,340px);gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;margin:0 -16px;padding:4px 16px 14px;scrollbar-width:none;overscroll-behavior-x:contain}
.card-rail::-webkit-scrollbar{display:none}
.card-slot{scroll-snap-align:center;min-width:0;display:grid;gap:9px}
.is-entering .card-slot{animation:card-deal .55s cubic-bezier(.2,.9,.25,1) both;animation-delay:calc(var(--i,0)*80ms)}
@keyframes card-deal{from{opacity:0;transform:translateY(18px) rotate(-2.5deg) scale(.96)}}
.bank-card{--c1:#1b2733;--c2:#0b0e11;--shine:rgba(255,255,255,.16);position:relative;isolation:isolate;overflow:hidden;width:100%;aspect-ratio:1.586;min-height:178px;display:flex;flex-direction:column;justify-content:space-between;padding:17px 18px 16px;border:0;border-radius:18px;color:#fff;text-align:left;background:radial-gradient(130% 120% at 100% 0%,var(--shine),transparent 55%),linear-gradient(140deg,var(--c1),var(--c2));box-shadow:0 18px 34px -22px rgba(4,12,16,.85),inset 0 1px 0 rgba(255,255,255,.12);transition:transform .2s cubic-bezier(.2,.9,.25,1),box-shadow .2s}
button.bank-card:hover{transform:translateY(-3px);box-shadow:0 24px 40px -22px rgba(4,12,16,.9),inset 0 1px 0 rgba(255,255,255,.12)}
button.bank-card:active{transform:scale(.975)}
button.bank-card:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.bank-card:before{content:"";position:absolute;z-index:-1;inset:-40% -60%;background:linear-gradient(105deg,transparent 42%,rgba(255,255,255,.18) 50%,transparent 58%);transform:translateX(-60%);animation:card-shine 1.4s .35s ease-out both}
.bank-card:after{content:"";position:absolute;z-index:-1;right:-30%;bottom:-55%;width:90%;aspect-ratio:1;border-radius:50%;border:26px solid rgba(255,255,255,.05)}
@keyframes card-shine{to{transform:translateX(60%)}}
.bank-card.is-visa{--c1:#1d3f9a;--c2:#0b1b4d;--shine:rgba(120,170,255,.35)}
.bank-card.is-master{--c1:#2b2b31;--c2:#111114;--shine:rgba(255,140,40,.32)}
.bank-card.is-amex{--c1:#2a7f8f;--c2:#11414c;--shine:rgba(190,240,250,.3)}
.bank-card.is-other{--c1:#3a3f55;--c2:#14161f;--shine:rgba(170,160,255,.28)}
.bank-card.is-debit{--c1:#0f7a68;--c2:#06362f;--shine:rgba(110,240,200,.3)}
.bc-top{display:flex;align-items:center;gap:9px}
.bc-chip{width:34px;height:25px;border-radius:6px;background:linear-gradient(135deg,#f3dc9a,#b8913c 55%,#e9cd83);box-shadow:inset 0 0 0 1px rgba(80,55,0,.35);position:relative}
.bc-chip:before{content:"";position:absolute;inset:6px 8px;border:1px solid rgba(80,55,0,.35);border-radius:3px}
.bc-kind{padding:3px 8px;border-radius:999px;background:rgba(255,255,255,.14);font-size:.62rem;font-weight:750;letter-spacing:.06em;text-transform:uppercase}
.bc-brand{margin-left:auto;font-size:1rem;font-weight:850;font-style:italic;letter-spacing:.02em;opacity:.95}
.bc-number{font-size:clamp(.95rem,4.4vw,1.12rem);letter-spacing:.14em;opacity:.92;white-space:nowrap}
.bc-bottom{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.bc-name,.bc-amount{display:grid;gap:1px;min-width:0}
.bc-name small,.bc-amount small{font-size:.62rem;letter-spacing:.05em;text-transform:uppercase;opacity:.72}
.bc-name strong{font-size:.86rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bc-amount{text-align:right}.bc-amount strong{font-size:clamp(1.12rem,5.4vw,1.4rem);letter-spacing:-.02em;white-space:nowrap}
.bc-usage{position:absolute;left:18px;right:18px;bottom:8px;height:3px;border-radius:3px;background:rgba(255,255,255,.18);overflow:hidden}
.bc-usage span{display:block;height:100%;width:var(--fill,0%);border-radius:inherit;background:linear-gradient(90deg,#7ee0f5,#fff);animation:grow-w .9s .25s cubic-bezier(.2,.9,.25,1) both}
.bank-card.has-reminder{box-shadow:0 0 0 2px #f2a93b,0 18px 34px -22px rgba(4,12,16,.85)}
.card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px;color:var(--muted);font-size:.76rem}
.card-meta b{color:var(--ink)}
.due-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border-radius:999px;background:#eef3f5;color:#30505c;font-size:.72rem;font-weight:750;white-space:nowrap}
.due-chip svg{width:14px;height:14px}
.due-chip.warning{background:#fff1d9;color:#8a5208}.due-chip.critical{background:#f9e4e5;color:#a3393e}.due-chip.is-clear{background:#e3f4ea;color:#1f6b40}
.due-chip.warning svg,.due-chip.critical svg,.pay-alert-icon svg{transform-origin:50% 10%;animation:bell-ring 2.4s 1s ease-in-out infinite}
@keyframes bell-ring{0%,60%,100%{transform:rotate(0)}66%{transform:rotate(14deg)}74%{transform:rotate(-12deg)}82%{transform:rotate(8deg)}90%{transform:rotate(-4deg)}}
.acct-list{display:grid;gap:8px}
.acct-row{width:100%;display:flex;align-items:center;gap:12px;min-height:64px;padding:11px 13px;border:1px solid var(--line);border-radius:14px;background:#fff;text-align:left;color:var(--ink);transition:background .15s,transform .12s}
.acct-row:hover{background:#f7fafb}.acct-row:active{transform:scale(.985)}
.is-entering .acct-row{animation:rise .4s cubic-bezier(.2,.9,.25,1) both;animation-delay:calc(var(--i,0)*45ms)}
.acct-icon{flex:none;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--accent-light);color:var(--accent-strong)}
.acct-text{flex:1;min-width:0;display:grid;gap:2px}.acct-text strong{font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.acct-text small{color:var(--muted);font-size:.74rem}
.acct-row>b{font-size:.95rem;white-space:nowrap}.acct-row>b.neg{color:#a3393e}.acct-row>svg:last-child{width:16px;height:16px;color:#9aabb2}
.pay-alerts{display:grid;gap:10px;margin:0 0 18px}
.pay-alert{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px 12px;align-items:center;padding:13px 14px;border-radius:16px;background:#fff7e8;border:1px solid #f4d7a3;color:#5b3a05;animation:rise .45s cubic-bezier(.2,.9,.25,1) both}
.pay-alert.critical{background:#fdeeee;border-color:#efc2c4;color:#7a2226}
.pay-alert-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:#ffe6b8;color:#8a5208}
.pay-alert.critical .pay-alert-icon{background:#f9d2d4;color:#a3393e}
.pay-alert-text{display:grid;gap:1px;min-width:0}.pay-alert-text strong{font-size:.9rem}.pay-alert-text span{font-size:.78rem}.pay-alert-text b{font-size:1.05rem;color:inherit}
.pay-alert .primary{grid-column:1/-1;width:100%;min-height:44px}
.pay-alert.is-inline{margin:0 0 14px}
.acct-empty .acct-empty-card{width:86px;height:56px;margin:0 auto 16px;border-radius:12px;display:grid;place-items:center;color:#fff;background:linear-gradient(140deg,#1d3f9a,#0b1b4d);box-shadow:0 14px 26px -16px rgba(11,27,77,.9);animation:card-float 3.2s ease-in-out infinite}
.acct-empty .acct-empty-card svg{width:28px;height:28px}.acct-empty p{max-width:340px;margin:6px auto 18px}.acct-empty .page-buttons{max-width:380px;margin:0 auto}
@keyframes card-float{50%{transform:translateY(-6px) rotate(-3deg)}}
/* Ficha de la cuenta */
.sheet-card{max-width:360px;margin:0 auto 16px;animation:pop-in .45s cubic-bezier(.2,.9,.25,1) both}
.acct-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:10px}
.acct-stat{padding:11px 12px;border-radius:12px;background:#f5f8f9}
.acct-stat small{display:block;color:var(--muted);font-size:.7rem;font-weight:650}
.acct-stat strong{display:block;margin-top:3px;font-size:1.02rem;color:var(--ink)}
.acct-stat.is-warning{background:#fff1d9}.acct-stat.is-critical{background:#f9e4e5}
.acct-equation{display:flex;gap:8px;align-items:flex-start;margin:0 0 16px;padding:10px 12px;border-radius:12px;background:#e3f4ea;color:#1f5a38;font-size:.76rem;line-height:1.45}
.acct-equation svg{flex:none;width:16px;height:16px;margin-top:1px}
.account-sheet>.primary.wide{margin:0 0 18px}
.pay-form{margin:0 0 18px;padding:14px;border-radius:16px;background:#f5f8f9;border:1px solid var(--line);animation:rise .3s ease-out both}
.pay-form h3{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:.95rem}
.pay-form .dialog-actions{margin-top:12px}
.pay-quick{display:flex;gap:8px;overflow-x:auto;margin:0 0 12px}
.pay-quick-chip{flex:none;display:grid;gap:1px;padding:8px 12px;border-radius:12px;border:1px solid #b9ccd3;background:#fff;text-align:left;color:var(--ink)}
.pay-quick-chip small{color:var(--muted);font-size:.68rem}.pay-quick-chip:active{transform:scale(.97)}
.acct-moves{list-style:none;margin:0;padding:0;display:grid}
.acct-move{display:flex;align-items:center;gap:11px;padding:10px 0;border-top:1px solid #edf2f4}
.acct-move:first-child{border-top:0}
.mv-icon{flex:none;width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#f9e4e5;color:#a3393e}
.mv-icon.in{background:#e3f4ea;color:#1f6b40}.mv-icon svg{width:17px;height:17px}
.mv-text{flex:1;min-width:0;display:grid;gap:1px}.mv-text strong{font-size:.84rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mv-text small{color:var(--muted);font-size:.72rem}
.mv-amount{display:grid;justify-items:end;gap:1px}.mv-amount b{font-size:.88rem;white-space:nowrap}.mv-amount b.out{color:#a3393e}.mv-amount b.in{color:#1f6b40}.mv-amount small{color:var(--muted);font-size:.7rem}
.secondary.danger-text{color:var(--danger);border-color:#efc2c4}
@media(min-width:600px){.page-buttons{display:flex;justify-content:flex-end}.page-heading .page-buttons .primary,.page-heading .page-buttons .secondary{width:auto}.card-rail{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));overflow:visible;margin:0;padding:4px 0 6px}.acct-stats{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}.pay-alert{grid-template-columns:auto minmax(0,1fr) auto}.pay-alert .primary{grid-column:auto;width:auto}}
@media(prefers-reduced-motion:reduce){.bank-card:before{display:none}.due-chip svg,.pay-alert-icon svg,.acct-empty .acct-empty-card{animation:none!important}}

/* Proveedor de la factura leída con IA: reconocido por NIT o propuesto como nuevo */
.read-trade{display:flex;align-items:center;gap:6px;margin:4px 0 0;color:#9fd6e6;font-size:.78rem;font-weight:650}.read-trade svg{width:14px;height:14px}
.supplier-box{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px 12px;align-items:center;margin:0 0 16px;padding:13px 14px;border-radius:16px;border:1px solid var(--line);background:#fff;animation:rise .4s cubic-bezier(.2,.9,.25,1) both}
.sb-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--accent-light);color:var(--accent-strong)}
.sb-text{display:grid;gap:1px;min-width:0}.sb-text small{color:var(--muted);font-size:.7rem;font-weight:700;letter-spacing:.02em}.sb-text strong{font-size:.92rem;color:var(--ink);overflow-wrap:anywhere}.sb-text>span{color:var(--muted);font-size:.76rem}
.supplier-box.is-known{background:#eef8f2;border-color:#bfe3cc}.supplier-box.is-known .sb-icon{background:#d6f0e0;color:#1f6b40}
.sb-check{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#1f8a4c;color:#fff;animation:pop .45s .15s ease-out both}.sb-check svg{width:16px;height:16px;stroke-width:2.8}
.supplier-box.is-missing{background:#fff7e8;border-color:#f4d7a3}.supplier-box.is-missing .sb-icon{background:#ffe6b8;color:#8a5208}
.supplier-box.is-new{border:1.5px dashed #9cc6d3;background:#f6fbfc}
.supplier-box.is-new.is-on{border-style:solid;border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,143,178,.12)}
.sb-toggle{grid-column:1/-1;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:center;cursor:pointer}
.switch-input{position:absolute;opacity:0;pointer-events:none}
.switch{position:relative;width:48px;height:28px;border-radius:999px;background:#c9d6db;transition:background .2s}
.switch:after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.2);transition:transform .22s cubic-bezier(.3,1.4,.5,1)}
.switch-input:checked+.switch{background:var(--accent-strong)}.switch-input:checked+.switch:after{transform:translateX(20px)}
.switch-input:focus-visible+.switch{outline:3px solid var(--accent);outline-offset:2px}
.sb-fields{grid-column:1/-1;padding-top:4px;border-top:1px solid #d8e7ec;animation:rise .3s ease-out both}
.sb-fields .form-grid{margin-top:10px}
@media(prefers-reduced-motion:reduce){.supplier-box,.sb-check,.sb-fields{animation:none}}

/* Productos comprados */
.product-projects{margin-bottom:12px}
.product-tools{margin-bottom:12px}
.product-grid{display:grid;gap:10px}
.product-card{background:#fff;border:1px solid var(--line);border-radius:16px;overflow:hidden;transition:box-shadow .2s,transform .12s}
.product-card:hover{box-shadow:0 10px 24px -18px rgba(4,12,16,.6)}
.is-entering .product-card{animation:rise .4s cubic-bezier(.2,.9,.25,1) both;animation-delay:calc(var(--i,0)*40ms)}
.product-main{width:100%;display:grid;gap:6px;padding:14px 15px 12px;border:0;background:none;text-align:left;color:var(--ink)}
.product-main:active{background:#f7fafb}
.pc-codes{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.pc-code{display:inline-block;padding:2px 8px;border-radius:7px;background:var(--ink);color:#7ee0f5;font:700 .7rem/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em}
.pc-supplier-code{color:var(--muted);font:600 .7rem/1.5 ui-monospace,SFMono-Regular,Menlo,monospace}
.pc-name{font-size:.98rem;line-height:1.25}
.pc-supplier{display:flex;align-items:center;gap:5px;margin:0;color:var(--muted);font-size:.76rem}.pc-supplier svg{width:14px;height:14px}
.pc-numbers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:4px;padding-top:9px;border-top:1px solid #edf2f4}
.pc-numbers span{display:grid;gap:1px;min-width:0}.pc-numbers small{color:var(--muted);font-size:.66rem;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pc-numbers b{font-size:.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pc-projects{display:flex;flex-wrap:wrap;gap:6px;padding:0 15px 13px}
.pc-project{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;background:var(--accent-light);color:#0b5d74;font-size:.7rem;font-weight:700}.pc-project svg{width:13px;height:13px}.pc-project.more{background:#eef3f5;color:#45606b}
.product-sheet .sheet-kicker{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.product-bars{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.pb-head{display:flex;justify-content:space-between;gap:10px;font-size:.82rem;margin-bottom:5px}.pb-head span{color:var(--muted);white-space:nowrap}
.pb-track{display:block;height:8px;border-radius:8px;background:#e9f0f2;overflow:hidden}
.pb-track span{display:block;height:100%;width:var(--fill,0%);border-radius:inherit;background:linear-gradient(90deg,var(--accent-strong),#3fd0f0);animation:grow-w .8s .15s cubic-bezier(.2,.9,.25,1) both}
.purchase-lines .pc-code{margin-right:4px;vertical-align:1px}
@media(min-width:700px){.product-grid{grid-template-columns:repeat(auto-fill,minmax(320px,1fr))}}
.product-totals{margin-bottom:12px}
.project-products .sheet-head b{font-size:.95rem}
.project-products .acct-move .pc-code{flex:none}
.project-products .secondary.wide{width:100%;margin-top:10px}

/* Nueva categoría de compra dentro de la factura leída */
.new-category{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;padding:10px;border-radius:12px;background:#f1f8fa;border:1px solid #d5e9ef}
.new-category input{flex:1 1 180px;min-width:0}
.new-category .primary{min-height:40px;padding:0 16px}

/* Forma de pago de la compra: tipo de pago y solo los datos que ese tipo necesita */
.pay-block{padding:14px;border:1px solid #dde7ec;border-radius:14px;background:#fafcfd}
.pay-block-title{font-weight:750;font-size:.86rem;color:#20323d}
.pay-block>.form-grid{margin-top:6px}
.pay-extra{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px 16px}
.pay-extra:empty{display:none}
.pay-note{margin:0;grid-column:1/-1}
.pay-to{grid-column:1/-1;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:10px 16px;padding:12px;border-radius:12px;background:#eef6f9;border:1px solid #d5e9ef}
.pay-to-title{grid-column:1/-1;display:flex;align-items:center;gap:6px;font-size:.8rem;font-weight:750;color:#075d78}
.pay-to-title svg{width:16px;height:16px}
.pay-to-note{grid-column:1/-1;margin:0}

/* Enlace de vuelta a la página pública desde el ingreso */
.auth-back{display:block;margin-top:14px;text-align:center;font-size:.84rem;font-weight:650;color:#075d78;text-decoration:none}
.auth-back:hover{text-decoration:underline}
.auth-back:focus-visible{outline:2px solid #075d78;outline-offset:3px;border-radius:4px}
