@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
    --bg:#f4f7fb;
    --surface:#ffffff;
    --surface-2:#f8fafc;
    --text:#0f172a;
    --muted:#64748b;
    --border:#e2e8f0;
    --primary:#16a34a;
    --primary-dark:#15803d;
    --blue:#2563eb;
    --purple:#7c3aed;
    --danger:#dc2626;
    --warning:#ea580c;
    --shadow:0 10px 30px rgba(15,23,42,.07);
    --radius:18px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
    margin:0;
    min-height:100vh;
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    color:var(--text);
    background:
      radial-gradient(circle at 10% 0%,rgba(22,163,74,.08),transparent 28%),
      linear-gradient(135deg,#f8fafc,#eef2f7);
}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
.app-shell{min-height:100vh}
.topbar{
    position:sticky;top:0;z-index:100;
    display:flex;justify-content:space-between;align-items:center;
    padding:14px clamp(18px,4vw,52px);
    background:rgba(255,255,255,.9);
    backdrop-filter:blur(18px);
    border-bottom:1px solid rgba(226,232,240,.9);
}
.brand{display:flex;gap:12px;align-items:center}
.brand-mark{
    width:42px;height:42px;border-radius:13px;
    display:grid;place-items:center;
    background:linear-gradient(135deg,#22c55e,#166534);
    color:white;font-weight:800;font-size:21px;
    box-shadow:0 8px 20px rgba(22,163,74,.22);
}
.eyebrow{margin:0 0 4px;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.13em}
.brand h1{margin:0;font-size:18px;letter-spacing:-.03em}
.brand h1 span{color:var(--primary)}
.top-actions{display:flex;align-items:center;gap:14px}
.live-status{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px}
.live-status i{width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12)}
.btn{
    border:0;border-radius:11px;padding:11px 16px;font-weight:700;
    transition:.2s ease;display:inline-flex;align-items:center;gap:6px;
}
.btn:hover{transform:translateY(-1px)}
.btn-primary{color:#fff;background:linear-gradient(135deg,#16a34a,#15803d);box-shadow:0 7px 18px rgba(22,163,74,.2)}
.btn-secondary{color:#334155;background:#fff;border:1px solid var(--border)}
.main-content{width:min(1400px,calc(100% - 32px));margin:0 auto;padding:28px 0 70px}
.hero{
    display:flex;justify-content:space-between;align-items:center;gap:25px;
    padding:32px;border-radius:24px;color:white;
    background:
      radial-gradient(circle at 85% 20%,rgba(34,197,94,.28),transparent 25%),
      linear-gradient(135deg,#0f172a,#172554);
    box-shadow:0 20px 45px rgba(15,23,42,.14);
}
.hero .eyebrow{color:#94a3b8}
.hero h2{margin:0;font-size:clamp(25px,4vw,38px);letter-spacing:-.045em;max-width:700px}
.hero-copy{margin:10px 0 0;color:#cbd5e1;max-width:680px;line-height:1.6;font-size:14px}
.hero-badge{
    min-width:180px;padding:20px;border-radius:18px;
    background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);
    text-align:center;
}
.hero-badge span{display:block;font-size:10px;letter-spacing:.12em;color:#94a3b8;font-weight:800}
.hero-badge strong{display:block;margin-top:7px;font-size:34px;color:#86efac}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:18px 0}
.stat-card{
    display:flex;align-items:center;gap:14px;padding:18px;
    background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);
}
.stat-card span{display:block;color:var(--muted);font-size:11px;font-weight:600}
.stat-card strong{display:block;margin-top:3px;font-size:22px;letter-spacing:-.03em}
.stat-icon{
    width:42px;height:42px;border-radius:12px;display:grid;place-items:center;
    background:#f1f5f9;color:#334155;font-weight:800;font-size:18px;
}
.stat-icon.green{background:#dcfce7;color:#15803d}.stat-icon.blue{background:#dbeafe;color:#1d4ed8}.stat-icon.purple{background:#ede9fe;color:#6d28d9}
.form-panel,.location-panel{
    background:var(--surface);border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow);
    padding:22px;margin:18px 0;
}
.panel-heading,.section-title{display:flex;justify-content:space-between;align-items:center;gap:15px}
.panel-heading h3,.section-title h3{margin:0;font-size:18px}
.icon-btn{border:0;background:#f1f5f9;border-radius:10px;width:34px;height:34px;font-size:22px;color:#475569}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:20px}
.form-grid label{font-size:11px;font-weight:700;color:#475569}
.form-grid input,.form-grid textarea,.toolbar select{
    width:100%;margin-top:7px;border:1px solid var(--border);border-radius:11px;
    padding:11px 12px;background:#fff;color:var(--text);outline:none;transition:.2s;
}
.form-grid textarea{min-height:88px;resize:vertical}.form-grid input:focus,.form-grid textarea:focus,.toolbar select:focus{border-color:#86efac;box-shadow:0 0 0 3px rgba(34,197,94,.1)}
.form-grid .full{grid-column:1/-1}
.input-with-action{display:flex;gap:7px}.input-with-action input{flex:1}.mini-btn{margin-top:7px;border:1px solid #bbf7d0;background:#f0fdf4;color:#15803d;border-radius:10px;padding:0 12px;font-size:11px;font-weight:800}
.form-footer{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-top:18px}.form-hint{font-size:11px;color:var(--muted)}
.oculto{display:none!important}
.toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:24px 0 10px}
.search-box{
    flex:1;max-width:680px;display:flex;align-items:center;gap:9px;padding:0 12px;
    background:#fff;border:1px solid var(--border);border-radius:13px;box-shadow:var(--shadow);
}
.search-box>span{font-size:22px;color:#94a3b8}.search-box input{width:100%;border:0;outline:0;padding:13px 0;background:transparent;font-size:13px}
kbd{font-size:10px;color:#94a3b8;background:#f1f5f9;border:1px solid var(--border);padding:3px 6px;border-radius:5px;white-space:nowrap}
.toolbar-actions{display:flex;gap:8px}.toolbar select{margin:0;width:auto;min-width:135px;padding:10px}
.results-line{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;margin:12px 2px}
.inventory-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:16px}
.product-card{
    background:rgba(255,255,255,.92);border:1px solid var(--border);border-radius:18px;padding:18px;
    box-shadow:var(--shadow);transition:.2s ease;
}
.product-card:hover{transform:translateY(-3px);box-shadow:0 18px 40px rgba(15,23,42,.1)}
.card-top,.quantity-row,.card-actions{display:flex;justify-content:space-between;align-items:center;gap:8px}
.sku-pill,.stock-pill{font-size:10px;font-weight:800;padding:5px 8px;border-radius:7px}
.sku-pill{background:#f1f5f9;color:#475569}.stock-pill{background:#dcfce7;color:#15803d}
.stock-warning{color:#c2410c!important}.stock-danger{color:#dc2626!important}.stock-ok{color:#15803d!important}
.stock-pill.stock-warning{background:#ffedd5}.stock-pill.stock-danger{background:#fee2e2}
.product-location{margin-top:15px;font-size:11px;color:var(--muted)}.product-card h3{margin:8px 0 5px;font-size:18px;letter-spacing:-.025em}
.description{color:var(--muted);font-size:12px;line-height:1.55;min-height:38px;margin:0 0 15px}
.quantity-row{padding-top:13px;border-top:1px solid #eef2f7}.quantity-row span{display:block;color:var(--muted);font-size:10px}.quantity-row strong{font-size:25px}
.quick-actions{display:flex;gap:6px}.quick-actions button{border:1px solid var(--border);background:#fff;border-radius:9px;width:34px;height:32px;font-size:18px;color:#334155}
.images{display:flex;gap:8px;margin-top:13px}.images img{width:100px;height:100px;object-fit:cover;border-radius:9px;cursor:zoom-in;border:1px solid var(--border);transition:.2s}.images img:hover{transform:scale(1.05)}
.card-actions{margin-top:13px}.card-actions button{flex:1;border:1px solid var(--border);background:#f8fafc;color:#334155;border-radius:9px;padding:8px;font-size:10px;font-weight:700}.card-actions .danger-action{color:#b91c1c;background:#fff1f2;border-color:#fecdd3}
.empty-state{grid-column:1/-1;text-align:center;padding:65px 20px;background:#fff;border:1px dashed #cbd5e1;border-radius:18px;color:var(--muted)}
.empty-icon{font-size:38px;color:#94a3b8}.empty-state h3{margin:7px 0 4px;color:#334155}.empty-state p{margin:0;font-size:12px}
.legend{display:flex;gap:14px;color:var(--muted);font-size:10px}.legend span{display:flex;align-items:center;gap:5px}.dot{width:8px;height:8px;border-radius:50%}.dot.available{background:#cbd5e1}.dot.occupied{background:#22c55e}
.drawer-map-wrap{overflow-x:auto;margin-top:16px;padding-bottom:4px}.drawer-map{display:flex;gap:5px;min-width:max-content}
.drawer,.special-box{height:34px;border-radius:8px;display:grid;place-items:center;font-size:10px;font-weight:800}
.drawer{width:40px;border:1px solid #cbd5e1;background:#f8fafc;color:#64748b;transition:.15s}.drawer.occupied{background:#dcfce7;border-color:#22c55e;color:#166534}.drawer:hover{transform:translateY(-2px)}
.special-box{width:66px;border:1px solid #93c5fd;background:#eff6ff;color:#1d4ed8}
footer{display:flex;justify-content:space-between;padding:15px clamp(18px,4vw,52px);border-top:1px solid var(--border);background:#fff;color:#94a3b8;font-size:10px}
.modal{display:none;position:fixed;inset:0;z-index:500;background:rgba(2,6,23,.94);align-items:center;justify-content:center;overflow:hidden}
.modal img{max-width:82vw;max-height:82vh;border-radius:14px;transition:transform .2s ease;cursor:zoom-in}.modal img.zoomed{cursor:zoom-out}
.modal-close,.modal-nav{position:absolute;border:0;background:rgba(255,255,255,.1);color:#fff;z-index:2;border-radius:50%;width:42px;height:42px;font-size:28px}.modal-close{top:22px;right:22px}.modal-nav{top:50%;transform:translateY(-50%);font-size:38px}.modal-nav.prev{left:22px}.modal-nav.next{right:22px}
.toast{position:fixed;right:20px;bottom:20px;z-index:700;transform:translateY(25px);opacity:0;pointer-events:none;background:#0f172a;color:#fff;border-radius:11px;padding:12px 15px;font-size:12px;box-shadow:0 15px 35px rgba(15,23,42,.25);transition:.25s}.toast.show{opacity:1;transform:translateY(0)}.toast.success{border-left:4px solid #22c55e}.toast.error{border-left:4px solid #ef4444}
@media(max-width:1000px){.stats-grid{grid-template-columns:repeat(2,1fr)}.toolbar{flex-direction:column;align-items:stretch}.search-box{max-width:none}.toolbar-actions{overflow:auto}.toolbar select{flex:1}}
@media(max-width:700px){.topbar{padding:12px 16px}.live-status{display:none}.main-content{width:min(100% - 20px,1400px);padding-top:15px}.hero{padding:23px;flex-direction:column;align-items:flex-start}.hero-badge{width:100%}.stats-grid{grid-template-columns:1fr 1fr}.stat-card{padding:13px}.stat-card strong{font-size:18px}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.form-footer{align-items:stretch;flex-direction:column}.toolbar-actions{display:grid;grid-template-columns:1fr 1fr}.toolbar-actions .btn{justify-content:center}.toolbar select{width:100%;min-width:0}.results-line{font-size:10px}footer{gap:10px;flex-direction:column;text-align:center}.brand h1{font-size:16px}}
@media(max-width:440px){.stats-grid{grid-template-columns:1fr}.hero h2{font-size:25px}.top-actions .btn{padding:9px 11px;font-size:11px}.brand-mark{width:36px;height:36px}.toolbar-actions{grid-template-columns:1fr}.card-actions{flex-direction:column}.card-actions button{width:100%}}
/* =========================
   CONTROL DE MOVIMIENTOS
========================= */
.movement-panel{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:20px;
    box-shadow:var(--shadow);
    padding:22px;
    margin:18px 0;
}
.movement-help{margin:8px 0 18px;color:var(--muted);font-size:12px;line-height:1.55}
.movement-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.movement-card{
    display:flex;flex-direction:column;gap:10px;
    padding:18px;border:1px solid var(--border);border-radius:16px;background:var(--surface-2)
}
.movement-card .movement-icon{font-size:24px}
.movement-card h4{margin:0;font-size:15px}
.movement-card p{margin:4px 0 5px;color:var(--muted);font-size:11px;line-height:1.45}
.movement-card label{font-size:10px;font-weight:700;color:#475569}
.movement-card input{
    width:100%;margin-top:6px;border:1px solid var(--border);border-radius:10px;
    padding:10px;background:#fff;color:var(--text);outline:none
}
.movement-card input:focus,.history-heading input:focus{border-color:#86efac;box-shadow:0 0 0 3px rgba(34,197,94,.1)}
.movement-card .btn{margin-top:auto;justify-content:center}
.two-inputs{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.history-box{margin-top:18px;border-top:1px solid var(--border);padding-top:18px}
.history-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:12px}
.history-heading h4{margin:0;font-size:15px}.history-heading span{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.history-heading input{width:190px;border:1px solid var(--border);border-radius:10px;padding:9px 10px;outline:none}
.history-list{display:flex;flex-direction:column;gap:7px;max-height:430px;overflow:auto}
.history-item{display:grid;grid-template-columns:105px 1fr auto;gap:12px;align-items:center;padding:11px 13px;background:#fff;border:1px solid var(--border);border-radius:11px}
.history-type{font-size:9px;font-weight:900;letter-spacing:.08em}
.history-in .history-type{color:#15803d}.history-out .history-type{color:#dc2626}.history-return .history-type{color:#2563eb}
.history-main strong{display:block;font-size:11px}.history-main span,.history-main small{display:block;color:var(--muted);font-size:9px;margin-top:3px}
.history-qty{font-size:16px;font-weight:900}.history-in .history-qty{color:#15803d}.history-out .history-qty{color:#dc2626}.history-return .history-qty{color:#2563eb}
.history-manual-in .history-type{color:#7c3aed}.history-manual-in .history-qty{color:#7c3aed}
.history-manual-out .history-type{color:#be123c}.history-manual-out .history-qty{color:#be123c}
.btn-danger-history{background:#fff1f2!important;color:#b91c1c!important;border:1px solid #fecdd3!important}.btn-danger-history:hover{background:#ffe4e6!important;border-color:#fda4af!important;transform:translateY(-1px)}
.history-missing{grid-column:2/-1;color:#c2410c;font-size:10px;font-weight:800}
.history-empty{padding:25px;text-align:center;color:var(--muted);font-size:11px;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:11px}
@media(max-width:1000px){.movement-grid{grid-template-columns:1fr}.history-item{grid-template-columns:90px 1fr auto}}
@media(max-width:700px){.history-heading{align-items:stretch;flex-direction:column}.history-heading input{width:100%}.history-item{grid-template-columns:1fr auto}.history-type{grid-column:1/-1}.history-main{min-width:0}.history-missing{grid-column:1/-1}}

/* ==================================================
   MOVIMIENTOS EN BARRA SUPERIOR / DESPLEGABLES
================================================== */
.top-actions{gap:8px;flex-wrap:wrap}
.btn-movement{
    background:#fff;
    color:#334155;
    border:1px solid var(--border);
    box-shadow:0 2px 8px rgba(15,23,42,.04);
}
.btn-movement:hover{background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px)}
.btn-movement.active{
    background:#ecfdf5;
    color:#15803d;
    border-color:#86efac;
}
.movement-panel{position:relative;overflow:hidden;transition:all .25s ease}
.movement-section-header{align-items:center}
.movement-content{display:none!important}
.movement-content.movement-active{display:flex!important;animation:movementOpen .22s ease}
.history-box.movement-active{display:block!important}
@keyframes movementOpen{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.movement-card{width:100%;box-sizing:border-box;background:#fff}
.movement-card-head{display:flex;align-items:center;gap:12px;margin-bottom:4px}
.movement-card-head .movement-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;font-size:22px;font-weight:900;background:#ecfdf5;color:#15803d;flex:0 0 auto}
.movement-out .movement-card-head .movement-icon{background:#eff6ff;color:#2563eb}
.movement-return .movement-card-head .movement-icon{background:#fff7ed;color:#ea580c}
.movement-form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:10px}
.movement-form-grid-out{grid-template-columns:repeat(4,1fr)}
.movement-form-grid-return{grid-template-columns:repeat(4,1fr)}
.movement-form-grid label{min-width:0}
.movement-form-grid .movement-full{grid-column:1/-1}
.movement-form-actions{display:flex;justify-content:flex-end;margin-top:14px}
.history-tools{display:flex;align-items:center;gap:8px}
.history-tools input{width:190px}
@media(max-width:1250px){
    .top-actions .live-status{display:none}
    .top-actions{justify-content:flex-end}
    .movement-nav-btn{padding:9px 11px;font-size:11px}
}
@media(max-width:900px){
    .top-actions{width:100%;justify-content:flex-end}
    .movement-nav-btn{flex:1}
    .movement-form-grid,.movement-form-grid-out,.movement-form-grid-return{grid-template-columns:1fr 1fr}
}
@media(max-width:600px){
    .top-actions{display:grid;grid-template-columns:1fr 1fr}
    .top-actions .btn-movement,.top-actions .btn-primary{width:100%;justify-content:center}
    .movement-form-grid,.movement-form-grid-out,.movement-form-grid-return{grid-template-columns:1fr}
    .movement-form-grid .movement-full{grid-column:auto}
    .history-tools{flex-direction:column;align-items:stretch}
    .history-tools input{width:100%}
    .history-tools .btn{justify-content:center}
}

/* Botón para imprimir comprobantes de salida */
.history-print-btn{
    border:1px solid #cbd5e1;
    background:#f8fafc;
    color:#334155;
    border-radius:8px;
    padding:7px 10px;
    font-size:10px;
    font-weight:800;
    cursor:pointer;
    margin-left:auto;
}
.history-print-btn:hover{
    background:#eef2f7;
}

/* ==================================================
   SALIDA MULTIPRODUCTO
================================================== */
.salida-general-grid{display:grid;grid-template-columns:1fr 2fr;gap:12px;margin-top:10px}
.salida-items-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:18px;padding:12px 0;border-top:1px solid var(--border)}
.salida-items-head strong{display:block;font-size:13px}.salida-items-head span{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.salida-items{display:flex;flex-direction:column;gap:10px}.salida-add-bottom{align-self:flex-start;margin-top:10px}
.salida-item-row{display:grid;grid-template-columns:minmax(300px,1fr) 120px 100px 38px;gap:10px;align-items:end;padding:12px;border:1px solid var(--border);border-radius:12px;background:#f8fafc;position:relative}
.salida-product-search{position:relative;min-width:0}.salida-producto-input{width:100%}.salida-selected-info{font-size:9px;color:#15803d;margin-top:5px;min-height:12px}.salida-stock{font-size:10px;color:var(--muted);padding-bottom:11px}.salida-stock b{color:#172033;font-size:13px}
.salida-suggestions{display:none;position:absolute;z-index:30;left:0;right:0;top:100%;margin-top:4px;background:#fff;border:1px solid #cbd5e1;border-radius:10px;box-shadow:0 12px 25px rgba(15,23,42,.12);max-height:260px;overflow:auto;padding:4px}.salida-suggestions.visible{display:block}
.salida-suggestion{display:flex;width:100%;justify-content:space-between;gap:10px;text-align:left;padding:9px 10px;border:0;background:#fff;border-radius:7px;cursor:pointer;font-size:10px;color:#172033}.salida-suggestion:hover{background:#f1f5f9}.salida-suggestion small{color:#64748b;white-space:nowrap}.salida-no-results{padding:10px;color:#64748b;font-size:10px}
.salida-remove{height:38px;border:1px solid #fecaca;background:#fff1f2;color:#b91c1c;border-radius:9px;font-weight:900;cursor:pointer}.salida-remove:hover{background:#ffe4e6}.salida-total-box{display:flex;justify-content:flex-end;gap:25px;margin-top:12px;padding:10px 12px;border-radius:10px;background:#f1f5f9;color:#475569;font-size:11px}.salida-total-box b{color:#172033;font-size:14px}
@media(max-width:900px){.salida-general-grid{grid-template-columns:1fr}.salida-item-row{grid-template-columns:1fr 110px 90px 38px}}
@media(max-width:600px){.salida-items-head{align-items:stretch;flex-direction:column}.salida-item-row{grid-template-columns:1fr 1fr}.salida-product-search{grid-column:1/-1}.salida-stock{padding-bottom:0;align-self:center}.salida-remove{align-self:end}.salida-total-box{justify-content:space-between;gap:10px}}
/* Entrada y devolución multiproducto */
.movement-general-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:10px}.movement-items-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:18px;padding:12px 0;border-top:1px solid var(--border)}.movement-items-head strong{display:block;font-size:13px}.movement-items-head span{display:block;color:var(--muted);font-size:10px;margin-top:3px}.movement-items{display:flex;flex-direction:column;gap:10px}.movement-item-row{display:grid;grid-template-columns:minmax(280px,1fr) 120px 120px 110px 38px;gap:10px;align-items:end;padding:12px;border:1px solid var(--border);border-radius:14px;background:linear-gradient(135deg,#f8fafc,#fff)}.entrada-item-row{border-left:4px solid #22c55e}.devolucion-item-row{border-left:4px solid #f97316}.producto-search{position:relative;min-width:0}.producto-busqueda-input{width:100%}.producto-selected-info{font-size:10px;color:#15803d;margin-top:5px;min-height:14px}.producto-cajon,.producto-stock{font-size:10px;color:#64748b;padding-bottom:11px}.producto-cajon b,.producto-stock b{color:#172033;font-size:13px}.producto-suggestions{display:none;position:absolute;z-index:40;left:0;right:0;top:100%;margin-top:4px;background:#fff;border:1px solid #cbd5e1;border-radius:10px;box-shadow:0 12px 25px rgba(15,23,42,.12);max-height:260px;overflow:auto;padding:4px}.producto-suggestions.visible{display:block}.producto-suggestion{display:flex;width:100%;justify-content:space-between;gap:10px;text-align:left;padding:9px 10px;border:0;background:#fff;border-radius:7px;cursor:pointer;font-size:10px;color:#172033}.producto-suggestion:hover{background:#f1f5f9}.producto-suggestion small{color:#64748b;white-space:nowrap}.movement-total-box{display:flex;justify-content:flex-end;gap:25px;margin-top:12px;padding:10px 12px;border-radius:10px;background:#f1f5f9;color:#475569;font-size:11px}.movement-total-box b{color:#172033;font-size:14px}
.top-actions .btn-movement:nth-of-type(1){border-color:#86efac;background:#f0fdf4;color:#15803d}.top-actions .btn-movement:nth-of-type(2){border-color:#bfdbfe;background:#eff6ff;color:#2563eb}.top-actions .btn-movement:nth-of-type(3){border-color:#fed7aa;background:#fff7ed;color:#ea580c}.top-actions .btn-movement:hover{filter:brightness(.98);box-shadow:0 5px 15px rgba(15,23,42,.08)}
@media(max-width:900px){.movement-general-grid{grid-template-columns:1fr}.movement-item-row{grid-template-columns:1fr 1fr 100px 38px}.movement-item-row .producto-search{grid-column:1/-1}.devolucion-item-row{grid-template-columns:1fr 1fr 100px 38px}}@media(max-width:600px){.movement-items-head{flex-direction:column;align-items:stretch}.movement-item-row{grid-template-columns:1fr 1fr}.movement-item-row .producto-search{grid-column:1/-1}.movement-total-box{justify-content:space-between;gap:10px}}

/* =========================
   REDISEÑO VISUAL PREMIUM v3
========================= */
:root{--primary:#10b981;--primary-dark:#047857;--blue:#3b82f6;--purple:#8b5cf6;--radius:22px;--shadow:0 14px 38px rgba(15,23,42,.09)}
body{background:radial-gradient(circle at 0% 0%,rgba(16,185,129,.13),transparent 30%),radial-gradient(circle at 100% 10%,rgba(59,130,246,.10),transparent 28%),#f6f8fc}
.topbar{margin:0 auto;padding:15px clamp(20px,4vw,64px);box-shadow:0 4px 20px rgba(15,23,42,.04)}
.brand-mark{background:linear-gradient(135deg,#10b981,#047857 60%,#064e3b);border:2px solid rgba(255,255,255,.45);position:relative;overflow:hidden}
.brand-mark:after{content:'';position:absolute;width:28px;height:28px;border-radius:50%;background:rgba(255,255,255,.14);top:-13px;right:-10px}
.top-actions .btn{border-radius:14px;font-size:12px;padding:10px 14px}
.movement-nav-btn{background:rgba(255,255,255,.72);backdrop-filter:blur(8px)}
.movement-nav-btn:nth-of-type(2){border-color:#bbf7d0;color:#047857}.movement-nav-btn:nth-of-type(3){border-color:#bfdbfe;color:#1d4ed8}.movement-nav-btn:nth-of-type(4){border-color:#fed7aa;color:#c2410c}
.btn{box-shadow:0 5px 14px rgba(15,23,42,.06)}.btn-primary{background:linear-gradient(135deg,#10b981,#059669);border:1px solid rgba(255,255,255,.25)}
.main-content{padding-top:34px}.hero{border:1px solid rgba(255,255,255,.16);position:relative;overflow:hidden;background:linear-gradient(125deg,#0b132b,#172554 55%,#064e3b)}
.hero:after{content:'';position:absolute;width:360px;height:360px;border:55px solid rgba(16,185,129,.08);border-radius:50%;right:-130px;bottom:-230px}
.hero>*{position:relative;z-index:1}.hero-badge{box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 15px 35px rgba(0,0,0,.12)}
.stats-grid{gap:18px}.stat-card{border-radius:20px;padding:20px;position:relative;overflow:hidden}.stat-card:before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:#cbd5e1}.stat-card:nth-child(1):before{background:#10b981}.stat-card:nth-child(2):before{background:#3b82f6}.stat-card:nth-child(3):before{background:#8b5cf6}.stat-card:nth-child(4):before{background:#f59e0b}.stat-icon{border-radius:15px}
.form-panel,.location-panel,.movement-panel{border-radius:24px;border-color:rgba(226,232,240,.9);box-shadow:0 16px 45px rgba(15,23,42,.07)}
.form-panel:hover,.location-panel:hover,.movement-panel:hover{box-shadow:0 20px 50px rgba(15,23,42,.09)}
.search-box{border-radius:16px;padding-left:16px;box-shadow:0 10px 28px rgba(15,23,42,.06)}
.product-card{border-radius:22px;padding:20px;background:linear-gradient(145deg,#fff,#fbfdff);box-shadow:0 10px 28px rgba(15,23,42,.065)}
.product-card:hover{transform:translateY(-6px);box-shadow:0 22px 42px rgba(15,23,42,.12);border-color:#bbf7d0}.sku-pill{border-radius:999px;padding:6px 10px}.stock-pill{border-radius:999px;padding:6px 10px}.product-card h3{font-size:19px}.images img{border-radius:14px}
.movement-card{border-radius:20px;padding:21px;background:linear-gradient(145deg,#fff,#f8fafc);transition:.25s}.movement-card:hover{transform:translateY(-4px);box-shadow:0 16px 35px rgba(15,23,42,.08)}
.movement-card-head .movement-icon{border-radius:15px;box-shadow:0 8px 18px rgba(15,23,42,.08)}
.movement-in{border-top:4px solid #10b981}.movement-out{border-top:4px solid #3b82f6}.movement-return{border-top:4px solid #f97316}
.movement-card input,.form-grid input,.form-grid textarea,.toolbar select{border-radius:13px;background:#fbfdff}.movement-card input:focus,.form-grid input:focus,.form-grid textarea:focus{background:#fff}
.history-item{border-radius:15px;padding:14px 16px;transition:.2s}.history-item:hover{background:#f8fafc;transform:translateX(3px);border-color:#cbd5e1}
.drawer{border-radius:10px}.drawer.occupied{box-shadow:0 5px 12px rgba(34,197,94,.13)}
footer{background:transparent;border:0;padding-top:25px;padding-bottom:25px}
@media(max-width:900px){.topbar{align-items:flex-start;flex-direction:column}.top-actions{width:100%;display:grid;grid-template-columns:repeat(2,1fr)}.top-actions .btn{justify-content:center}.top-actions .live-status{display:none}}
@media(max-width:560px){.hero{border-radius:20px}.top-actions{grid-template-columns:1fr 1fr}.stats-grid{gap:12px}.stat-card{border-radius:16px}.movement-card{padding:16px}}

/* =========================
   AUTENTICACIÓN Y PERFIL
========================= */
.auth-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}
.login-card,.profile-card{
    width:min(100%,460px);
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:24px;
    box-shadow:0 20px 60px rgba(15,23,42,.12);
    padding:32px;
}
.login-brand{margin-bottom:28px}
.login-card h2,.profile-card h2{margin:0 0 8px;font-size:28px}
.login-copy{color:var(--muted);margin:0 0 24px;line-height:1.6}
.login-card form,.profile-card form{display:grid;gap:16px}
.login-card label,.profile-card label{display:grid;gap:8px;font-weight:600}
.login-card input,.profile-card input{
    width:100%;padding:13px 14px;border:1px solid var(--border);border-radius:12px;
    outline:none;background:#fff;color:var(--text);
}
.login-card input:focus,.profile-card input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(22,163,74,.12)}
.login-submit{width:100%;justify-content:center;padding:14px}
.login-error,.login-success{padding:12px 14px;border-radius:12px;margin-bottom:18px;font-weight:600}
.login-error{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca}
.login-success{background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0}
.profile-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
.back-link{color:var(--muted);text-decoration:none;font-weight:600}
.back-link:hover{color:var(--text)}
.btn-profile,.btn-logout{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.btn-profile{background:#eef2ff;color:#3730a3}
.btn-logout{background:#fef2f2;color:#b91c1c}
@media(max-width:900px){
    .top-actions{flex-wrap:wrap}
}

/* Historial: una tarjeta por salida completa */
.history-grouped-item{align-items:center}
.history-grouped-item .history-main small{display:block;line-height:1.5;margin-top:5px}
.history-grouped-item .history-print-btn{white-space:nowrap}
.history-print-btn:disabled{opacity:.55;cursor:wait}
@media (max-width:700px){.history-grouped-item{align-items:flex-start;flex-direction:column}.history-grouped-item .history-print-btn{margin-left:0;width:100%}}
