@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&display=swap');
:root{--ink:#33272c;--muted:#80767a;--green:#800020;--dark:#5c0018;--bg:#faf8f9;--line:#ebe3e5;--soft:#f7eaf0;--orange:#936c33;--red:#b34742}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px 'DM Sans',system-ui,sans-serif}button,input,select,textarea{font:inherit}button,a,label.import{touch-action:manipulation}button{cursor:pointer}a{color:inherit;text-decoration:none}button{border:0}.sidebar{width:248px;position:fixed;inset:0 auto 0 0;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:33px 21px 18px}.brand{display:flex;align-items:center;gap:11px;font:800 34px Manrope,sans-serif;letter-spacing:-1.8px;padding:0 10px}.brand-icon{color:var(--green);font-size:37px}.brand small{display:block;font:600 8px 'DM Sans',sans-serif;letter-spacing:1.8px;margin-top:1px}.workspace{display:flex;align-items:center;gap:10px;background:#faf8f9;border:1px solid var(--line);padding:13px 10px;margin:35px 0 29px;border-radius:9px;font-size:12px;font-weight:600}.workspace-icon{padding:8px 11px;border-radius:7px;background:#f0e5e8;color:var(--green)}small{display:block;color:var(--muted);font-size:11px;font-weight:400;margin-top:4px}.online{width:6px;height:6px;background:#a62750;border-radius:50%;margin-left:auto}.nav-label{font-size:9px;font-weight:700;color:#9ba59f;letter-spacing:1.5px;padding-left:13px;margin-bottom:13px}nav{display:flex;flex-direction:column;gap:6px}nav a{padding:13px 14px;display:flex;gap:13px;align-items:center;color:#806f76;font-size:18px;border-radius:7px}nav a span{font-size:13px;font-weight:500}nav a.active{background:var(--soft);color:var(--green)}nav a.active span{font-weight:700}nav a:hover{background:#fbf1f4}.sidebar-bottom{margin-top:auto;padding-top:25px}.local-note{display:flex;gap:9px;padding:14px 10px;color:var(--green);font-size:12px}.local-note small{font-size:10px}.side-button{display:block;background:none;color:#8b7780;font-size:11px;padding:8px 10px;width:100%;text-align:left;cursor:pointer}.side-button:hover{color:var(--green)}.profile{border-top:1px solid var(--line);margin-top:15px;padding:19px 7px 0;display:flex;align-items:center;gap:10px;font-weight:600;font-size:12px}.avatar{width:34px;height:34px;border-radius:50%;background:#f1e5e9;display:grid;place-items:center;color:var(--green);font-size:11px}.shell{margin-left:248px}.topbar{height:76px;border-bottom:1px solid var(--line);background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 42px;font-size:12px}.crumb{color:var(--muted)}.slash{margin:0 17px;color:#c4ccc7}.top-right{display:flex;align-items:center;gap:20px;color:var(--muted);font-size:11px}.demo-pill{border:1px solid #e7d7b8;background:#fbf4e8;color:#8b703f;border-radius:5px;padding:5px 8px;font-size:9px;letter-spacing:.7px}main{max-width:1600px;margin:auto;padding:36px 42px 28px;min-height:calc(100vh - 133px)}.page-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:27px}.eyebrow{font-size:10px;letter-spacing:1.7px;color:var(--green);font-weight:700;text-transform:uppercase;margin:0 0 10px}h1{font:750 29px Manrope,system-ui,sans-serif;letter-spacing:-1px;margin:0 0 9px}h2{font:700 16px Manrope,sans-serif;margin:0}h3{font-size:14px;margin:0 0 8px}p{line-height:1.6}.sub{font-size:12px;color:var(--muted);margin:0}.actions{display:flex;gap:10px;flex-wrap:wrap}.btn{padding:11px 16px;border-radius:7px;background:var(--green);color:#fff;font-size:12px;font-weight:600;display:inline-flex;gap:8px;align-items:center;justify-content:center;white-space:nowrap}.btn:hover{filter:brightness(.95)}.btn.secondary{background:white;border:1px solid #e7d9de;color:#6e4959}.btn.danger{background:#b95750}.btn.small{padding:8px 11px;font-size:11px}.text-btn{background:none;color:var(--green);font-size:11px;font-weight:600;padding:7px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:17px;margin-bottom:25px}.stat{background:#fff;border:1px solid var(--line);border-radius:10px;padding:19px 21px;position:relative}.stat-icon{position:absolute;right:18px;top:18px;background:#f8edf1;color:var(--green);width:31px;height:31px;display:grid;place-items:center;border-radius:8px;font-size:18px}.stat-label{font-size:11px;color:#88777e;margin:0 0 12px}.stat strong{font:700 32px Manrope,sans-serif;letter-spacing:-1px}.stat .stat-foot{font-size:10px;color:var(--muted);margin:9px 0 0}.stat.warn .stat-icon{background:#fcf3e5;color:var(--orange)}.stat.bad .stat-icon{background:#fcf0ee;color:var(--red)}.hero{border:1px solid #e7cfd8;background:#f7edf1;border-radius:11px;display:flex;justify-content:space-between;align-items:center;padding:25px 28px;margin-bottom:26px;position:relative;overflow:hidden}.hero h2{font-size:21px;line-height:1.45;letter-spacing:-.5px}.hero p{font-size:12px;color:#826672;margin:8px 0 17px;max-width:480px}.hero-art{width:180px;height:135px;position:relative;margin-right:30px}.paper{transform:rotate(-9deg);position:absolute;inset:7px 32px;background:#fff;border-radius:8px;box-shadow:0 9px 22px #5c001812;padding:15px}.paper b{color:var(--green);font-size:25px}.paper i{display:block;height:5px;background:#ecdae2;margin:10px 0;width:70%;border-radius:4px}.paper i:nth-child(3){width:95%}.art-qr{position:absolute;right:7px;bottom:0;border:7px solid white;border-radius:8px;background:white;box-shadow:0 5px 15px #5c001812;width:65px;height:65px}.grid-main{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(265px,1fr);gap:22px}.card{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-bottom:22px}.card-head{padding:21px 23px;display:flex;align-items:center;justify-content:space-between;gap:12px}.card-head p{font-size:11px;color:var(--muted);margin:6px 0 0}.card-body{padding:0 23px 22px}.tag{padding:5px 8px;font-size:10px;border-radius:5px;display:inline-block;white-space:nowrap;background:#edf5ef;color:var(--green)}.tag.orange{color:var(--orange);background:#fcf3e6}.tag.red{color:var(--red);background:#fcf0ee}.tag.gray{color:#7d8882;background:#f1f4f2}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap}th{background:#fcf9fa;color:#8b968f;font-size:9px;letter-spacing:.8px;text-transform:uppercase;font-weight:500;padding:12px 23px;border-block:1px solid #f0e7eb}td{padding:16px 23px;border-bottom:1px solid #f3ecef;font-size:12px}tr:last-child td{border-bottom:0}.product-cell{display:flex;align-items:center;gap:11px}.med-icon{display:grid;place-items:center;width:32px;height:34px;border:1px solid #eadce1;background:#faf1f5;color:#a55a73;border-radius:7px;font-size:17px}.product-cell b{font-weight:600}.product-cell small{font-size:10px}.alert-row{display:flex;align-items:flex-start;gap:11px;padding:16px 0;border-bottom:1px solid #f0e7eb}.alert-row:last-child{border:0}.alert-symbol{padding:8px;background:#fff5e8;color:var(--orange);border-radius:7px}.alert-row p{font-size:11px;margin:2px 0 4px;font-weight:600}.alert-row small{line-height:1.7;font-size:10px}.flow{display:flex;gap:10px;align-items:center;padding:15px 0;border-bottom:1px solid var(--line);font-size:11px}.flow:last-child{border:0}.step{width:25px;height:25px;border-radius:50%;background:#f6e9ef;color:var(--green);display:grid;place-items:center;font-size:10px}.flow small{font-size:10px}.toolbar{display:flex;align-items:center;gap:14px;justify-content:space-between;padding:16px 22px}.search{background:#fff;border:1px solid var(--line);border-radius:6px;padding:10px 12px;color:var(--ink);width:300px;max-width:100%;font-size:12px}.tabs{display:flex;gap:5px;flex-wrap:wrap}.tab{padding:8px 12px;border-radius:6px;background:none;font-size:11px;color:var(--muted)}.tab.active{background:var(--soft);color:var(--green)}.empty{padding:38px;text-align:center;color:var(--muted);line-height:1.8;font-size:12px}footer{padding:19px 42px;border-top:1px solid var(--line);font-size:10px;color:#95858d;display:flex;justify-content:space-between;gap:15px}dialog{border:1px solid var(--line);padding:0;border-radius:12px;width:660px;max-width:calc(100% - 24px);max-height:92vh;color:var(--ink);box-shadow:0 25px 90px #102a3633}dialog::backdrop{background:#3d102866;backdrop-filter:blur(3px)}.modal-head{padding:22px 25px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.close{font-size:24px;color:var(--muted);background:none;padding:0 5px}.modal-content{padding:24px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px}.field{display:flex;flex-direction:column;gap:7px;font-size:11px;font-weight:600}.field.full{grid-column:1/-1}.field input,.field select,.field textarea{width:100%;padding:11px;border:1px solid #e4d6dd;background:#fff;border-radius:6px;color:var(--ink);font-weight:400;font-size:12px}.field textarea{resize:vertical;min-height:75px}.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:23px}.notice{padding:13px 15px;border:1px solid #e9decb;background:#faf6ee;color:#826c45;border-radius:6px;font-size:11px;line-height:1.7;margin-bottom:20px}.error{color:var(--red);background:#fcf1ef;padding:10px;border-radius:5px;font-size:12px;margin:15px 0 0}.detail{padding:22px;background:#fcf9fa;border:1px solid var(--line);border-radius:8px;margin-bottom:18px}.detail p{font-size:12px;margin:9px 0}.rx-line{display:grid;grid-template-columns:1fr 75px 30px;gap:9px;background:#faf5f7;padding:13px;margin-bottom:10px;border-radius:7px}.rx-line .instructions{grid-column:1/3}.rx-line input,.rx-line select{padding:9px;min-width:0;width:100%;border:1px solid var(--line);border-radius:5px;background:white}.scan-box{background:#fff;border:1px dashed #b8899a;border-radius:12px;padding:45px 30px;text-align:center;margin-bottom:22px}.scan-glyph{font-size:42px;color:var(--green);margin-bottom:15px}.scan-box p{font-size:12px;color:var(--muted);max-width:450px;margin:12px auto 24px}.scan-input{display:flex;gap:10px;justify-content:center;margin:18px auto 0;max-width:520px}.scan-input input{flex:1;min-width:0}.qr-preview{text-align:center;margin:20px}.qr-preview img{width:165px;height:165px;image-rendering:pixelated}.qr-preview code{display:block;color:var(--muted);margin-top:10px;font-size:10px}.patient-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.patient-card{padding:23px;background:white;border:1px solid var(--line);border-radius:10px}.patient-card h3{margin-top:16px}.patient-card p{font-size:11px;color:var(--muted)}.visit{padding:14px 0;border-top:1px solid var(--line)}.visit p{white-space:pre-wrap;font-size:12px;overflow-wrap:anywhere}.rx-preview{padding:25px;border:1px solid var(--line);background:white;border-radius:10px}.rx-preview h2{font-size:23px}.rx-item{padding:15px 0;border-top:1px solid var(--line);line-height:1.7;font-size:12px}.rx-item p{white-space:pre-wrap;margin:6px 0;color:var(--muted)}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:var(--dark);color:white;padding:13px 22px;border-radius:8px;font-size:12px;box-shadow:0 5px 25px #5c001822;z-index:9;display:none;max-width:90vw}#print-area{display:none}video{width:100%;max-height:320px;object-fit:cover;border-radius:8px;background:#172e27}.muted{color:var(--muted)}input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible{outline:2px solid #ad5069;outline-offset:2px}.count{font-size:10px;color:var(--muted);font-weight:400;margin-left:8px}.border-top{border-top:1px solid var(--line);padding-top:18px}.line-end{display:flex;justify-content:space-between;gap:15px;align-items:center}.signed{font-size:11px;color:var(--muted);line-height:1.8}.rx-note{white-space:pre-wrap;overflow-wrap:anywhere}.demo-mark{font-size:10px;font-weight:600;color:var(--orange);letter-spacing:1px}button:disabled{opacity:.45;cursor:not-allowed}
@media(min-width:1500px){main{padding-top:45px}.hero{padding-block:30px}.stat{padding-block:24px}}@media(max-width:1150px){.sidebar{width:210px;padding-inline:14px}.shell{margin-left:210px}main{padding:28px 25px}.topbar{padding-inline:25px}.stats{gap:10px}.stat{padding:17px 13px}.stat-icon{right:12px;top:12px;width:25px;height:25px}.stat-label{max-width:105px}.grid-main{grid-template-columns:1fr}.patient-grid{grid-template-columns:1fr 1fr}.hero-art{margin-right:0}footer{padding-inline:25px}}@media(max-width:720px){.sidebar{position:relative;width:100%;height:auto;padding:16px;border-right:0;border-bottom:1px solid var(--line)}.brand{font-size:26px;padding:0 5px}.brand-icon{font-size:29px}.brand small{font-size:7px}.workspace,.nav-label,.sidebar-bottom{display:none}nav{flex-direction:row;overflow:auto;gap:4px;margin-top:17px}nav a{flex-shrink:0;padding:9px;font-size:15px;gap:6px}nav a span{font-size:11px}.shell{margin:0}.topbar{height:49px;padding:0 18px}.top-right #top-date{display:none}main{padding:25px 16px}.page-head{align-items:flex-start;flex-direction:column;gap:17px;margin-bottom:22px}h1{font-size:26px}.stats{grid-template-columns:1fr 1fr;gap:10px}.stat{padding:17px}.stat strong{font-size:28px}.hero{padding:21px}.hero-art{display:none}.hero h2{font-size:19px}.hero p{font-size:11px}.card-head,.card-body{padding-left:17px;padding-right:17px}th,td{padding:13px 17px}.patient-grid{grid-template-columns:1fr}.toolbar{flex-direction:column;align-items:stretch;padding:15px}.search{width:100%}.tabs{gap:0}.tab{padding:8px 9px}.form-grid{grid-template-columns:1fr}.field.full{grid-column:auto}.scan-box{padding:25px 15px}.scan-input{flex-direction:column}.scan-input .search{width:100%}footer{flex-direction:column;padding:18px;font-size:9px;gap:6px}.modal-content{padding:18px}.modal-head{padding:18px}.rx-line{grid-template-columns:minmax(0,1fr) 62px 24px;font-size:12px}.rx-preview{padding:18px}.line-end{flex-wrap:wrap}.top-right{gap:6px}}
@media print{body{background:white}.sidebar,.shell,dialog,#toast{display:none!important}#print-area{display:block;color:#111;padding:25px}.rx-preview{border:0}.qr-preview{float:right}.qr-preview img{width:140px;height:140px}.rx-item{break-inside:avoid}.btn{display:none}.demo-mark{color:#111}small,.muted{color:#555}}
.art-qr img{width:51px;height:51px;display:block}.sidebar-bottom .import input{display:none}

.mobile-tools{display:none}@media(max-width:720px){.mobile-tools{display:flex;gap:14px}.mobile-tools button{background:none;color:var(--green);padding:4px 0;font-size:11px}}

/* Identidad GAM: logotipo del portal de la alcaldía y acentos guinda. */
:root{--guinda:#800020;--guinda-dark:#5c0018;--rosa:#ad5069;--dorado:#b49b60}
.sidebar{border-top:5px solid var(--guinda);padding-top:25px}
.brand{display:block;padding:6px 2px 10px;letter-spacing:normal;line-height:0}
.brand img{display:block;width:100%;height:auto;max-width:210px;object-fit:contain}
.workspace{margin-top:24px}.workspace-icon{color:var(--guinda)}
.topbar{border-top:3px solid var(--guinda);height:76px}
nav a.active{box-shadow:inset 3px 0 var(--guinda)}
.hero{border-left:4px solid var(--guinda);background:linear-gradient(115deg,#f8edf2,#fcf8f4)}
.hero .eyebrow{color:#976a43}.paper b{color:var(--guinda)}
.btn{background:var(--guinda)}.tag:not(.orange):not(.red):not(.gray){background:#edf5ef;color:#326548}
.tag.orange{color:#8b672d}.demo-pill{color:#83642d;background:#fcf6e8;border-color:#e7d7b8}
.rx-letterhead{display:flex;justify-content:space-between;align-items:center;gap:20px;padding-bottom:20px;margin-bottom:22px;border-bottom:3px solid var(--guinda)}
.rx-letterhead img{width:185px;height:auto;object-fit:contain}.rx-letterhead>div{text-align:right;font-size:10px;letter-spacing:1px;color:var(--guinda)}
@media(max-width:720px){.sidebar{padding-top:13px}.brand img{width:180px;max-width:100%}.brand{padding:0 4px}.topbar{height:49px;border-top:0}nav{margin-top:15px}.rx-letterhead{gap:12px}.rx-letterhead img{width:145px}.rx-letterhead>div{font-size:8px;letter-spacing:.5px}}
@media print{.rx-letterhead{border-bottom-color:#800020}.rx-letterhead img{width:180px}}
.stock-count{font:700 10px 'DM Sans',sans-serif;background:#800020;color:#fff;min-width:19px;height:19px;border-radius:20px;display:grid;place-items:center;margin-left:auto}.stock-count[hidden]{display:none}.stock-bell{display:flex;gap:6px;align-items:center;border:1px solid var(--line);padding:6px 9px;border-radius:7px;color:var(--green);font-size:14px}.stock-bell span{font-size:11px;font-weight:700}.stock-bell.urgent{background:#fcf0ee;border-color:#e8b8b2;color:#9e3029}.stock-live{max-width:1600px;margin:0 auto}.stock-banner{margin:23px 42px 0;padding:14px 17px;border-radius:8px;background:#fff7e9;border:1px solid #ead6b4;display:flex;align-items:center;gap:12px;font-size:12px;color:#8a612b}.stock-banner.urgent{background:#fcf0ee;border-color:#e9c5c0;color:#9b3932}.stock-banner small{color:inherit;font-size:10px;line-height:1.5}.stock-banner .text-btn{margin-left:auto;color:inherit;white-space:nowrap}.stock-banner-icon{width:25px;height:25px;border:1px solid currentColor;display:grid;place-items:center;border-radius:50%;flex-shrink:0;font-weight:700}.stock-critical{color:#b34742}.stock-low{color:#936c33}.stock-rules{display:grid;grid-template-columns:repeat(3,1fr);gap:25px}.stock-rules p{font-size:11px;color:var(--muted)}.stock-limit-row,.stock-limit-head{display:grid;grid-template-columns:minmax(0,1fr) 85px 85px;align-items:center;gap:14px;padding:13px 0;border-bottom:1px solid var(--line);font-size:12px}.stock-limit-head{font-size:10px;color:var(--muted);text-transform:uppercase}.stock-limit-row b{font-size:12px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.stock-banner b{font-weight:600}@media(max-width:1150px){.stock-banner{margin-inline:25px}}@media(max-width:720px){.stock-banner{margin:17px 16px 0;gap:9px;flex-wrap:wrap;font-size:11px}.stock-banner>div{flex:1;min-width:200px}.stock-banner .text-btn{margin-left:30px;padding:2px}.stock-bell{padding:4px 7px}.stock-rules{grid-template-columns:1fr;gap:9px}.stock-limit-row,.stock-limit-head{grid-template-columns:minmax(0,1fr) 63px 63px;gap:8px}.stock-limit-row .field input{padding:9px 6px}.stock-limit-row b{font-size:11px}.stock-limit-row small{font-size:9px}.topbar .slash{margin-inline:9px}}

.notice-icon{width:17px;height:17px;flex-shrink:0}nav .notice-icon{margin-block:1px}.sidebar{overflow-y:auto}@media(max-width:720px){nav .notice-icon{width:14px;height:14px}}

nav a span{white-space:nowrap}.stock-count{flex-shrink:0}.stock-bell .notice-icon{display:block}
.unit-modes{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-bottom:22px}.unit-mode{display:flex;align-items:center;gap:13px;padding:19px;text-align:left;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:9px}.unit-mode.active{background:#f8edf2;border-color:#bb7a93;box-shadow:inset 0 0 0 1px #bb7a93;color:var(--guinda)}.unit-mode>span{font-size:23px}.unit-mode b{font-size:12px}.unit-mode small{font-size:10px}.unit-selection{display:flex;gap:20px;justify-content:space-between;align-items:center;margin-bottom:22px}.unit-selection h2{margin-top:13px;font-size:20px}.unit-selection p{font-size:12px;color:var(--muted)}.unit-counter{display:flex;align-items:center;justify-content:space-between;background:#faf5f7;border:1px solid var(--line);border-radius:10px;padding:25px 30px;margin-bottom:25px}.unit-counter p{font-size:10px;letter-spacing:1.5px;color:var(--green);margin:0}.unit-counter strong{font:750 65px Manrope,sans-serif;color:var(--guinda);line-height:1.5}.unit-balance{display:flex;flex-direction:column;gap:16px;font-size:12px;color:var(--muted)}.unit-balance b{color:var(--ink)}.unit-scan-form{display:flex;align-items:flex-end;gap:12px}.unit-scan-form .field{flex:1}.unit-scan-form input{font-size:18px;padding:16px}.unit-scan-form .btn{padding:19px}.unit-feedback{padding:15px;border-radius:7px;background:#f3f5f4;color:var(--muted);font-size:12px;line-height:1.6;margin:20px 0}.unit-feedback.valid{background:#eaf5ee;color:#276947}.unit-feedback.invalid{background:#fff0ee;color:#a5352b}.unit-footer{display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:22px}.unit-review{padding:20px;background:#faf5f7;border-radius:7px;display:flex;flex-direction:column;gap:10px}.unit-review b{font-size:25px;color:var(--guinda)}.unit-review span{font-size:12px;color:var(--muted)}.unit-label{text-align:center;padding:15px}.unit-label-logo{width:180px;height:auto;margin-bottom:20px}.unit-label p{font-size:13px}.unit-label small{font-size:10px}@media(max-width:1000px){.unit-modes{gap:8px}.unit-mode{padding:15px;gap:9px}}@media(max-width:720px){.unit-modes{grid-template-columns:1fr}.unit-mode{padding:14px}.unit-counter{padding:20px;gap:15px}.unit-counter strong{font-size:55px}.unit-balance{font-size:11px}.unit-selection{align-items:flex-start;flex-direction:column;gap:5px}.unit-scan-form{flex-direction:column;align-items:stretch}.unit-scan-form .btn{padding:12px}.unit-footer>.actions{width:100%;justify-content:space-between}.unit-footer .btn{padding:11px;font-size:11px}}
.unit-camera{border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-top:18px}.unit-camera-head{padding:17px 20px;display:flex;align-items:center;justify-content:space-between;gap:15px}.unit-camera-head h3{margin:0}.unit-camera-head p{margin:6px 0 0;font-size:11px;color:var(--muted)}.unit-viewfinder{background:#21191d;position:relative;min-height:210px;height:300px;overflow:hidden;display:grid;place-items:center}.unit-viewfinder video{height:100%;width:100%;max-height:none;object-fit:contain;border-radius:0;background:#21191d}.unit-frame{position:absolute;left:10%;right:10%;top:22%;bottom:25%;border:2px solid #dcb981;border-radius:14px;pointer-events:none;box-shadow:0 0 0 1000px #00000028}.unit-camera-hint{position:absolute;bottom:17px;font-size:11px;color:#fff;background:#0008;padding:6px 12px;border-radius:5px;max-width:90%;text-align:center}.unit-camera-message{padding:14px 20px;margin:0;background:#faf5f7;font-size:12px;line-height:1.7;min-height:55px}.unit-camera>.signed{padding:0 20px 15px;overflow-wrap:anywhere}.unit-manual{margin:18px 0}.unit-manual summary{font-size:12px;color:var(--green);cursor:pointer;padding:10px 0}.unit-manual .unit-scan-form{margin-top:15px}.unit-camera button[hidden]{display:none}.unit-camera-message code{overflow-wrap:anywhere}@media(max-width:720px){.unit-camera-head{padding:15px;align-items:flex-start;flex-direction:column}.unit-viewfinder{height:250px}.unit-camera-message{padding:12px 15px;font-size:11px}.unit-counter{margin-bottom:16px}}
.unit-camera-count{position:absolute;top:15px;right:15px;background:#800020;color:white;border:1px solid #ffffff66;border-radius:6px;padding:8px 12px;font-size:12px;font-weight:600}
.receipt-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:22px;align-items:start}.receipt-steps{display:flex;align-items:center;gap:15px;margin:-3px 0 24px;font-size:11px;color:var(--muted)}.receipt-steps span{padding:8px 13px;background:#fff;border:1px solid var(--line);border-radius:20px}.receipt-steps .active{background:#f8edf2;color:var(--guinda);border-color:#e2bfcd}.receipt-steps i{font-style:normal}.receipt-steps p{margin-left:auto;font-size:11px}.receipt-methods{display:flex;gap:8px;margin-bottom:16px}.receipt-method{border:1px solid var(--line);border-radius:7px;background:#fff;padding:12px;flex:1;font-size:12px;font-weight:600;color:var(--muted)}.receipt-method.active{background:#800020;border-color:#800020;color:white}.receipt-camera-actions{display:flex;align-items:center;gap:10px;justify-content:space-between;padding:13px 0}.receipt-camera-actions .unit-camera-message{padding:0;background:none}.receipt-camera-actions p{margin:0;flex:1;line-height:1.6}.receipt-camera [hidden],.receipt-gun[hidden],.receipt-camera[hidden]{display:none!important}.receipt-tip{margin-bottom:0;font-size:10px;line-height:1.7}.receipt-gun{padding:25px 12px;background:#faf6f8;border-radius:9px;text-align:center}.receipt-gun .scan-glyph{display:block;margin-bottom:10px}.receipt-gun form{text-align:left}.receipt-gun input{font-size:17px;padding:15px}.receipt-gun form>.btn{margin-top:12px;width:100%}.receipt-total{text-align:center;padding:9px 14px;background:#f8edf2;border-radius:8px;color:var(--guinda)}.receipt-total b{font:700 26px Manrope,sans-serif}.receipt-total small{font-size:9px}.receipt-save{width:100%;margin:18px 0 10px;padding:14px}.receipt-reference{margin-top:14px;font-size:11px;color:var(--muted)}.receipt-reference summary{cursor:pointer}.receipt-reference input{width:100%;margin-top:10px}.receipt-empty-icon{display:block;font-size:35px;margin:10px;color:#b595a0}.receipt-row-count{color:var(--guinda);font-size:18px}.receipt-pending .eyebrow{font-size:9px}.receipt-pending h2{font-size:19px}.receipt-pending .signed{overflow-wrap:anywhere}.receipt-pending form{margin-top:20px}.receipt-basket .card-body>small{font-size:10px}.receipt-layout th,.receipt-layout td{padding:13px 17px}.receipt-layout table .text-btn{font-size:10px;padding:4px}.receipt-basket .card-head{padding-bottom:17px}.receipt-capture .unit-viewfinder{height:260px;border-radius:8px}.receipt-capture .card-head p{line-height:1.6}@media(max-width:1200px){.receipt-layout{grid-template-columns:1fr}.receipt-steps p{display:none}}@media(max-width:720px){.receipt-steps{gap:8px;font-size:10px;flex-wrap:wrap}.receipt-layout{gap:0}.receipt-steps span{padding:8px 11px}.receipt-camera-actions{align-items:flex-start}.receipt-capture .unit-viewfinder{height:230px}.receipt-pending .form-actions{flex-direction:column-reverse}.receipt-layout .card-head h2{font-size:15px}}
.product-cell>div{min-width:230px;max-width:540px;white-space:normal;line-height:1.6}.product-cell small{line-height:1.6;font-size:10px}.product-cell b{overflow-wrap:anywhere}#inventory-table td:nth-child(2){min-width:340px}.rx-note{white-space:pre-wrap;overflow-wrap:anywhere}

/* Nombre institucional */
.workspace>span:nth-child(2){min-width:0;line-height:1.5}.workspace-icon,.online,.avatar{flex-shrink:0}.profile>div:last-child{min-width:0;line-height:1.5}.topbar>span:first-child{min-width:0;line-height:1.5;padding-right:16px}.top-right{flex-shrink:0}.rx-letterhead>div{max-width:280px;line-height:1.5}

/* Perfil y prescripción */
.doctor-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,1fr);gap:22px;align-items:start}.doctor-layout .card-body>p{font-size:12px;line-height:1.8}.doctor-layout form>.form-grid{margin-top:20px}.prescriber-summary{line-height:1.8;font-size:12px}.structured-rx{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:20px;background:#faf7f8;border:1px solid var(--line);border-radius:9px;margin:18px 0}.structured-rx .full{grid-column:1/-1}.structured-rx input.instructions{grid-column:auto}.rx-remove{display:flex;justify-content:flex-end;align-items:end}.rx-signature{margin:32px 0 15px;line-height:1.8}.rx-preview .border-top{line-height:1.8;overflow-wrap:anywhere}.rx-item{break-inside:avoid}.rx-item p{white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:900px){.doctor-layout{grid-template-columns:1fr}}@media(max-width:600px){.structured-rx{grid-template-columns:1fr;padding:15px}.structured-rx .full{grid-column:auto}}@media print{.rx-signature{break-inside:avoid}.rx-preview .border-top{break-inside:avoid}}

/* Editable catalog and lot dropdowns. */
.search-select{position:relative;width:100%;font-weight:400}.search-select input{width:100%;box-sizing:border-box;padding-right:30px}.search-select:after{content:'⌄';position:absolute;right:12px;top:10px;pointer-events:none}.search-select-results{position:absolute;top:100%;left:0;right:0;max-height:260px;overflow-y:auto;background:#fff;border:1px solid #c9d5cf;border-radius:9px;box-shadow:0 12px 24px #173b2526;z-index:30}.search-select-results[hidden]{display:none}.search-select-results [role=option]{padding:12px;cursor:pointer;border-bottom:1px solid #edf1ee;line-height:1.45}.search-select-results [role=option]:hover,.search-select-results [aria-selected=true]{background:#e7f3ed;color:#194b38}.search-select-results p{padding:12px;font-size:13px}.search-select select[hidden]{display:none}#unit-identify{margin-bottom:10px}
.box-reader{border:1px solid #e5ccd5;border-radius:9px;padding:16px;background:#fcf8fa;margin:0 0 20px}.box-reader-head{display:flex;align-items:center;gap:14px;justify-content:space-between}.box-reader-head h3{font-size:13px;margin:0 0 7px}.box-reader-head p{font-size:11px;color:var(--muted);margin:0;line-height:1.6}.box-reader-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:13px}.box-photo-label{cursor:pointer}.box-photo-label input{display:none}.box-status{font-size:11px;color:var(--green);line-height:1.7;margin:13px 0 0}.box-capture-area{margin-top:15px}.box-capture-area .unit-viewfinder{height:270px}.box-capture-area video{object-fit:contain}.box-text-frame{position:absolute;left:6%;right:6%;top:18%;bottom:18%;border:2px solid #dcba81;border-radius:9px;pointer-events:none}.box-camera-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.box-result{border-top:1px solid var(--line);padding-top:18px;margin-top:18px}.box-result .eyebrow{font-size:9px}.box-result details{margin:13px 0;font-size:11px;color:var(--muted)}.box-result pre{max-height:150px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:11px monospace;line-height:1.6}.box-review{margin-top:15px;font-size:11px;line-height:1.7;color:var(--ink)}.box-review label{display:flex;gap:9px;align-items:flex-start}.box-review input[type=checkbox]{margin:4px 0;accent-color:var(--guinda);width:16px;height:16px;flex-shrink:0}.box-result .field select{font-size:11px}.box-capture-area[hidden],.box-review[hidden]{display:none}@media(max-width:720px){.box-reader-head{flex-direction:column;align-items:stretch}.box-reader{padding:14px}.box-camera-actions>.btn{width:100%}.box-capture-area .unit-viewfinder{height:220px}}

/* Identidad de la clínica CBM. */
.sidebar{overflow-y:auto}
.brand.brand-pair{display:flex;flex-direction:column;gap:13px;padding:0 9px;flex-shrink:0;letter-spacing:normal}
.brand-pair .brand-cbm{width:190px;max-width:100%;height:auto}
.brand-pair+.workspace{margin:21px 0 20px}
.rx-letterhead .rx-cbm{max-width:260px;width:46%;text-align:right}
.rx-letterhead .rx-cbm img{display:block;width:100%;height:auto}
.rx-letterhead .rx-cbm small{font-size:9px;letter-spacing:.4px;margin-top:5px}
@media(max-width:720px){
 .brand.brand-pair{flex-direction:row;justify-content:space-between;gap:18px;padding:0 4px}
 .brand-pair .brand-cbm{width:190px;max-width:100%}
 .rx-letterhead>img{width:42%;max-width:145px}
 .rx-letterhead .rx-cbm{width:50%;max-width:210px}
}
@media print{.rx-letterhead .rx-cbm{width:245px;max-width:46%}}

.rx-letterhead{justify-content:flex-end}

/* Firmas por doctor */
.signature-editor{margin-top:24px;padding-top:15px;border-top:1px solid var(--line)}.signature-editor canvas{display:block;background:#fff;border:1px solid #cbbbc2;border-radius:8px;width:100%;height:auto;aspect-ratio:3.2;touch-action:none;cursor:crosshair;margin:15px 0}.signature-editor .actions{flex-wrap:wrap}.signature-upload{position:relative;overflow:hidden;cursor:pointer}.signature-upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.signature-upload:focus-within{outline:2px solid #800020;outline-offset:3px}.saved-signature{margin:22px 0 12px;break-inside:avoid}.saved-signature img{display:block;width:240px;max-width:100%;height:75px;object-fit:contain;object-position:left center;background:white}.saved-signature figcaption{font-size:10px;color:var(--muted);margin-top:5px}.prescriber-summary .saved-signature{margin-top:12px}@media print{.saved-signature{break-inside:avoid}.saved-signature img{width:240px;height:75px}.saved-signature figcaption{color:#333}}

/* Presentación conjunta CBM y GAM. */
.brand-pair .brand-gam{width:174px;max-width:100%;height:auto}
.brand-pair .brand-divider{display:block;width:100%;height:1px;background:var(--line)}
.rx-letterhead{justify-content:space-between}
@media(max-width:720px){.brand-pair .brand-gam{width:43%;max-width:175px}.brand-pair .brand-cbm{width:43%;max-width:190px}.brand-pair .brand-divider{width:1px;height:42px;flex-shrink:0}}

#visit-medications{border:0;padding:0;margin:14px 0;min-width:0}.consultation-toggle{display:flex;align-items:center;gap:10px;line-height:1.6}.consultation-toggle input{width:18px;height:18px;accent-color:var(--green);flex-shrink:0}#visit-medications[hidden]{display:none}

.camera-receiving{max-width:900px;margin:0 auto 24px}.camera-receiving .unit-viewfinder{height:320px}.camera-receiving .card-body{padding-top:0}.intake-steps{display:flex;gap:8px;margin:0 0 18px;flex-wrap:wrap}.intake-steps span{font-size:12px;padding:9px 14px;border-radius:30px;background:#f5f0f2;color:var(--muted)}.intake-steps .active{background:var(--guinda,#800020);color:white}.intake-product{margin-top:20px;margin-bottom:18px}.intake-recognized{font-size:11px;color:var(--muted);margin:18px 0}.intake-recognized pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;overflow:auto}.camera-receiving [data-intake-choices] .field{margin-top:16px}.camera-receiving [data-intake-link]{margin-bottom:18px}.camera-receiving [data-intake-link][hidden]{display:none}@media(max-width:720px){.camera-receiving .unit-viewfinder{height:250px}.camera-receiving .form-actions{flex-direction:column-reverse}.intake-steps span{font-size:10px;padding:8px 9px}}

/* Opciones de cámara y lector del celular. */
#unit-identify{display:flex;flex-wrap:wrap;align-items:end;gap:10px}#unit-identify>.field{flex:1 1 300px;min-width:0}#unit-identify>.btn{flex:0 1 auto}.btn[hidden],a[hidden]{display:none!important}#phone-link-qr img{max-width:100%;height:auto}#phone-link-state{overflow-wrap:anywhere}@media(max-width:720px){#unit-identify>.field,#unit-identify>.btn{flex-basis:100%;width:100%}}

.stock-limits-actions{position:sticky;bottom:0;background:var(--surface,#fff);padding:12px 0 0;border-top:1px solid #ddd;z-index:2}
