/* PROCMAR — modern visual layer, no business logic changes */
:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;color:#183044;background:#f1f6fa;--navy:#082c44;--cyan:#00b7b0;--blue:#087eac;--line:#dfebf1;--shadow:0 12px 34px rgba(9,45,69,.075)}
html{scroll-behavior:smooth}body{background:radial-gradient(circle at 95% 2%,#d8f6f1 0,transparent 28%),#f1f6fa;line-height:1.5;min-height:100vh}
header{position:relative;overflow:hidden;background:linear-gradient(115deg,#06293f 0%,#0b4964 62%,#087b83 100%);padding:26px 16px 30px;box-shadow:0 10px 30px #052f4940}
header:after{content:'';position:absolute;width:240px;height:240px;right:-100px;top:-110px;border-radius:50%;border:35px solid #ffffff10;pointer-events:none}
.brand{max-width:1160px;position:relative;z-index:1}.brand img{width:82px;height:82px;flex-shrink:0;background:#fff;border:3px solid #ffffff45;border-radius:20px;box-shadow:0 8px 20px #001b2b45;padding:6px}.brand h1{font-size:clamp(22px,3.8vw,32px);letter-spacing:-.8px;font-weight:800;line-height:1.15;margin:0 0 7px}.brand div div{color:#d6f5f7;font-size:13px;letter-spacing:.2px}
main{max-width:1160px;margin:22px auto 50px;padding:0 16px}.card{border:1px solid #e5eef4;background:#fff;padding:clamp(18px,3vw,28px);border-radius:22px;margin-bottom:20px;box-shadow:var(--shadow)}
.card .card{box-shadow:none;background:#f9fcfe;border:1px solid var(--line)}
h2{font-size:clamp(20px,2.5vw,25px);font-weight:800;letter-spacing:-.55px;color:#11384e;margin:0 0 14px}h3,h4{color:#163b51;letter-spacing:-.3px}.muted,small{color:#708594}
nav{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 20px;padding:7px;border:1px solid #e1edf2;background:#fff;border-radius:17px;box-shadow:0 5px 20px #082c4409}
nav button{flex:1;min-width:140px;background:linear-gradient(115deg,#0b688d,#087fa3);margin:0;padding:13px 18px;border-radius:12px;font-weight:750}nav button.secondary{background:#eaf3f8;color:#285269}
button{background:linear-gradient(125deg,#087da5,#009ba7);border:0;border-radius:12px;color:white;padding:12px 17px;font-weight:650;box-shadow:0 4px 10px #087fa21c;transition:transform .16s,filter .16s,box-shadow .16s}button:hover{filter:brightness(1.05);box-shadow:0 6px 16px #087fa22c}button:active{transform:scale(.98)}button.secondary{background:#e8f0f5;color:#36586b;box-shadow:none}button.danger{background:#b83f4c}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #31c7c480;outline-offset:2px}
input,select,textarea{background:#f9fcfe;color:#183448;border:1px solid #d9e6ee;border-radius:12px;min-height:45px;padding:12px 14px;box-shadow:inset 0 1px 2px #082c4405}input:focus,select:focus,textarea:focus{background:#fff;border-color:#00a9b1}input[type=checkbox]{min-height:0;accent-color:#008e9e}label{display:inline-block;color:#34556a;font-weight:700;margin-top:3px;margin-bottom:3px;font-size:13px}.grid{gap:15px}.item{border-color:#e4edf2}.pill{background:#e1f5f3;color:#087e7c;font-weight:650;padding:6px 12px}.tot{font-size:26px;color:#047c96}
.procmar-menu{gap:13px}.procmar-tile{min-height:118px;border:1px solid #dcebf1;border-radius:18px;background:linear-gradient(145deg,#fff,#f3f9fc);color:#21465b;box-shadow:0 4px 12px #12384a0c;transition:transform .15s,box-shadow .15s,border-color .15s}.procmar-tile:hover{transform:translateY(-2px);box-shadow:0 10px 22px #12384a18;border-color:#50c4c6}.procmar-tile.selected{background:linear-gradient(145deg,#e2f9f6,#e7f4fd);border:2px solid #04a6b0;box-shadow:0 6px 18px #00a9b11b}.procmar-tile-title{font-weight:800}.procmar-tile small{color:#607d8e}
.cl-document-section{background:#f8fbfd;border-color:#e0edf3;border-radius:17px}.cl-actions button{border-radius:10px}
#portalOtp{border-top:5px solid #00adaf}#portalOtp h2{color:#083d58}#otpNotice{font-weight:650}#message:empty{display:none}#message:not(:empty){background:#e8f8f5;border-radius:12px;padding:12px 15px;margin-bottom:14px}
@media(max-width:600px){header{padding:21px 15px 25px}.brand{gap:12px}.brand img{width:64px;height:64px;border-radius:15px}.brand h1{font-size:20px}.brand div div{font-size:11px}main{margin:15px auto;padding:0 11px}.card{border-radius:19px;padding:18px 16px;margin-bottom:14px}nav{gap:7px}nav button{min-width:0;font-size:13px;padding:12px 7px}.procmar-menu{gap:9px}.procmar-tile{min-height:105px;padding:10px 7px;font-size:13px}.cl-actions button{font-size:12px}button{font-size:14px}h2{font-size:20px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important}}

/* PROCMAR V1 — directorio moderno con vistas independientes */
.procmar-directory{max-width:100%;overflow:hidden}.directory-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:18px}.directory-toolbar h3{margin:0 0 3px}.directory-toolbar p{margin:0}.directory-actions{display:flex;gap:6px;flex-wrap:wrap}.directory-tabs{display:flex;gap:8px;overflow-x:auto;padding:5px 2px 14px;scrollbar-width:thin}.directory-tab{flex:0 0 auto;white-space:nowrap;background:#edf5f8;color:#31556a;border:1px solid #dce8ef;box-shadow:none}.directory-tab.active{background:linear-gradient(110deg,#087ea6,#00a5a8);color:#fff}.directory-heading{display:flex;align-items:center;gap:12px;margin-top:22px;margin-bottom:10px}.directory-heading h3{margin:0}.directory-list{display:grid;gap:10px}.directory-record{display:flex;align-items:center;gap:12px;padding:15px;background:linear-gradient(125deg,#fff,#f7fbfd);border:1px solid #e0ebf1;border-radius:16px}.directory-avatar{width:48px;height:48px;flex:0 0 48px;display:grid;place-items:center;background:#e4f6f4;border-radius:14px;font-size:23px}.directory-record-info{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}.directory-record-info b{overflow-wrap:anywhere}.directory-record-info small{overflow-wrap:anywhere}.directory-record-info .pill{align-self:flex-start;font-size:11px}.directory-record-actions{display:flex;gap:4px;flex-wrap:wrap;max-width:320px}.directory-record-actions button{font-size:12px;padding:8px 10px;margin:0}.directory-pages{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:16px}.directory-pages button:disabled{opacity:.35;cursor:not-allowed}.procmar-tile{position:relative}.procmar-tile.selected{box-shadow:0 6px 18px #00a9b126}@media(max-width:690px){.directory-record{align-items:flex-start;flex-wrap:wrap}.directory-record-actions{width:100%;max-width:none;padding-left:60px}.directory-toolbar{display:block}.directory-actions{margin-top:12px}.directory-actions button{font-size:12px;padding:9px 11px}.directory-record-actions button{flex:1 1 auto}.directory-avatar{width:44px;height:44px;flex-basis:44px}.directory-record-actions{padding-left:0}}

/* V2: identidad corporativa original y accesibilidad */
.brand img{object-fit:contain;background:#fff;padding:4px;border-radius:18px}
.procmar-active-location{margin-top:12px;color:#366578;font-size:13px;font-weight:700}
#procmarMenu .procmar-tile{min-height:102px}
#procmarMenu .procmar-tile:focus-visible{outline:3px solid #0aa8a6;outline-offset:3px}
@media(min-width:960px){#procmarMenu{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* V3: ficha de expediente individual, visualización separada del editor */
.worker-profile{margin-top:20px;border:1px solid #c9e3ed;border-radius:20px;padding:20px;background:#fff;box-shadow:0 12px 34px #082c4414;scroll-margin-top:20px}
.profile-top{display:flex;align-items:center;gap:15px}
.profile-photo{display:grid;place-items:center;width:78px;height:88px;flex-shrink:0;background:linear-gradient(145deg,#e1f7fa,#d5e4f5);border-radius:16px;font-size:35px}
.profile-identity{flex:1;min-width:0}.profile-identity small{font-size:11px;font-weight:800;letter-spacing:1px;color:#078fa0}.profile-identity h3{font-size:21px;margin:3px 0;overflow-wrap:anywhere}.profile-identity p{margin:4px 0}.profile-buttons{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}
.profile-tabs{display:flex;gap:7px;overflow-x:auto;border-bottom:1px solid #e2edf2;padding:0 0 12px}
.profile-tabs button{flex-shrink:0;white-space:nowrap;background:#edf4f8;color:#274d62;box-shadow:none;font-size:13px}
.profile-tabs button.active{background:#067fa2;color:#fff}
.profile-content{padding:18px 0 4px}.profile-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.profile-fields>div{padding:13px;border-radius:12px;background:#f3f8fb;min-width:0}.profile-fields small{display:block;margin-bottom:5px}.profile-fields strong{font-size:14px;overflow-wrap:anywhere}
@media(max-width:560px){.profile-fields{grid-template-columns:1fr}.worker-profile{padding:14px}.profile-photo{width:60px;height:70px}.profile-identity h3{font-size:17px}}

/* V4 carpetas */
.f-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:12px;margin:18px 0}
.f-card{display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:16px;background:#f2f8fb;color:#163d54;border:1px solid #d5e5ed;border-radius:15px;box-shadow:none;text-align:left;min-height:116px}
.f-card span{font-size:27px}.f-card small{color:#637e8c}.f-card.selected{border:2px solid #00a6b1;background:#e5f8f8}
.f-result{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px;border-bottom:1px solid #e3edf0}
.f-result span{overflow-wrap:anywhere}.f-result button{flex-shrink:0}
.folder-v4 .directory-record select{max-width:240px}
@media(max-width:560px){.f-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.f-card{padding:12px}.f-result{flex-wrap:wrap}}

/* V5: nunca mostrar formularios de otros departamentos debajo de la vista actual */
.procmar-department-hidden{display:none!important}
#procmarPanel>.card{margin-top:16px}
#procmarMenu .procmar-tile{min-height:92px}
@media(max-width:540px){#procmarMenu .procmar-tile{min-height:84px;padding:9px 7px;gap:4px}#procmarMenu .procmar-tile small{font-size:11px}#procmarDashboard>.card{padding:15px}}

.scan-tool{padding:12px;border:1px solid #cce1e7;border-radius:16px;margin:12px 0;background:#f8fcfd}.scan-row{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}.scan-upload{display:inline-block;padding:13px 17px;background:#008e9d;color:white;border-radius:12px;cursor:pointer}.scan-pages{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px}.scan-page{border:1px solid #d4e5e8;border-radius:12px;padding:8px;min-width:0}.scan-page img{width:100%;height:130px;object-fit:contain;background:#eaf1f3}.scan-page button{padding:6px;margin:2px;font-size:12px}.scan-canvas{display:block;width:100%;height:auto;max-height:480px;object-fit:contain;touch-action:none;border:2px dashed #00a5b0}.scan-tool details{margin-top:16px;border:1px solid #d4e5e8;border-radius:12px;padding:12px}.scan-tool summary{cursor:pointer}

/* V8: solicitudes no presenciales */
.remote-wrap .directory-record{align-items:center}
.remote-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:12px 0}
.remote-wrap .directory-record-actions{display:flex;gap:5px;flex-wrap:wrap}
@media(max-width:540px){.remote-wrap .directory-record{flex-wrap:wrap}.remote-wrap .directory-record-actions{width:100%}.remote-wrap .directory-record-actions button{flex:1;font-size:12px}}

.scan-type-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:9px 0;border-bottom:1px solid #dde2e8}.scan-type-row span{flex:1;min-width:140px}#scanTypesBox{margin:12px 0;padding:12px;border:1px solid #ccd4df;border-radius:12px}

/* V13: separar estrictamente las vistas cliente y administrador */
.hide{display:none!important}
#admin,#client,#statusLookup,#portalOtp{scroll-margin-top:12px}

/* V28: ocultar departamentos sin desmontar nodos necesarios para inicialización */
.procmar-department-hidden{display:none!important}
