*{box-sizing:border-box}html,body{margin:0;height:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#0b1930;background:#f3f6fb}button,input,textarea,select{font:inherit}.xapp-login{display:grid;place-items:center;min-height:100dvh;padding:24px;background:#07182b}.xapp-login-card{width:min(390px,100%);background:#fff;border-radius:24px;padding:30px;box-shadow:0 20px 80px #0005}.xapp-brand{font-size:36px;font-weight:900;letter-spacing:2px}.xapp-login-card>small{color:#6b7b91}.xapp-login-card h1{margin:32px 0 5px}.xapp-login-card p{color:#68768a}.xapp-login-card label{display:block;font-size:13px;font-weight:700;margin:16px 0}.xapp-login-card input{display:block;width:100%;padding:13px;border:1px solid #dce3ec;border-radius:12px;margin-top:6px}.xapp-login-card button,.primary{width:100%;border:0;border-radius:12px;padding:14px;background:#ffd21c;font-weight:800}.xapp-error{background:#fff0f1;color:#a61b2b;padding:10px;border-radius:10px}.app-shell{height:100dvh;display:grid;grid-template-rows:auto 1fr;background:#f4f7fb}.app-top{padding:max(14px,env(safe-area-inset-top)) 16px 12px;background:#07182b;color:#fff;display:flex;align-items:center;gap:10px}.app-logo{font-weight:900;font-size:21px;letter-spacing:1px}.app-logo small{display:block;font-size:10px;font-weight:500;letter-spacing:0;color:#b8c6d8}.app-top .spacer{flex:1}.icon-btn{border:0;background:#ffffff12;color:inherit;border-radius:12px;padding:9px 11px}.view{overflow:hidden;min-height:0}.inbox{height:100%;display:grid;grid-template-rows:auto auto 1fr}.searchrow{display:flex;gap:8px;padding:12px;background:#fff}.searchrow input{flex:1;border:1px solid #e1e7ef;border-radius:22px;padding:11px 14px}.add{border:0;width:44px;height:44px;border-radius:50%;background:#ffd21c;font-size:25px}.filters{display:flex;gap:6px;padding:0 12px 10px;background:#fff;overflow:auto}.filters button{white-space:nowrap;border:0;border-radius:20px;padding:7px 10px;background:#f1f4f8;font-size:11px}.filters .on{background:#fff3b8;box-shadow:inset 0 0 0 1px #ffd21c}.list{overflow:auto}.row{display:grid;grid-template-columns:46px 1fr auto;gap:10px;padding:14px 15px;background:#fff;border-top:1px solid #edf1f5}.avatar{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#e8edf5;font-weight:800}.row h3{margin:0;font-size:14px}.row p{margin:3px 0;font-size:11px;color:#53657d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:65vw}.dot{width:11px;height:11px;border-radius:50%;background:#aab5c4;margin:4px auto}.dot.pending{background:#ffbd16}.dot.completed{background:#19a866}.dot.incident{background:#ef2d4e}.time{font-size:10px;color:#748196}.chat{height:100%;display:grid;grid-template-rows:auto 1fr auto;background:#eef3f8}.chat-head{display:flex;align-items:center;gap:10px;padding:10px 12px;background:#fff;border-bottom:1px solid #e7ecf2}.back{border:0;background:none;font-size:25px;padding:4px}.chat-head h2{font-size:14px;margin:0}.chat-head small{display:block;color:#66768d;font-size:10px}.chat-head select{margin-left:auto;border:1px solid #dce3ec;border-radius:18px;padding:7px;font-size:11px}.thread{overflow:auto;padding:16px 12px}.bubble{display:flex;margin:8px 0}.bubble>div{max-width:82%;background:#fff;padding:11px 13px;border-radius:14px;font-size:13px;line-height:1.45;box-shadow:0 1px 2px #0000000a}.bubble.out{justify-content:flex-end}.bubble.out>div{background:#fff2b7}.meta{display:flex;justify-content:flex-end;gap:7px;margin-top:5px;font-size:9px;color:#718096}.channel{font-weight:700}.compose{background:#fff;padding:9px 10px calc(9px + env(safe-area-inset-bottom));border-top:1px solid #e1e7ef}.compose textarea{width:100%;border:0;resize:none;min-height:48px;max-height:110px;outline:0}.compose-tools{display:flex;gap:7px;align-items:center}.compose-tools select,.tplbtn{border:1px solid #dde4ec;background:#fff;border-radius:18px;padding:8px;font-size:11px}.send{margin-left:auto;border:0;background:#ffd21c;border-radius:12px;padding:10px 16px;font-weight:800}.modal{position:fixed;inset:0;background:#06142580;display:grid;align-items:end;z-index:20}.sheet{background:#fff;border-radius:24px 24px 0 0;padding:20px 16px calc(20px + env(safe-area-inset-bottom));max-height:88dvh;overflow:auto}.sheet h2{margin:0 0 14px}.sheet label{display:block;font-size:12px;font-weight:700;margin:12px 0}.sheet input,.sheet select{display:block;width:100%;margin-top:5px;padding:12px;border:1px solid #dce3ec;border-radius:11px}.sheet .tabs{display:flex;gap:7px}.sheet .tabs button{flex:1;border:0;border-radius:12px;padding:10px}.sheet .tabs .on{background:#ffd21c}.sheet-actions{display:flex;gap:8px;margin-top:18px}.sheet-actions button{flex:1;padding:12px;border:0;border-radius:12px}.templates{display:grid;gap:8px}.template{padding:12px;border:1px solid #e2e7ee;border-radius:12px;background:#fff;text-align:left}.empty{height:100%;display:grid;place-items:center;text-align:center;padding:30px;color:#67778c}.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:#07182b;color:#fff;padding:10px 14px;border-radius:20px;font-size:12px;z-index:50}@media(min-width:850px){.app-shell{max-width:1100px;margin:auto;box-shadow:0 0 50px #0012}.view{display:grid;grid-template-columns:360px 1fr}.inbox{border-right:1px solid #dde4ec}.chat .back{display:none}.row p{max-width:230px}}
/* v0.3.1 mobile conversation navigation + unread indicators */
.notify-btn{position:relative}.notify-btn i{position:absolute;right:2px;top:2px;min-width:16px;height:16px;padding:0 4px;border-radius:10px;background:#ef2d4e;color:#fff;font-size:9px;font-style:normal;font-weight:800;display:grid;place-items:center;border:2px solid #07182b}.unread-count{display:inline-grid;place-items:center;min-width:17px;height:17px;padding:0 4px;margin-left:4px;border-radius:10px;background:#ffd21c;color:#07182b;font-size:9px;vertical-align:1px}.row.has-unread h3{font-weight:900}.menu-action{display:flex!important;gap:12px;align-items:center;text-decoration:none;color:#0b1930}.menu-action>span{font-size:20px;width:28px;text-align:center}.menu-action div{display:grid;gap:3px}.menu-action small{color:#68768a}.menu-bottom{margin-top:18px}.danger{color:#9b1c2d}.template.disabled{opacity:.55}.chat-title{min-width:0}.chat-title small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:52vw}
@media(max-width:849px){.view{position:relative}.view>.inbox,.view>.chat,.view>.chat-empty{position:absolute;inset:0}.app-shell:not(.show-chat) .chat,.app-shell:not(.show-chat) .chat-empty{display:none}.app-shell.show-chat .inbox{display:none}.app-shell.show-chat .chat{display:grid}.chat-head .back{display:block}.chat-head{padding-left:6px}.chat-head .avatar{width:38px;height:38px}.chat-head select{max-width:118px}.thread{padding-bottom:20px}}
/* v0.4.0: chat interno único, WhatsApp auxiliar y creación completa de contratos */
.wa-outline{width:38px;height:38px;border:1.5px solid #0b1930;background:#fff;border-radius:50%;padding:8px;display:grid;place-items:center;color:#0b1930}.wa-outline svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.section-label{margin:20px 0 4px;padding-top:14px;border-top:1px solid #e7ecf2;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:#6b7b91}.hint{color:#68768a;font-size:12px;line-height:1.5}.sheet label.check{display:flex;align-items:center;gap:9px}.sheet label.check input{width:18px;height:18px;margin:0}.row{touch-action:pan-y;user-select:none;-webkit-user-select:none}.template small{display:block;margin-top:4px;color:#68768a;font-weight:400}
.date-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.ical-list{display:flex;flex-direction:column;gap:8px;max-height:48vh;overflow:auto}.ical-event{width:100%;text-align:left;border:1px solid #dce4ee;background:#fff;border-radius:14px;padding:14px;color:#0b1b31}.ical-event b,.ical-event span{display:block}.ical-event span{font-size:12px;color:#68778c;margin-top:4px}.mini-back{border:0;background:transparent;padding:0 0 10px;font-weight:700;color:#0b1b31}@media(max-width:520px){.date-grid{grid-template-columns:1fr}.tabs{overflow-x:auto;white-space:nowrap}.tabs button{flex:0 0 auto}}
/* v0.5.0 — timeline de comunicaciones externas */
.timeline-item{display:flex;justify-content:flex-end;margin:10px 0}.timeline-item>div{width:min(86%,620px);background:#fff;padding:13px 14px;border-radius:14px;border-left:4px solid #c7cdd5;box-shadow:0 1px 2px #0000000a;font-size:13px;line-height:1.45}.timeline-item.email>div{border-left-color:#9aa6b5}.timeline-item.whatsapp>div{border-left-color:#bcc4cc}.timeline-empty{text-align:center;color:#7b8798;font-size:12px;padding:40px 20px}.compose-tools .spacer{flex:1}.channel-btn{display:flex;align-items:center;gap:7px;border:1.5px solid #0b1930;background:#fff;color:#0b1930;border-radius:20px;padding:8px 11px;font-weight:750;font-size:11px}.channel-btn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.channel-btn:disabled{opacity:.3}.contact-card{display:grid;grid-template-columns:auto 1fr;gap:8px 14px;padding:12px;border:1px solid #e2e7ee;border-radius:12px}.contact-card span{color:#68768a;overflow-wrap:anywhere}@media(max-width:520px){.channel-btn span{display:none}.channel-btn{width:40px;height:40px;border-radius:50%;padding:9px;justify-content:center}.timeline-item>div{max-width:92%}}
/* v0.5.3 — origen visual del timeline: plantilla / email / WhatsApp */
.timeline-item>div{border-left-width:5px}
.timeline-item.origin-template>div{border-left-color:#f4c84a}
.timeline-item.channel-email>div{border-left-color:#83bce8}
.timeline-item.channel-whatsapp>div{border-left-color:#74c99a}

/* v0.5.5 — UI refinement: fluid mobile interactions + robust timeline cards */
:root{--xekin-ink:#0b1930;--xekin-yellow:#ffd21c;--xekin-surface:#fff;--xekin-line:#e3e9f0}
button,.row,.template,.ical-event,.channel-btn,.icon-btn,.add{ -webkit-tap-highlight-color:transparent }
button,.row,.template,.ical-event,.channel-btn,.icon-btn,.add{transition:transform 110ms ease-out,background-color 160ms ease,box-shadow 180ms ease,border-color 160ms ease,opacity 160ms ease}
button:active,.row:active,.template:active,.ical-event:active,.channel-btn:active,.icon-btn:active,.add:active{transform:scale(.975)}
.row{cursor:pointer;position:relative}.row:focus-visible,.template:focus-visible,.channel-btn:focus-visible,.icon-btn:focus-visible,.add:focus-visible,.back:focus-visible{outline:3px solid rgba(255,210,28,.55);outline-offset:2px}
.chat-head{position:relative;z-index:3;box-shadow:0 1px 0 rgba(11,25,48,.04)}
.thread{scroll-behavior:smooth;overscroll-behavior:contain}
.timeline-item{align-items:stretch}
.timeline-item>div{position:relative;display:block;box-sizing:border-box;width:min(86%,620px);max-width:min(86%,620px);min-width:0;height:auto;overflow:hidden;background:#fff;border:0!important;border-radius:18px;padding:15px 15px 12px 19px;box-shadow:0 1px 2px rgba(11,25,48,.04),0 5px 18px rgba(11,25,48,.035);overflow-wrap:anywhere;word-break:normal}
.timeline-item>div::before{content:"";position:absolute;z-index:1;left:0;top:0;bottom:0;width:5px;background:#c7cdd5;border-radius:18px 0 0 18px}
.timeline-item.origin-template>div::before{background:#f4c84a}.timeline-item.channel-email>div::before{background:#83bce8}.timeline-item.channel-whatsapp>div::before{background:#74c99a}
.timeline-item .meta{position:relative;z-index:2;margin-top:8px;line-height:1.2}
.compose{position:relative;z-index:4;box-shadow:0 -8px 24px rgba(11,25,48,.025)}
.compose textarea{font-size:16px;line-height:1.45;padding:5px 7px;border-radius:10px}
.channel-btn,.tplbtn{min-height:40px}.channel-btn{min-width:40px}.back{min-width:42px;min-height:42px;border-radius:50%;display:grid;place-items:center;line-height:1}
.modal{animation:xcomScrimIn 160ms ease-out}.sheet{transform-origin:50% 100%;animation:xcomSheetIn 260ms cubic-bezier(.2,.8,.2,1);box-shadow:0 -18px 60px rgba(6,20,37,.18)}
@keyframes xcomScrimIn{from{background:#06142500}to{background:#06142580}}@keyframes xcomSheetIn{from{transform:translateY(18px);opacity:.7}to{transform:translateY(0);opacity:1}}
@media(max-width:849px){.app-top{position:relative;z-index:5}.chat-head{min-height:64px}.timeline-item>div{width:min(94%,620px);max-width:min(94%,620px)}.thread{padding:14px 16px 24px}.compose{padding-left:16px;padding-right:16px}.chat-title h2{letter-spacing:-.01em}.chat-title small{line-height:1.3}}
@media(min-width:850px){.row:hover,.template:hover,.ical-event:hover{background:#fbfcfe}.channel-btn:hover,.icon-btn:hover{box-shadow:0 4px 14px rgba(11,25,48,.08)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.modal,.sheet{animation:none!important}}

/* v0.5.6 — timeline origin classes isolated from .template selector */
.timeline-item.origin-template,.timeline-item.channel-email,.timeline-item.channel-whatsapp{padding:0;border:0;background:transparent;border-radius:0;box-shadow:none;text-align:initial}

/* v0.5.7 — definitive timeline isolation + cache-busted assets */
.thread .timeline-item{display:flex!important;justify-content:flex-end!important;width:100%!important;margin:10px 0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;}
.thread .timeline-item>div{margin:0!important;background:#fff!important;}

/* v0.5.8 — mobile width containment: prevent header/timeline/composer horizontal clipping */
html,body,.xapp,.app-shell,.view,.chat{width:100%;max-width:100%;min-width:0;overflow-x:hidden}
.chat-head{width:100%;max-width:100%;min-width:0}
.chat-head .back,.chat-head .avatar{flex:0 0 auto}
.chat-title{flex:1 1 auto;min-width:0;overflow:hidden}
.chat-title h2,.chat-title small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.chat-head select{flex:0 1 132px;min-width:0;max-width:132px;width:auto}
.thread{width:100%;max-width:100%;min-width:0;overflow-x:hidden}
.thread .timeline-item{min-width:0;max-width:100%!important}
.thread .timeline-item>div{box-sizing:border-box;min-width:0;max-width:100%!important}
.timeline-item .meta{min-width:0;max-width:100%;flex-wrap:wrap}
.compose{width:100%;max-width:100%;min-width:0;overflow:hidden}
.compose-tools{min-width:0;max-width:100%}
.compose-tools .spacer{flex:1 1 auto;min-width:0}
@media(max-width:849px){
  .chat-head{gap:8px;padding-right:10px}
  .chat-head select{flex-basis:128px;max-width:128px;padding-left:9px;padding-right:5px}
  .thread .timeline-item>div{width:calc(100% - 34px)!important;max-width:calc(100% - 34px)!important}
  .compose-tools{gap:8px}
  .channel-btn{flex:0 0 44px;width:44px;max-width:44px}
}
@media(max-width:390px){
  .chat-head select{flex-basis:116px;max-width:116px;font-size:10px}
  .chat-head .avatar{width:36px;height:36px}
}

/* 0.6.0: reservation-first navigation */
.app-shell{grid-template-rows:auto minmax(0,1fr) auto}.view.is-reservas{display:block;overflow:auto}.reservations{max-width:840px;margin:auto;padding:22px 16px 30px}.reservation-header h2{margin:0;font-size:23px}.reservation-header p{color:#718097;font-size:12px;margin:5px 0 18px}.reservation-filters{display:flex;gap:8px;margin-bottom:16px}.reservation-filters button{border:0;border-radius:18px;padding:9px 14px;background:#e7ecf2;color:#34445a}.reservation-filters .on{background:#fff0aa;color:#192235}.reservation-list{display:grid;gap:12px}.reservation-card{display:block;width:100%;border:1px solid #e2e9f0;background:white;border-radius:18px;text-align:left;padding:17px;box-shadow:0 2px 9px #15253c08;color:#0b1930}.reservation-line,.reservation-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}.reservation-line b{font-size:15px;min-width:0;overflow:hidden;text-overflow:ellipsis}.reservation-platform{font-size:11px;background:#eef2f7;padding:6px 9px;border-radius:12px;white-space:nowrap}.reservation-dates{font-size:14px;margin:16px 0;color:#344760}.reservation-foot{border-top:1px solid #eef1f5;padding-top:11px;font-size:11px;color:#75859a}.reservation-foot span{font-weight:700;color:#14223b}.reservation-empty{padding:30px 18px;text-align:center;color:#728197;background:white;border-radius:16px}.bottom-nav{display:flex;justify-content:space-around;background:white;border-top:1px solid #e0e6ee;padding:8px 8px calc(8px + env(safe-area-inset-bottom));gap:6px}.bottom-nav button{border:0;background:transparent;flex:1;display:grid;justify-items:center;gap:2px;font-size:22px;color:#718197;padding:5px;border-radius:12px}.bottom-nav button span{font-size:11px}.bottom-nav button.on{background:#fff5ca;color:#0b1930}.view.is-inbox{min-height:0}@media(min-width:850px){.view.is-inbox{display:grid;grid-template-columns:360px minmax(0,1fr)}.bottom-nav{max-width:1100px;width:100%;margin:auto}}@media(max-width:849px){.view.is-inbox{position:relative}.view.is-inbox>.inbox,.view.is-inbox>.chat{position:absolute;inset:0}.app-shell.show-chat{grid-template-rows:auto minmax(0,1fr)}.app-shell.show-chat .bottom-nav{display:none}}
