:root{
  --bg:#070b14;
  --surface:#0d1422;
  --surface-2:#111a2c;
  --surface-3:#151f34;
  --line:#24324b;
  --line-strong:#304261;
  --text:#f5f7fb;
  --muted:#93a4bf;
  --accent:#7657f0;
  --accent-2:#8a6df7;
  --accent-soft:rgba(118,87,240,.14);
  --success:#2bc48a;
  --danger:#e15a75;
  --warning:#f0b84b;
  --shadow:0 18px 45px rgba(0,0,0,.24);
  --radius:18px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;background:radial-gradient(circle at 10% -10%,rgba(118,87,240,.10),transparent 34%),var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;line-height:1.5}
a{color:inherit}
button,input,select,textarea{font:inherit}
button{cursor:pointer}

.top{position:sticky;top:0;z-index:30;background:rgba(7,11,20,.88);backdrop-filter:blur(18px);border-bottom:1px solid rgba(48,66,97,.65);padding:11px clamp(14px,3vw,28px);display:flex;align-items:center;justify-content:space-between;gap:14px}
.brand{font-weight:850;font-size:20px;letter-spacing:-.45px;display:flex;align-items:center;gap:8px;white-space:nowrap;min-width:0}
.nav{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.nav-balance{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:7px 10px;border:1px solid var(--line);border-radius:12px;background:#101a2b;color:var(--text);font-size:13px;font-weight:750}
.nav-balance small{color:var(--muted);font-size:11px;font-weight:650}
.nav a,.btn{display:inline-flex;align-items:center;justify-content:center;min-height:40px;background:rgba(21,31,52,.88);color:var(--text);border:1px solid var(--line-strong);border-radius:12px;padding:8px 13px;text-decoration:none;cursor:pointer;font-weight:750;font-size:14px;transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease;box-shadow:0 1px 0 rgba(255,255,255,.025) inset}
.nav a:hover,.btn:hover{transform:translateY(-1px);border-color:#455a80;background:#1a2740;box-shadow:0 8px 20px rgba(0,0,0,.12)}
.nav a:focus-visible,.btn:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent-2);outline-offset:2px}
.btn.primary{background:linear-gradient(135deg,var(--accent),var(--accent-2));border-color:#866df2;box-shadow:0 7px 18px rgba(118,87,240,.20)}
.btn.primary:hover{background:linear-gradient(135deg,#8062f5,#987ff9);box-shadow:0 10px 22px rgba(118,87,240,.24)}
.btn.danger{background:rgba(170,48,73,.20);border-color:#713348;color:#ffdbe2}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none}

.wrap{width:min(1180px,calc(100% - 30px));margin:24px auto;padding-bottom:28px}
h1{font-size:31px;line-height:1.1;letter-spacing:-.95px;margin:0 0 16px}
h2{font-size:20px;line-height:1.2;letter-spacing:-.3px;margin:0 0 10px}
h3{font-size:16px;margin:0 0 7px}
.muted{color:var(--muted)}
.small{font-size:12px;color:#a9b7cb}

.card{background:linear-gradient(180deg,rgba(17,26,44,.98),rgba(13,20,34,.98));border:1px solid rgba(36,50,75,.95);border-radius:15px;padding:16px;box-shadow:0 9px 24px rgba(0,0,0,.09)}
.card:hover{border-color:#2d4061}
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
.stat{min-height:108px;display:flex;flex-direction:column;justify-content:space-between}
.stat .money{margin-top:6px}
.money{font-size:28px;font-weight:850;letter-spacing:-.65px;color:#fff}
.stats-grid .stat:first-child .money{color:#fff}

.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(225px,1fr));gap:12px}
.two{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,.95fr);gap:14px;align-items:start}
.product{position:relative;overflow:hidden;min-height:250px;display:flex;flex-direction:column;gap:8px;padding:15px}
.product::after{content:"";position:absolute;inset:auto -34px -64px auto;width:130px;height:130px;background:radial-gradient(circle,rgba(118,87,240,.14),transparent 68%);pointer-events:none}
.product img{width:100%;height:140px;object-fit:cover;border-radius:12px;background:#09111f;border:1px solid #263653}
.product h2{margin-top:1px;font-size:19px}
.product .money{font-size:26px;margin-top:auto}
.product .small{color:#91a3bd}

.form{display:grid;gap:10px}
.form input,.form select,.form textarea,
input:not([type="hidden"]),select,textarea{width:100%;background:#0a1220;color:var(--text);border:1px solid #2b3d5c;border-radius:11px;padding:11px 12px;font-size:15px;min-height:42px;transition:.16s ease}
input::placeholder,textarea::placeholder{color:#71839f}
input:hover,select:hover,textarea:hover{border-color:#405675}
input:focus,select:focus,textarea:focus{border-color:#7657f0;box-shadow:0 0 0 3px rgba(118,87,240,.12);outline:none}
textarea{min-height:96px;resize:vertical}
select{appearance:auto}

.shop-tools{padding:12px;margin-top:14px}
.search-form{display:grid;grid-template-columns:minmax(0,1fr) 175px auto auto;gap:8px;align-items:center}
.search-box{min-height:44px;display:flex;align-items:center;gap:9px;background:#0a1220;border:1px solid #2b3d5c;border-radius:11px;padding:0 12px;transition:.16s ease}
.search-box:focus-within{border-color:#7657f0;box-shadow:0 0 0 3px rgba(118,87,240,.12)}
.search-box input{min-height:40px;border:0!important;background:transparent!important;box-shadow:none!important;outline:0!important;padding:7px 0!important}
.search-box span{font-size:16px;opacity:.8}
.empty-state{grid-column:1/-1;text-align:center;padding:34px 20px;border-style:dashed;background:rgba(13,20,34,.65)}
.empty-icon{font-size:32px;margin-bottom:7px}

.actions{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.qty-input{width:78px!important;min-width:68px!important;min-height:40px!important;padding:8px 9px!important}
.pill{display:inline-flex;align-items:center;justify-content:center;padding:5px 9px;border-radius:999px;background:#1b2d4a;color:#d5deed;font-size:11px;font-weight:750}

.cart-list{display:grid;gap:8px}
.cart-row{border:1px solid #263754;border-radius:12px;padding:11px;background:rgba(8,14,25,.34);display:flex;justify-content:space-between;gap:10px;align-items:center}
.cart-row strong{font-size:14px}
.cart-row .actions{align-items:center}
hr{border:0;border-top:1px solid #25334c;margin:15px 0}

.request-card{margin-top:14px;border-color:#30446a;background:linear-gradient(180deg,#121c30,#10192a);padding:18px}
.request-card h2{display:flex;align-items:center;gap:7px;font-size:20px}
.request-card p{max-width:760px;margin:0;color:#a9b7cb}
.request-form{margin-top:14px}
.row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.request-row{display:flex;gap:8px;align-items:center}
.request-input{flex:1;min-width:0;min-height:44px!important;background:#0a1220!important;border:1px solid #30415f!important;color:#fff!important;border-radius:11px!important;padding:11px 12px!important;font-size:15px!important}
.request-input::placeholder{color:#71839f}
.request-row .btn{min-width:105px}

.msg{padding:11px 13px;border-radius:11px;background:#13253d;border:1px solid #2c4a70;margin-bottom:13px}
.error{background:#3b1720;border-color:#7b3042;color:#ffdce3}
.success{background:#123225;border-color:#2e6a4c;color:#d8ffed}
.notice{padding:11px;border:1px solid var(--line);border-radius:11px;background:#121c30;margin:8px 0}
.ok{color:#4ade80}.dangerText{color:#f87171}

.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}
.table{width:100%;border-collapse:collapse;min-width:700px;background:#0e1727}
.table th,.table td{padding:10px 11px;border-bottom:1px solid #25334c;text-align:left;vertical-align:top}
.table th{color:#aebbd0;font-size:11px;text-transform:uppercase;letter-spacing:.05em;background:#111c2f}
.table tr:last-child td{border-bottom:0}

.login{max-width:460px;margin:48px auto}
.footer{text-align:center;color:#71839c;padding:34px 18px}
.split{display:grid;grid-template-columns:1.5fr .8fr;gap:14px}
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.tabs button.active{outline:2px solid #9b8aff}
.dashGrid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.right{margin-left:auto}
details summary{display:inline-block;list-style:none;cursor:pointer}details summary::-webkit-details-marker{display:none}
label{color:#c9d4e7;font-size:13px}
input[type=checkbox]{width:18px!important;height:18px;min-height:18px;vertical-align:middle;margin-right:7px;padding:0}
.table td details{min-width:300px}

.modal{position:fixed;inset:0;background:rgba(0,0,0,.72);backdrop-filter:blur(5px);display:grid;place-items:center;padding:18px;z-index:50}
.modal>div{width:min(620px,100%);max-height:90vh;overflow:auto}
.hidden{display:none!important}

@media(max-width:980px){
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .two{grid-template-columns:1fr}
  .search-form{grid-template-columns:minmax(0,1fr) 165px auto}
  .search-form .btn:last-child{grid-column:auto}
}
@media(max-width:900px){
  .top{flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
  .brand{min-width:0;flex:1}
  .wrap{width:min(100% - 22px,1180px);margin:20px auto}
  h1{font-size:28px}
}
@media(max-width:620px){
  .stats-grid{grid-template-columns:1fr}
  .card{padding:14px}
  .brand{font-size:18px}
  .search-form{grid-template-columns:1fr}
  .search-box,.search-form select,.search-form .btn{width:100%}
  .cart-row{flex-direction:column;align-items:stretch}
  .cart-row .actions form{display:flex;gap:7px;flex:1}
  .cart-row .actions .btn{flex:1}
  .request-row{flex-direction:column;align-items:stretch}
  .request-row .btn{width:100%}
}


/* CHAT LIVE */
.chat-nav-active{color:#fff!important;background:linear-gradient(135deg,#7657f0,#5c3ee5)!important;border-color:#8f7cff!important}
.chat-page{max-width:1180px}
.chat-shell{padding:0;overflow:hidden}
.chat-head{padding:20px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap}
.chat-messages{height:430px;overflow-y:auto;padding:20px;background:radial-gradient(circle at top right,rgba(118,87,240,.08),transparent 40%),#09111f}
.chat-row{display:flex;margin:0 0 12px}
.chat-row.mine{justify-content:flex-end}
.chat-bubble{max-width:min(78%,680px);padding:11px 13px;border:1px solid #2b3d5c;border-radius:15px;background:#111c2f;box-shadow:0 6px 18px rgba(0,0,0,.12)}
.chat-row.mine .chat-bubble{background:linear-gradient(135deg,#5f45d7,#7657f0);border-color:#8b78f3}
.chat-author{font-size:11px;font-weight:800;opacity:.82;margin-bottom:4px}
.chat-text{font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.chat-time{font-size:10px;opacity:.65;text-align:right;margin-top:5px}
.chat-typing{height:28px;padding:6px 20px;color:#9eacbf;font-size:12px;font-style:italic;background:#0d1727}
.chat-compose{border-top:1px solid var(--line);padding:14px;background:#101a2b}
.chat-compose textarea{min-height:72px!important;margin:0}
.chat-compose-bottom{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:9px}
.chat-admin-grid{display:grid;grid-template-columns:330px minmax(0,1fr);gap:16px;align-items:stretch}
.chat-inbox{padding:0;overflow:hidden}
.conversation-list{max-height:600px;overflow-y:auto;padding:8px}
.conversation-item{display:block;width:100%;text-align:left;color:var(--text);background:transparent;border:1px solid transparent;border-radius:12px;padding:12px;margin-bottom:6px;cursor:pointer;font:inherit}
.conversation-item:hover,.conversation-item.selected{background:#16233a;border-color:#334b72}
.conversation-top{display:flex;justify-content:space-between;gap:8px;align-items:center}
.conversation-preview{margin-top:6px;font-size:13px;color:#9aa9bf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.unread{min-width:22px;height:22px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:#7657f0;color:#fff;font-size:11px;font-weight:800}
.admin-chat-panel{padding:0;overflow:hidden}
.chat-empty{height:100%;min-height:550px;display:grid;place-items:center;align-content:center;text-align:center;padding:35px;color:#cdd7e6}
.chat-empty>div:first-child{font-size:46px;margin-bottom:6px}
.small-empty{min-height:280px}
.hidden{display:none!important}
@media(max-width:900px){.chat-admin-grid{grid-template-columns:1fr}.conversation-list{max-height:330px}.chat-bubble{max-width:88%}}

/* CHAT LIVE v3: composer siempre visible y acciones de mensaje */
.chat-admin-grid{min-height:720px}
.admin-chat-panel{display:flex;min-height:720px}
#adminChat{display:flex;flex-direction:column;min-height:720px;width:100%}
#adminMessages{flex:1;min-height:360px;height:auto}
.chat-shell:has(#chatMessages){display:flex;flex-direction:column}
.chat-shell:has(#chatMessages) #chatMessages{height:calc(100vh - 390px);min-height:360px;max-height:560px}
.chat-compose{position:relative;z-index:2}
.chat-bubble{position:relative;padding-right:42px}
.chat-delete{position:absolute;right:9px;top:9px;width:27px;height:27px;border:1px solid rgba(255,255,255,.15);border-radius:8px;background:rgba(6,12,24,.35);color:#d7deeb;cursor:pointer;opacity:.72;display:flex;align-items:center;justify-content:center;font-size:13px;padding:0}
.chat-delete:hover{opacity:1;background:#4a1f2b;border-color:#8b4a5b;color:#fff}
.chat-row.mine .chat-delete{background:rgba(20,10,60,.28)}
.chat-row.mine .chat-delete:hover{background:#3b245e;border-color:#b09bff}
@media(max-width:900px){.chat-admin-grid,.admin-chat-panel,#adminChat{min-height:620px}.chat-shell:has(#chatMessages) #chatMessages{height:420px;min-height:300px}}

/* CHAT LIVE MODERNO FINAL */
.chat-page{max-width:1180px;margin-top:28px}
.chat-shell,.chat-inbox,.admin-chat-panel{border:1px solid #263957!important;background:linear-gradient(180deg,#0e192b 0%,#091321 100%)!important;box-shadow:0 18px 50px rgba(0,0,0,.22)}
.chat-admin-grid{display:grid;grid-template-columns:330px minmax(0,1fr);gap:14px;min-height:760px;align-items:stretch}
.chat-inbox{min-height:760px}
.chat-head{padding:17px 18px!important;background:rgba(10,18,32,.72);border-bottom:1px solid #263957!important}
.chat-head h1,.chat-head h2{letter-spacing:-.02em}
.chat-messages{background:radial-gradient(circle at 80% 0%,rgba(118,87,240,.10),transparent 34%),#08111f!important;scroll-behavior:smooth}
#adminChat{height:100%;min-height:760px;display:flex;flex-direction:column}
#adminMessages{flex:1;min-height:420px;height:auto!important;max-height:none!important}
#chatMessages{height:520px!important;min-height:420px;max-height:none!important}
.chat-compose{background:rgba(13,24,40,.96)!important;padding:14px 16px!important;border-top:1px solid #263957!important}
.chat-compose textarea{min-height:58px!important;max-height:160px;resize:vertical;background:#08111f!important;border-color:#304565!important;padding:12px 14px!important}
.chat-compose textarea:focus{border-color:#7657f0!important;box-shadow:0 0 0 3px rgba(118,87,240,.14)!important}
.chat-compose-bottom{min-height:38px}
.chat-compose .btn{min-height:42px;padding:10px 16px}
.conversation-list{padding:10px!important;max-height:690px}
.conversation-item{padding:13px!important;border:1px solid transparent!important;background:transparent!important}
.conversation-item:hover{background:#111e33!important;border-color:#2d4162!important}
.conversation-item.selected{background:linear-gradient(135deg,rgba(118,87,240,.18),rgba(49,68,105,.22))!important;border-color:#6957c8!important;box-shadow:inset 3px 0 0 #7657f0}
.conversation-preview{color:#9aabc3!important}
.chat-row{align-items:flex-end;gap:8px;margin-bottom:14px}
.chat-bubble{max-width:min(72%,680px);padding:11px 40px 10px 13px!important;border-radius:16px!important;background:#122139!important;border-color:#304667!important}
.chat-row.mine .chat-bubble{background:linear-gradient(135deg,#5c43d5,#7657f0)!important;border-color:#8e7cf2!important}
.chat-text{font-size:15px;line-height:1.55}
.chat-author{font-size:11px;color:#b7c5da}
.chat-time{font-size:10px;color:#aab8cc}
.chat-delete{width:28px!important;height:28px!important;border-radius:9px!important;opacity:.72!important}
.chat-delete:hover{opacity:1!important}
.chat-typing{background:#0c1727!important;min-height:28px}
.chat-empty{min-height:760px!important;background:radial-gradient(circle at center,rgba(118,87,240,.07),transparent 45%)}
.chat-empty>div:first-child{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;margin:0 auto 14px;background:#15243b;border:1px solid #304565;font-size:28px}
#adminChatHead{flex:0 0 auto}
#adminTyping{flex:0 0 28px}
.chat-nav-active{box-shadow:0 6px 20px rgba(118,87,240,.24)}
@media(max-width:900px){
  .chat-admin-grid{grid-template-columns:1fr;min-height:0}
  .chat-inbox{min-height:0}
  .conversation-list{max-height:300px}
  #adminChat{min-height:650px;height:650px}
  .chat-empty{min-height:520px!important}
  #adminMessages{min-height:330px}
}
@media(max-width:620px){
  .chat-page{margin-top:16px}
  .chat-bubble{max-width:88%}
  #chatMessages{height:calc(100vh - 350px)!important;min-height:360px}
  #adminChat{height:600px;min-height:600px}
  .chat-compose-bottom{align-items:stretch;flex-direction:column}
  .chat-compose-bottom .actions{width:100%}
  .chat-compose-bottom .actions .btn{flex:1}
}

/* Bloqueo visual al intentar imprimir la web. La selección y Ctrl+C siguen permitidos. */
@media print{
  html,body{display:none!important}
}

/* SEGURIDAD WEB — selección y copia permitidas; clic izquierdo permitido. */
html, body, input, textarea, select, button { user-select: text; -webkit-user-select: text; }
button, a { user-select: text; -webkit-user-select: text; }
@media print { html, body { visibility:hidden !important; } }

/* VISITANTES EN VIVO */
.live-panel{grid-column:1/-1;min-height:126px;display:flex;align-items:center;justify-content:space-between;gap:18px;background:linear-gradient(135deg,#12223a,#0f1a2c);border-color:#31517b}
.live-count{font-size:42px;line-height:1;font-weight:900;letter-spacing:-1px;margin:7px 0 4px;color:#fff}
.live-meta{display:flex;align-items:flex-end;gap:22px;text-align:right}
.live-meta>div{display:flex;flex-direction:column;gap:2px}
.live-meta strong{font-size:24px;line-height:1;font-weight:850;color:#fff}
.live-meta span{font-size:12px;color:#93a4bf}
@media(max-width:720px){.live-panel{align-items:flex-start;flex-direction:column}.live-meta{width:100%;justify-content:space-between;text-align:left}.live-meta>div:last-child{text-align:right}}


/* MOBILE MENU GLOBAL — menú compacto para tabletas y celulares */
.mobile-menu-toggle{
  display:none;
  min-height:42px;
  padding:8px 13px;
  border:1px solid #3b547a;
  border-radius:12px;
  background:linear-gradient(180deg,#172742,#122038);
  color:var(--text);
  font-weight:850;
  font-size:14px;
  white-space:nowrap;
  box-shadow:0 6px 18px rgba(0,0,0,.16);
}
.mobile-menu-toggle:hover{border-color:#5a76a5;background:#1b2b47}
.mobile-menu-toggle:focus-visible{outline:2px solid var(--accent-2);outline-offset:2px}

@media(max-width:900px){
  .mobile-menu-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto}
  .top .nav{display:none!important;width:100%!important;flex:0 0 100%!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;margin-top:1px;padding:4px 0 1px}
  .top .nav.mobile-open{display:grid!important}
  .top .nav a{width:100%!important;min-width:0!important;min-height:42px!important}
  .top .nav .nav-balance{grid-column:1/-1;width:100%;text-align:center;padding:9px 10px;border:1px solid var(--line);border-radius:11px;background:#101a2b;color:var(--text)}
}
@media(max-width:620px){
  .top .nav.mobile-open{grid-template-columns:1fr!important}
  .top .nav .nav-balance{grid-column:auto}
  .mobile-menu-toggle{padding:8px 11px}
}
