*{margin:0;padding:0;box-sizing:border-box;}
/* Tema claro con acentos de marca Xiaomi (rojo/naranja en gradiente). */
:root{--bg:#f3f4f7;--surface:#ffffff;--surface-2:#f1f2f6;--surface-3:#e8e9ee;--border:#e4e5eb;--text:#17171c;--text-muted:#7a7a86;--red:#ff3b30;--yellow:#e0a300;--green:#1f9d52;--blue:#007aff;--orange:#ff9500;--purple:#af52de;--teal:#0a9dc4;--gradient:linear-gradient(135deg,#ff3b30,#ff6b35);}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#e7e8ec;color:var(--text);min-height:100vh;overflow-x:hidden;display:flex;justify-content:center;align-items:flex-start;}
.phone-frame{width:100%;max-width:460px;min-height:100vh;background:var(--bg);position:relative;box-shadow:0 10px 50px rgba(20,20,30,0.12);}
@media(min-width:520px){.phone-frame{border-radius:24px;margin:20px 0;min-height:calc(100vh - 40px);}}
.screen{display:flex;flex-direction:column;min-height:100vh;}
.login{justify-content:center;align-items:center;padding:20px;min-height:100vh;}
.login-box{background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:40px 30px;width:100%;max-width:400px;text-align:center;}
.login-title{font-size:26px;font-weight:800;margin-bottom:8px;display:flex;align-items:center;justify-content:center;gap:10px;}
.login-title .brand-logo{width:34px;height:34px;flex-shrink:0;}
.login-title .brand-text{background:var(--gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;}
.login-sub{color:var(--text-muted);font-size:14px;margin-bottom:30px;}
.form-group{margin-bottom:16px;text-align:left;}
.form-group label{display:block;font-size:12px;font-weight:600;color:var(--text-muted);margin-bottom:6px;text-transform:uppercase;letter-spacing:0.5px;}
.input-wrapper{position:relative;display:flex;align-items:center;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:0 14px;transition:border-color .2s;}
.input-wrapper:focus-within{border-color:var(--red);}
.input-wrapper .icon{font-size:18px;margin-right:10px;}
.input-wrapper input{flex:1;background:none;border:none;color:var(--text);font-size:16px;padding:14px 0;outline:none;width:100%;}
.input-wrapper input::placeholder{color:var(--text-muted);}
.btn{width:100%;padding:14px;border:none;border-radius:12px;font-size:15px;font-weight:700;cursor:pointer;margin-top:8px;transition:transform .1s;}
.btn:active{transform:scale(0.98);}
.btn:disabled{opacity:.5;cursor:not-allowed;}
.btn-primary{background:var(--gradient);color:#fff;}
.btn-secondary{background:var(--surface-2);color:var(--text);border:1px solid var(--border);}
.error-msg{color:var(--red);font-size:13px;margin-top:10px;min-height:16px;}
.hint{color:var(--text-muted);font-size:12px;margin-top:14px;line-height:1.5;}
.dash{flex-direction:column;}
.header{padding:20px;padding-top:16px;position:relative;}
.greeting{font-size:22px;font-weight:800;}
.subtitle{font-size:13px;color:var(--text-muted);margin-top:4px;}
.logout-btn{position:absolute;right:20px;top:18px;background:var(--surface-2);border:1px solid var(--border);color:var(--text-muted);font-size:12px;padding:6px 12px;border-radius:8px;cursor:pointer;}
.tabs{display:flex;gap:6px;padding:0 20px 16px;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.tabs::-webkit-scrollbar{display:none;}
.tab{flex-shrink:0;padding:8px 14px;border-radius:10px;font-size:12px;font-weight:600;cursor:pointer;background:var(--surface-2);color:var(--text-muted);border:1px solid var(--border);transition:all .2s;}
.tab.active{background:var(--gradient);color:#fff;border-color:transparent;}
.content{flex:1;padding:0 20px 100px;overflow-y:auto;}
.card{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:16px;margin-bottom:14px;}
.card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;}
.card-title{font-size:14px;font-weight:700;}
.card-badge{font-size:11px;font-weight:700;padding:3px 10px;border-radius:20px;background:rgba(0,122,255,0.15);color:var(--blue);}
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px;}
.stat-box{background:var(--surface-2);border-radius:12px;padding:12px;text-align:center;}
.stat-value{font-size:24px;font-weight:800;color:var(--text);}
.stat-label{font-size:10px;color:var(--text-muted);margin-top:2px;text-transform:uppercase;letter-spacing:0.3px;}
.list-item{display:flex;align-items:center;padding:10px 0;border-bottom:1px solid var(--border);gap:10px;}
.list-item:last-child{border-bottom:none;}
.list-icon{width:32px;height:32px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;background:rgba(0,122,255,0.15);}
.list-info{flex:1;min-width:0;}
.list-info .name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.list-info .detail{font-size:11px;color:var(--text-muted);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.list-value{font-size:13px;font-weight:700;flex-shrink:0;text-align:right;color:var(--text-muted);}
.muted{color:var(--text-muted);}
.empty-state{text-align:center;padding:30px 10px;color:var(--text-muted);font-size:13px;}
.footer{text-align:center;padding:20px;color:var(--text-muted);font-size:11px;}
.toast{position:fixed;top:20px;left:50%;transform:translateX(-50%) translateY(-100px);background:var(--surface-2);border:1px solid var(--border);color:var(--text);padding:12px 24px;border-radius:12px;font-size:13px;font-weight:600;z-index:9999;transition:transform .3s ease;pointer-events:none;max-width:90%;text-align:center;}
.toast.show{transform:translateX(-50%) translateY(0);}
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.7);display:none;align-items:center;justify-content:center;z-index:999;padding:20px;}
.modal-overlay.show{display:flex;}
.modal{background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:30px;width:100%;max-width:360px;}
.modal h3{font-size:18px;margin-bottom:12px;}
.modal p{font-size:13px;color:var(--text-muted);margin-bottom:20px;}
.spinner{display:inline-block;width:16px;height:16px;border:2px solid rgba(23,23,28,.15);border-top-color:var(--red);border-radius:50%;animation:spin .7s linear infinite;vertical-align:middle;}
@keyframes spin{to{transform:rotate(360deg);}}
.admin-upload{border:1px dashed var(--border);border-radius:14px;padding:14px;margin-bottom:14px;}
.admin-upload label{display:block;font-size:12px;font-weight:700;margin-bottom:8px;}
.admin-upload input[type=file]{width:100%;font-size:12px;color:var(--text-muted);margin-bottom:10px;}
.progress-track{height:8px;background:var(--surface-3);border-radius:6px;overflow:hidden;margin-top:8px;}
.progress-fill{height:100%;background:var(--gradient);width:0%;transition:width .2s;}
.progress-text{font-size:11px;color:var(--text-muted);margin-top:6px;}
table.data-table{width:100%;border-collapse:collapse;font-size:12px;}
table.data-table th{text-align:left;color:var(--text-muted);font-weight:600;padding:6px 4px;border-bottom:1px solid var(--border);white-space:nowrap;}
table.data-table td{padding:6px 4px;border-bottom:1px solid var(--border);white-space:nowrap;}
.table-scroll{overflow-x:auto;}
.card-badge.badge-red{background:rgba(255,59,48,0.15);color:var(--red);}
.card-badge.badge-yellow{background:rgba(255,214,10,0.15);color:var(--yellow);}
.card-badge.badge-green{background:rgba(52,199,89,0.15);color:var(--green);}
.card-badge.badge-orange{background:rgba(255,149,0,0.15);color:var(--orange);}
.card-badge.badge-blue{background:rgba(0,122,255,0.15);color:var(--blue);}
.list-icon.orange{background:rgba(255,149,0,0.15);}
.list-icon.green{background:rgba(52,199,89,0.15);}
.list-icon.blue{background:rgba(0,122,255,0.15);}
.list-icon.red{background:rgba(255,59,48,0.15);}
.stat-value.green{color:var(--green);}
.stat-value.blue{color:var(--blue);}
.stat-value.orange{color:var(--orange);}
.stat-value.red{color:var(--red);}
.bar-row{display:flex;align-items:center;gap:8px;margin-bottom:8px;}
.bar-label{flex:0 0 38%;font-size:11px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.bar-track{flex:1;height:18px;background:var(--surface-2);border-radius:6px;overflow:hidden;position:relative;}
.bar-fill{height:100%;border-radius:6px;display:flex;align-items:center;justify-content:flex-end;padding-right:6px;min-width:22px;transition:width .3s;}
.bar-fill span{font-size:10px;font-weight:700;color:#fff;}
.bar-fill.orange{background:linear-gradient(90deg,var(--orange),#ffb340);}
.bar-fill.green{background:linear-gradient(90deg,var(--green),#5fe08a);}

/* ===== Bot flotante (specs / precios) ===== */
.bot-toggle{position:fixed;bottom:100px;right:20px;width:54px;height:54px;border-radius:50%;background:var(--gradient);display:flex;align-items:center;justify-content:center;font-size:24px;box-shadow:0 6px 20px rgba(255,59,48,0.45);cursor:pointer;z-index:500;transition:transform .15s;}
.bot-toggle:active{transform:scale(0.92);}
.bot-panel{position:fixed;bottom:164px;right:20px;left:20px;max-width:340px;margin-left:auto;max-height:60vh;background:var(--surface);border:1px solid var(--border);border-radius:18px;display:none;flex-direction:column;overflow:hidden;box-shadow:0 10px 40px rgba(0,0,0,0.55);z-index:501;}
@media(min-width:520px){
  .bot-toggle{right:calc(50vw - 210px);}
  .bot-panel{right:calc(50vw - 210px);left:calc(50vw - 210px);}
}
.bot-panel.show{display:flex;}
.bot-panel-header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;background:var(--gradient);color:#fff;font-weight:700;font-size:14px;flex-shrink:0;}
.bot-close{background:rgba(255,255,255,0.25);border:none;color:#fff;width:24px;height:24px;border-radius:50%;cursor:pointer;font-size:12px;line-height:1;}
.bot-messages{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;min-height:160px;}
.bot-msg{max-width:88%;padding:10px 12px;border-radius:14px;font-size:12px;line-height:1.6;white-space:pre-line;word-break:break-word;}
.bot-msg.bot{align-self:flex-start;background:var(--surface-2);border:1px solid var(--border);border-bottom-left-radius:4px;}
.bot-msg.user{align-self:flex-end;background:var(--gradient);color:#fff;border-bottom-right-radius:4px;}
.bot-input-row{display:flex;gap:8px;padding:12px;border-top:1px solid var(--border);flex-shrink:0;}
.bot-input-row input{flex:1;background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:10px 12px;color:var(--text);font-size:13px;outline:none;min-width:0;}
