:root{color-scheme:light;--ink:#162b39;--muted:#6b7d89;--navy:#102c3c;--teal:#087e79;--teal-light:#e6f5f1;--line:#e5eaee;--paper:#f5f7fa;--white:#fff;--orange:#a66917;--orange-bg:#fff3db;--red:#ad3b42;--red-bg:#fff0f0;--shadow:0 4px 24px rgba(26,52,71,.07)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink);background:var(--paper);font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}a{color:var(--teal)}.hidden{display:none!important}.app-shell{display:flex;min-height:100vh}.sidebar{width:238px;background:var(--navy);color:#f0f7f8;display:flex;flex-direction:column;flex-shrink:0;position:sticky;top:0;height:100vh}.sidebar-brand{display:flex;gap:12px;align-items:center;padding:28px 20px 34px}.sidebar-brand strong{display:block;letter-spacing:1px;font-size:13px}.sidebar-brand small{display:block;color:#9db3be;font-size:11px;margin-top:4px}.brand-mark{width:50px;height:50px;display:grid;place-items:center;background:#0ea79d;border-radius:14px;color:white;font-size:29px;font-weight:800;box-shadow:0 10px 20px #087e7940}.brand-mark.small{width:37px;height:37px;font-size:22px;border-radius:10px}.side-label{margin:0 22px 12px;color:#829ba9;font-weight:700;font-size:10px;letter-spacing:1.2px}.sidebar nav{padding:0 10px}.nav-link{display:block;width:100%;text-align:left;background:transparent;border:0;color:#c2d0d6;padding:13px 14px;border-radius:10px;font-size:13px;font-weight:600;margin-bottom:5px}.nav-link:hover{background:#234353}.nav-link.active{background:#17685e;color:white}.sidebar-footer{margin-top:auto;padding:22px;border-top:1px solid #2c4654;display:flex;flex-direction:column;gap:6px}.sidebar-footer small{color:#7eb9b3;letter-spacing:.7px;text-transform:uppercase;font-size:10px}.sidebar-footer span{color:#b3c4cb;font-size:11px}.main-column{flex:1;min-width:0}.topbar{background:white;border-bottom:1px solid var(--line);height:74px;display:flex;align-items:center;justify-content:space-between;padding:0 34px;gap:12px}.breadcrumb{font-weight:600;color:#7e8b96}.breadcrumb span{color:var(--ink)}.top-actions{display:flex;align-items:center;gap:13px}.user-chip{font-size:12px;font-weight:700}.online-badge{background:#ebf8f2;border-radius:20px;color:#13745f;padding:7px 11px;font-size:11px;font-weight:700}.content{padding:31px 36px 60px;max-width:1540px;margin:0 auto}.page-title{font-size:27px;letter-spacing:-.65px;margin:0 0 7px}.subhead{color:var(--muted);margin:0 0 26px;line-height:1.6}.head-row{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap}.btn{border:1px solid transparent;border-radius:10px;padding:10px 15px;background:#ecf2f5;color:var(--ink);font-size:12px;font-weight:700;display:inline-flex;gap:8px;align-items:center;justify-content:center;text-decoration:none;white-space:nowrap}.btn:hover{filter:brightness(.96)}.btn.primary{background:var(--teal);color:white}.btn.outline{border-color:#d4dfe5;background:white}.btn.tiny{padding:8px 12px}.btn:disabled{opacity:.5;cursor:not-allowed}.icon-btn{border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px 12px}.mobile-menu{display:none}.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}.kpi{border:1px solid var(--line);box-shadow:var(--shadow);background:white;border-radius:15px;padding:20px;min-height:137px}.kpi-icon{display:inline-flex;align-items:center;justify-content:center;height:33px;width:33px;border-radius:9px;background:#e5f6f3;color:var(--teal);font-size:20px}.kpi-label{display:block;margin:12px 0 5px;font-weight:600;font-size:12px;color:var(--muted)}.kpi strong{font-size:27px;letter-spacing:-.7px}.split{display:grid;grid-template-columns:1.35fr 1fr;gap:18px}.panel{background:white;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:14px;padding:21px;margin-bottom:18px}.panel h3{margin:0 0 17px;font-size:15px}.subtle{color:var(--muted)}.tiny{font-size:11px}.large{font-size:17px}.stat-row{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:12px 0;border-bottom:1px solid #edf0f3}.stat-row:last-child{border:0}.stat-row strong{font-size:14px}.progress{height:8px;background:#eaf0f3;border-radius:100px;overflow:hidden}.progress>span{display:block;height:100%;background:#0b9287;border-radius:100px}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:17px}.toolbar input{flex:1;min-width:230px}.toolbar select{min-width:170px}.input, input,select,textarea{border:1px solid #d6e0e5;background:#fff;border-radius:9px;padding:11px 12px;color:var(--ink);max-width:100%;outline-color:#1a9489}label{display:block;font-weight:700;color:#314955;font-size:12px}label input,label select,label textarea{display:block;width:100%;margin-top:8px;font-weight:400}textarea{min-height:95px;resize:vertical}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.form-grid .wide{grid-column:1/-1}.form-stack{display:flex;flex-direction:column;gap:16px}.form-hint{font-size:11px;color:var(--muted);margin:6px 0 0}.table-wrap{width:100%;overflow-x:auto}.data-table{width:100%;border-collapse:collapse;text-align:left;min-width:680px}.data-table th{font-size:10px;font-weight:800;color:#7a8a92;text-transform:uppercase;letter-spacing:.65px;padding:12px 12px;background:#f8fafb;white-space:nowrap}.data-table td{border-top:1px solid #edf1f3;padding:12px;font-size:12px;line-height:1.4;vertical-align:middle}.data-table tr:hover td{background:#fcfdfd}.code{font-family:ui-monospace,"SFMono-Regular",Consolas,monospace;font-size:11.5px;font-weight:700;color:#156b7a}.pill{display:inline-flex;padding:5px 9px;border-radius:100px;background:#edf2f5;color:#435965;font-size:10px;font-weight:800;white-space:nowrap}.pill.green{background:#e4f6ef;color:#0e7653}.pill.orange{background:var(--orange-bg);color:var(--orange)}.pill.red{background:var(--red-bg);color:var(--red)}.pill.blue{background:#e8f1ff;color:#315e9f}.mini-btn{border:1px solid #d8e5e8;background:white;border-radius:8px;padding:6px 9px;font-size:11px;font-weight:700;color:#246e78}.empty{padding:40px;text-align:center;color:var(--muted)}.hero{background:linear-gradient(110deg,#153b4a,#0f6464);color:white;border-radius:16px;padding:26px 28px;margin-bottom:20px;display:flex;justify-content:space-between;align-items:center;gap:20px}.hero h2{font-size:20px;margin:0 0 7px}.hero p{color:#cae6e3;margin:0;font-size:12px;line-height:1.6}.hero .btn{background:white;color:#11675e}.qrbox{padding:15px;background:white;display:inline-flex;border:1px solid #dfe7e9;border-radius:12px}.qrbox svg{display:block;width:220px;height:220px}.qr-label{font-family:ui-monospace,monospace;font-size:19px;font-weight:800;letter-spacing:.8px}.modal-layer{position:fixed;inset:0;z-index:20;background:rgba(10,29,41,.54);padding:20px;display:flex;align-items:center;justify-content:center;overflow:auto}.modal-card{background:white;padding:27px;border-radius:17px;width:min(600px,100%);max-height:calc(100vh - 30px);overflow-y:auto;box-shadow:0 18px 60px #0003}.modal-card h2{font-size:21px;margin:0 0 7px}.modal-title-row{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:18px}.actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:17px}.toast{position:fixed;z-index:30;right:24px;bottom:22px;background:#143743;color:white;max-width:360px;padding:13px 17px;border-radius:10px;box-shadow:0 10px 40px #0002}.login-background{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;background:linear-gradient(160deg,#10303e,#1e5561)}.login-card{background:white;border-radius:20px;box-shadow:0 30px 80px #0002;width:min(430px,100%);padding:38px;display:flex;flex-direction:column;gap:12px}.login-card h1{margin:8px 0 0;font-size:29px}.login-card p{margin:0 0 15px}.login-card .btn{padding:13px}.error{color:var(--red);font-size:12px}.photo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}.photo-card{overflow:hidden;border:1px solid var(--line);border-radius:12px;background:#fff}.photo-card img{width:100%;height:160px;object-fit:cover}.photo-card .meta{padding:12px;display:flex;flex-direction:column;gap:5px}.ai-reply{white-space:pre-wrap;line-height:1.7;background:#eef7f5;padding:17px;border-radius:10px;border-left:3px solid var(--teal)}.scanner-video{width:100%;aspect-ratio:16/10;background:#182f3d;border-radius:10px;object-fit:cover}.row-gap{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.section-note{background:#f1f8fa;border:1px solid #d8ebec;border-radius:12px;padding:14px 16px;font-size:12px;line-height:1.6;color:#40616a}.link-inline{border:0;background:none;text-decoration:underline;color:var(--teal);padding:0}.print-only{display:none}@media(max-width:1060px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.split{grid-template-columns:1fr}.content{padding:26px 22px}}@media(max-width:740px){.sidebar{position:fixed;left:-245px;z-index:10;transition:left .2s ease;box-shadow:10px 0 30px #0002}.sidebar.open{left:0}.mobile-menu{display:inline-flex}.topbar{padding:0 16px;height:62px}.content{padding:20px 14px 50px}.kpis{gap:10px}.kpi{padding:14px;min-height:125px}.kpi strong{font-size:23px}.hero{flex-direction:column;align-items:flex-start;padding:22px}.form-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}.photo-grid{grid-template-columns:repeat(2,1fr)}.online-badge,.user-chip{display:none}.page-title{font-size:23px}.panel{padding:16px}.modal-card{padding:19px}}@media(max-width:440px){.photo-grid{grid-template-columns:1fr}.kpis{grid-template-columns:1fr 1fr}.kpi-label{font-size:11px}.qrbox svg{width:190px;height:190px}}@media print{body>*:not(#printArea){display:none!important}#printArea{display:block!important}.qrbox{border:0}}

/* Captura de fotografias desde movil: camara y galeria independientes. */
.photo-capture-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:9px}
.photo-picker{position:relative;min-height:48px;cursor:pointer;text-align:center;white-space:normal}
.photo-picker input[type=file]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;border:0;overflow:hidden;clip-path:inset(50%);opacity:0}
.photo-picker:focus-within{outline:3px solid #76c9be;outline-offset:2px}
.field-caption{font-weight:700;color:#314955;font-size:12px}
.photo-selection{display:flex;align-items:center;gap:14px;border:1px solid #d6e0e5;border-radius:10px;padding:10px;min-width:0}
.photo-selection img{max-width:120px;width:110px;height:100px;object-fit:cover;border-radius:8px;background:#eaf1f4}
.photo-selection>div{min-width:0;overflow-wrap:anywhere}
@media(max-width:440px){.photo-capture-choices{grid-template-columns:1fr}.photo-picker{width:100%}}
/* Cimas Obras v1.2: flexible plan and safe field correction workflow. */
.obra-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:16px;align-items:start}
.obra-stage-scroll{max-height:72vh;overflow:auto;border:1px solid #d5e2e5;border-radius:10px;background:#eaf0f2;touch-action:pan-x pan-y}
.obra-stage{position:relative;display:block;width:100%;min-width:100%;cursor:crosshair;line-height:0}
.obra-stage>img{display:block;width:100%;height:auto;user-select:none;-webkit-user-drag:none}
.obra-pin{position:absolute;transform:translate(-50%,-50%);padding:0;border:3px solid white;box-shadow:0 1px 8px #0007;min-width:32px;min-height:32px;border-radius:50%;background:var(--pin-color,#087e79);color:#fff;display:flex;justify-content:center;align-items:center;z-index:3;font-size:10px;font-weight:800;line-height:1.1}
.obra-pin img{width:26px;height:26px;object-fit:contain;border-radius:50%;background:#fff}
.obra-pin:hover,.obra-pin:focus{outline:3px solid #ffc04b;z-index:6}
.obra-pdf{width:100%;height:min(72vh,850px);border:1px solid #d5e2e5;border-radius:10px;background:#fff}
.obra-layer-row{display:flex;gap:8px;align-items:center;font-size:13px;line-height:1.4;padding:8px 0;border-bottom:1px solid #eff2f4;cursor:pointer}
.obra-layer-row input{width:17px;height:17px;margin:0}.obra-color{width:13px;height:13px;border-radius:50%;display:inline-block;flex-shrink:0}
.obra-symbol-row{display:flex;align-items:center;gap:11px;border-bottom:1px solid #eff2f4;padding:8px 0;font-size:12px}
.obra-symbol-row img{width:40px;height:40px;object-fit:contain;border:1px solid #eef1f3;border-radius:8px;padding:3px}
.obra-history{margin:10px 0;padding:10px;border:1px solid #dde6e9;border-radius:10px;background:#fbfcfd}
.obra-history summary{cursor:pointer;display:flex;justify-content:space-between;gap:14px;align-items:center}
.obra-history summary small{font-size:11px;color:#607986}.obra-history p{font-size:12px;color:#34515d}
.obra-history-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.obra-history-grid pre{background:#eef2f5;padding:10px;border-radius:7px;white-space:pre-wrap;word-break:break-word;max-height:280px;overflow:auto;font-size:10px}
.btn.danger{background:#fff0f0;color:#963a45;border-color:#e7b8be}
@media(max-width:1100px){.obra-layout{grid-template-columns:minmax(0,1fr)}}
@media(max-width:700px){.obra-stage-scroll{max-height:65vh}.obra-history-grid{grid-template-columns:1fr}.obra-pdf{height:66vh}}
/* Cimas Obras V1.3 - bitacora de actividades y dashboard responsive */
.cw-filters{display:grid;grid-template-columns:repeat(4,minmax(145px,1fr));gap:12px;background:#fff;border:1px solid #e3e9ee;border-radius:12px;padding:16px;margin:18px 0}
.cw-filters label{font-size:12px;color:#506573;font-weight:700;display:flex;flex-direction:column;gap:6px;min-width:0}
.cw-filters input,.cw-filters select{width:100%;min-width:0;border:1px solid #cbd8df;border-radius:8px;padding:9px 10px;background:#fff;color:#263946;font:inherit;font-weight:400}
.cw-filter-actions{display:flex;align-items:end;gap:8px}
.cw-filters .cw-search{grid-column:span 2}
.cw-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.cw-kpi{background:#fff;border:1px solid #e1e9ed;padding:18px;border-radius:12px;display:flex;flex-direction:column;gap:7px;min-height:109px}
.cw-kpi-label{font-size:12px;color:#546975}
.cw-kpi strong{font-size:25px;color:#132f3d;line-height:1.12}
.cw-kpi small{color:#72838d;font-size:11px}
.cw-section-title{display:flex;align-items:baseline;gap:14px;margin:22px 0 12px;font-size:17px}
.cw-section-title small{color:#81939c;font-size:12px;font-weight:400}
.cw-two-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.cw-progress{margin:14px 0 18px}
.cw-progress-head{display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:12px;color:#526774}
.cw-progress-head b{font-variant-numeric:tabular-nums;color:#263d4a;white-space:nowrap}
.cw-track{height:11px;border-radius:20px;background:#e7f0f1;margin-top:8px;overflow:hidden}
.cw-track-fill{height:100%;border-radius:20px;background:#1c938a}
.cw-table-title{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.cw-fieldset{border:1px solid #d9e4e9;border-radius:10px;padding:12px}
.cw-fieldset legend{font-size:13px;color:#375361;font-weight:700;padding:0 4px}
.cw-teamgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:8px 0}
.cw-checkline{display:flex;flex-direction:row!important;align-items:center;gap:8px;padding:10px;border:1px solid #e3ebee;border-radius:8px;background:#fbfcfd}
.cw-checkline input{width:17px;height:17px;flex-shrink:0}
.cw-checkline small{color:#81939c}
.cw-detail{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.cw-detail>div{border:1px solid #e3ebee;border-radius:9px;padding:11px;min-width:0;overflow-wrap:anywhere}
.cw-detail small{color:#758895;font-size:11px;display:block;margin-bottom:6px}
.cw-detail strong{font-size:13px;color:#253d49}
@media(max-width:1040px){.cw-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.cw-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.cw-filters{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px}.cw-filters .cw-search{grid-column:span 2}.cw-two-cols{grid-template-columns:1fr}.cw-teamgrid{grid-template-columns:1fr}.cw-section-title{display:block}.cw-detail{grid-template-columns:1fr}}
@media(max-width:430px){.cw-filters{grid-template-columns:1fr}.cw-filters .cw-search{grid-column:span 1}.cw-kpis{grid-template-columns:1fr}.cw-filter-actions{justify-content:stretch}.cw-filter-actions .btn{flex:1}}

.cw-levels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:26px}
@media(max-width:700px){.cw-levels{grid-template-columns:1fr}}
