*{box-sizing:border-box}body{margin:0;background:#f6f5ef;color:#22352f;font:16px system-ui}header{display:flex;align-items:center;gap:24px;justify-content:space-between;padding:22px 5%;border-bottom:1px solid #dedfd5;background:#fff}header b{font-size:27px;letter-spacing:5px}small{display:block;font-size:10px;letter-spacing:3px}.badge,.eyebrow{font-size:11px;font-weight:700;letter-spacing:1.5px}.badge{background:#e8edc9;padding:8px;border-radius:20px}main{max-width:1450px;margin:auto;padding:35px 5%}h1{font-size:clamp(32px,4vw,58px);line-height:1.1;font-weight:500;margin:20px 0}h2{font-size:22px;font-weight:600}p{line-height:1.6;color:#667369}.welcome{padding:45px 0;max-width:740px}.welcome label{max-width:440px}.heading,.toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px}.heading h1{font-size:38px}.workspace{display:grid;grid-template-columns:1fr 350px;gap:30px}.client,aside{background:white;padding:24px;border:1px solid #e0e2d8;border-radius:16px}aside{align-self:start;position:sticky;top:15px}label{display:block;font-size:13px;font-weight:600;margin-bottom:15px}select,input,textarea{display:block;width:100%;padding:13px;border:1px solid #d7ddd1;border-radius:8px;background:white;color:#22352f;font:inherit;margin-top:8px}textarea{resize:vertical;min-height:80px}button{padding:12px 17px;border-radius:8px;border:1px solid #d4dbcf;background:white;color:#183c34;cursor:pointer;font:600 14px system-ui}button:disabled{opacity:.4;cursor:default}.primary,.active{background:#183c34;color:#fff;border-color:#183c34}.primary{width:100%;margin:10px 0}.welcome .primary{max-width:440px}nav{display:flex;gap:8px;margin:22px 0}.toolbar input{max-width:220px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.card{background:white;border:1px solid #e0e2d8;border-radius:14px;overflow:hidden}.visual{height:150px;background:#e7e9df;display:flex;align-items:center;justify-content:center;font-size:48px;font-weight:300;letter-spacing:8px;color:#8a977d}.card-body{padding:20px}.card h3{margin:0;font-size:21px}.sizes{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.sizes input{padding:8px}.sizes label{margin:0}.hint{font-size:12px}.line{padding:12px 0;border-bottom:1px solid #e6e8df}.line button{padding:4px 9px;float:right}.summary{display:flex;justify-content:space-between;font-size:14px;margin:10px 0}.grand{font-size:23px;font-weight:700;border-top:1px solid #ddd;padding-top:14px}footer{padding:25px 5%;font-size:12px;color:#7b857b}#status{background:#eef2db;padding:10px;border-radius:8px}#status:empty{display:none}[hidden]{display:none!important}@media(max-width:1000px){.workspace{grid-template-columns:1fr 310px}.grid{grid-template-columns:1fr}}@media(max-width:740px){.workspace{grid-template-columns:1fr}aside{position:static}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.heading{display:block}header{gap:10px}.badge{font-size:9px}.toolbar{display:block}.toolbar input{max-width:none}.card-body{padding:14px}.sizes{grid-template-columns:repeat(2,1fr)}main{padding:20px 4%}}@media(max-width:430px){.grid{grid-template-columns:1fr}.visual{height:100px}}
.visual{height:240px;font-size:22px;letter-spacing:1px;background:#fff}.visual img{width:100%;height:100%;object-fit:contain;padding:12px}@media(max-width:430px){.visual{height:210px}}

.draft-actions{display:flex;flex-wrap:wrap;gap:8px}.draft-actions button{flex:1;font-size:12px;padding:10px}.line-qty{display:inline-block;width:75px;margin:8px 8px 0 0;padding:8px}dialog{border:1px solid #d4dbcf;border-radius:16px;padding:24px;width:min(900px,94vw);max-height:90vh;color:#22352f}dialog::backdrop{background:rgba(20,40,30,.55)}.review-head{display:flex;align-items:center;justify-content:space-between}.review-head h2{margin:0}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:14px}th,td{text-align:left;padding:12px 8px;border-bottom:1px solid #e0e2d8}th{background:#f6f5ef}#reviewNotes{white-space:pre-wrap;overflow-wrap:anywhere}#reviewTotals{max-width:400px;margin-left:auto}

.toolbar{flex-wrap:wrap;gap:12px}.toolbar label{min-width:140px}.toolbar input{flex:1;min-width:180px}#resultCount{width:100%;font-size:.85rem}#adminPanel{margin-bottom:24px;background:#fff;padding:20px;border-radius:12px}#adminForm{display:flex;flex-wrap:wrap;gap:12px;margin-top:16px}#adminForm label{flex:1;min-width:180px}#adminStatus{overflow-wrap:anywhere}#loginForm input,#passwordForm input{width:100%}[hidden]{display:none!important}

/* CLAYAN_SIZE_LIST_TRIAL */
.grid{grid-template-columns:1fr;gap:22px}
.card{display:grid;grid-template-columns:minmax(260px,1.2fr) minmax(220px,1fr);align-items:start}
.product-info{min-width:0}.product-info .visual{height:280px}
.product-info .card-body{padding:20px}.product-info h3{font-size:21px}
.size-column{padding:24px;border-left:1px solid #dedbd7;align-self:stretch}
.size-column h4{margin:0 0 16px;font-size:16px}
.size-column .sizes{display:flex;flex-direction:column;gap:0}
.size-column .sizes label{display:grid;grid-template-columns:50px minmax(70px,1fr) 82px;align-items:center;gap:10px;padding:9px 0;margin:0;border-bottom:1px solid #eeeae5;font-size:14px}
.size-column .size-number{font-size:17px;font-weight:600}
.size-column .size-stock{font-size:12px;font-weight:400;color:#65615e}
.size-column .sizes input{width:82px;margin:0;padding:9px;text-align:center;font-size:15px}
.size-column .primary{margin-top:18px}.size-column .list-hint{font-size:12px;color:#65615e;margin:6px 0 0}
@media(max-width:1000px){.card{grid-template-columns:minmax(200px,1fr) minmax(205px,1fr)}.size-column{padding:18px}.product-info .visual{height:230px}}
@media(max-width:560px){.card{grid-template-columns:1fr}.size-column{border-left:0;border-top:1px solid #dedbd7}.product-info .visual{height:230px}.size-column .sizes label{grid-template-columns:55px 1fr 90px}.size-column .sizes input{width:90px}}

body[data-catalogue="stock"] #sectionLabel{display:none!important}

.history-nav{display:flex;gap:8px;margin:16px 0}#orderPanel{background:#fff;padding:24px;border:1px solid #e2ddd7;border-radius:14px}#historyMore{margin-top:16px}#historyDetails{margin-top:24px}#historyDetails h4{margin-top:24px}#historyStatus{font-size:14px}

.service-badge{display:inline-flex;flex-direction:column;gap:4px;padding:6px 10px;border-radius:8px;font-weight:650;font-size:13px}.service-badge small{font-size:11px;font-weight:400}.service-badge.served{background:#e7f3eb;color:#176336}.service-badge.partial{background:#fff1dc;color:#84500d}.service-badge.pending{background:#fbe7e7;color:#9d2027}.service-badge.cancelled,.service-badge.unknown{background:#eee;color:#555}.pending-number{color:#b51f29!important;font-weight:750!important;font-variant-numeric:tabular-nums}

.history-model-info{display:flex;gap:16px;align-items:center;margin-top:24px}.history-model-info img{width:120px;height:100px;object-fit:contain;border:1px solid #e2ddd7;border-radius:8px;background:#fff}.history-model-info h4{margin:0!important}

.history-inline-detail>td{padding:20px;background:#faf7f4;border-bottom:2px solid #e5c9c6}.history-inline-detail #historyDetails{margin:0}.history-inline-detail #historyDetails>h3{margin-top:0}.history-inline-detail #historyDetails table{background:#fff}.history-inline-detail #historyDetails h4{margin-top:18px}[data-order-expand][aria-expanded="true"]{border-color:#ad3032;color:#9d2c30;background:#f7e9e8}

#historyLoading{display:flex;gap:10px;align-items:center;padding:16px;color:#9d2c30;font-weight:650;background:#f7e9e8;border-radius:10px;margin:16px 0}#historyLoading::before{content:'';width:18px;height:18px;border:2px solid #e6c0bc;border-top-color:#ad3032;border-radius:50%;animation:history-spin .8s linear infinite}@keyframes history-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){#historyLoading::before{animation:none}}

/* CLAYAN_CART_VISIBLE_ACTION_V1 */
.workspace>aside{display:flex;flex-direction:column;max-height:calc(100vh - 30px);max-height:calc(100dvh - 30px);overflow:hidden;padding:16px;top:15px}
.cart-scroll{min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:6px;overscroll-behavior:contain;scrollbar-gutter:stable}
.cart-action{flex:none;padding-top:10px;background:#fff;border-top:1px solid #e0e2d8}
.cart-action #simulate{width:100%;margin:0}
.cart-feedback{font-size:13px;line-height:1.4;margin:0 0 8px;overflow-wrap:anywhere}
.cart-feedback:empty{display:none}
@media(max-width:740px){.workspace>aside{max-height:80vh;max-height:80dvh;position:static;top:auto}}

/* CLAYAN_HISTORY_FILTERS_V1 */
#orderPanel .toolbar{align-items:flex-end;justify-content:flex-start}#orderPanel .toolbar label{flex:1 1 180px;margin-bottom:0}#orderPanel .toolbar input{max-width:none;min-width:0}#orderPanel .toolbar select{min-width:0}#orderPanel .toolbar>button{margin-bottom:0}@media(max-width:740px){#orderPanel .toolbar label{margin-bottom:12px}#orderPanel .toolbar>button{margin:0 8px 8px 0}}

/* CLAYAN_INSTALLABLE_V1 */
.install-panel{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:24px;padding:16px 20px;background:#fff;border:1px solid #d7ddd1;border-radius:12px}.install-panel>div{flex:1 1 240px}.install-panel p{font-size:13px;margin:5px 0 0}.install-panel>p{flex-basis:100%}.install-panel button{flex:none}.connection-note{padding:12px 16px;background:#fff1dc;border-radius:10px;color:#84500d}body{padding-bottom:env(safe-area-inset-bottom)}@media(max-width:740px){header{padding-top:max(16px,env(safe-area-inset-top))}.install-panel{padding:14px}.install-panel>div{flex-basis:100%}input,select,textarea{font-size:16px}}@media(display-mode:standalone){.install-panel{display:none}}

/* CLAYAN_MOVIL_LOGO_V1 */
.clayan-brand{display:flex;align-items:center;gap:12px}.clayan-brand>img{width:58px;height:58px;object-fit:contain}.clayan-brand small{margin-top:3px}
.mobile-history-search{display:none}
@media(max-width:740px){
 html,body{max-width:100%;}main,.workspace,.workspace>section,#app,#orderPanel{min-width:0}
 header{flex-wrap:wrap;padding:14px 5%;gap:10px}.clayan-brand{flex:1}.clayan-brand b{font-family:Georgia,serif;font-weight:500;letter-spacing:2px;font-size:28px}.clayan-brand small{font-size:10px;letter-spacing:1px}.clayan-brand>img{width:44px;height:44px}header .badge{font-size:9px}header #exit{padding:8px 10px;font-size:12px}
 main{padding:20px 5%}#app:has(#orderPanel:not([hidden]))>.heading{display:none}#orderPanel{background:transparent;border:0;padding:0;border-radius:0}#orderPanel>h2{font:700 34px/1.15 Georgia,serif;margin:20px 0 16px;color:#123c2d}#orderPanel>h2+p{display:none}
 #orderPanel>.toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:end}#orderPanel>.toolbar>label{min-width:0;margin:0;font-size:12px}#orderPanel>.toolbar input,#orderPanel>.toolbar select{min-width:0;max-width:100%;margin-top:5px;padding:12px 10px;font-size:16px}
 #orderPanel>.toolbar>label:has(#historyClientSearch),#orderPanel>.toolbar>label:has(#historySearch){display:none}.mobile-history-search{display:block!important;grid-column:1/-1}.mobile-history-search input{margin-top:0!important}#orderPanel .toolbar button{width:100%;min-height:44px;font-size:15px;padding:12px 6px}#historyRefresh{background:#254f3e;color:#fff;border-color:#254f3e}#orderPanel>.hint{display:none}#historyStatus{font-size:14px;margin:16px 0;color:#73776f}
 #orderPanel>.table-wrap{overflow:visible}#orderPanel>.table-wrap>table,#historyBody{display:block;width:100%}#orderPanel>.table-wrap>table>thead{display:none}
 #historyBody>tr:not(.history-inline-detail){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 14px;border:1px solid #e1d9cc;border-radius:14px;background:#fff;padding:15px;margin:0 0 12px;position:relative}
 #historyBody>tr>td{border:0;padding:0;min-width:0;overflow-wrap:anywhere;font-size:15px;line-height:1.4}
 #historyBody>tr:not(.history-inline-detail)>td:nth-child(1){grid-column:1;grid-row:1;font-size:17px;font-weight:750;align-self:center}#historyBody>tr:not(.history-inline-detail)>td:nth-child(1)::before{content:'Pedido '}
 #historyBody>tr:not(.history-inline-detail)>td:nth-child(4){grid-column:1/-1;grid-row:2;font-weight:600;font-size:15px}
 #historyBody>tr:not(.history-inline-detail)>td:nth-child(5){grid-column:2;grid-row:1;justify-self:end;align-self:start;background:#dfebfa;color:#235581;border-radius:24px;padding:5px 10px;font-size:12px;font-weight:700;text-align:center}
 #historyBody>tr>td[data-state="Servido"]{background:#dceecf!important;color:#1b571c!important}#historyBody>tr>td[data-state="En fabricación"],#historyBody>tr>td[data-state="Parcial"]{background:#ffe1a4!important;color:#80430d!important}#historyBody>tr>td[data-state="Anulado"]{background:#eee!important;color:#555!important}
 #historyBody>tr:not(.history-inline-detail)>td:nth-child(2){grid-column:1;grid-row:3}#historyBody>tr:not(.history-inline-detail)>td:nth-child(3){grid-column:2;grid-row:3;border-left:1px solid #e4dfd6;padding-left:14px}
 #historyBody>tr:not(.history-inline-detail)>td:nth-child(2)::before{content:'Fecha del pedido';display:block;font-size:12px;color:#7b7b75;margin-bottom:3px}#historyBody>tr:not(.history-inline-detail)>td:nth-child(3)::before{content:'Fecha de servicio';display:block;font-size:12px;color:#7b7b75;margin-bottom:3px}
 #historyBody>tr:not(.history-inline-detail)>td:nth-child(6){grid-column:1;grid-row:4}#historyBody>tr:not(.history-inline-detail)>td:nth-child(7){grid-column:2;grid-row:4;text-align:right;align-self:center;font-weight:600}
 #historyBody .service-badge{font-size:11px;padding:5px 7px;letter-spacing:0;max-width:100%}#historyBody .service-badge small{letter-spacing:0;font-size:11px}
 #historyBody>tr:not(.history-inline-detail)>td:nth-child(8){grid-column:1/-1;grid-row:5}#historyBody [data-order-expand]{width:100%;border:0;background:#e5e9dd;color:#183c34;font-size:16px;padding:11px;border-radius:8px}
 #historyMore{width:100%;background:#254f3e;color:white;font-size:16px;margin-top:0}#historyBody>.history-inline-detail{display:block;padding:0 0 16px}#historyBody>.history-inline-detail>td{display:block;padding:14px;border-radius:12px;background:#f5f2eb}#historyDetails{overflow-wrap:anywhere}#historyDetails table{font-size:12px;table-layout:fixed}#historyDetails td{padding:8px 3px;overflow-wrap:anywhere}#historyDetails .history-model-info{gap:10px;align-items:flex-start}#historyDetails .history-model-info img{width:80px;height:75px}#historyDetails h3{font-size:19px}#historyDetails h4{font-size:15px}
 .history-nav button{flex:1}.draft-actions button{flex-basis:100%}.toolbar input{min-width:0}.card{min-width:0}.workspace>aside{max-height:none;overflow:visible}.cart-scroll{overflow:visible}.size-column .sizes label{grid-template-columns:45px minmax(0,1fr) 80px}.size-column .sizes input{width:80px}
}

/* CLAYAN_CARRITO_MOVIL_V1 */
.mobile-cart-bar,.mobile-cart-return{display:none}
@media(max-width:740px){
 body.mobile-cart-active{padding-bottom:calc(90px + env(safe-area-inset-bottom))}
 .mobile-cart-bar{position:fixed;z-index:50;bottom:0;left:0;right:0;padding:10px 5% calc(10px + env(safe-area-inset-bottom));background:#f6f5ef;border-top:1px solid #dddcd2;box-shadow:0 -3px 16px #183c3414}
 .mobile-cart-bar:not([hidden]){display:block}.mobile-cart-bar button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:50px;background:#183c34;color:white;border-color:#183c34;border-radius:12px;font-size:16px;padding:13px 18px}
 .mobile-cart-return{display:block;width:100%;min-height:44px;margin-bottom:16px;background:#edf0e5;font-size:15px}
 .workspace>aside{scroll-margin-top:16px}.mobile-cart-bar strong{font-variant-numeric:tabular-nums}body:has(dialog[open]) .mobile-cart-bar{display:none!important}
}
