﻿*{box-sizing:border-box}html,body,form{margin:0;min-height:100%;font-family:Inter,"Segoe UI",Arial,sans-serif;color:#172033}body{background:#f4f7fb}
:root{--nav:#0d2c55;--nav2:#123d73;--blue:#1559a6;--line:#e3e9f2;--muted:#6d7889;--white:#fff}
.login-body{background:white}.login-screen{min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr}.login-brand{background:linear-gradient(145deg,#082c59,#125a9f);color:white;display:flex;align-items:center;padding:8vw}.login-copy{max-width:620px}.brand-mark{font-size:31px;font-weight:800;letter-spacing:-1px}.login-copy h1{font-size:48px;line-height:1.05;margin:24px 0 18px;letter-spacing:-1.5px}.login-copy p{font-size:17px;line-height:1.75;color:#d8e8fa}.login-points{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:30px}.login-points div{background:#ffffff10;border:1px solid #ffffff24;border-radius:10px;padding:14px}.login-form-wrap{display:flex;align-items:center;justify-content:center;padding:50px}.login-card{width:100%;max-width:430px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.5px;color:#1c67b6}.login-card h2,.page-head h1{font-size:30px;margin:8px 0}.login-card p,.page-head p,.card-head p{color:var(--muted);margin:0 0 26px}.field{margin:17px 0}.field label{display:block;font-size:13px;font-weight:700;margin-bottom:7px}.input{width:100%;padding:13px 14px;border:1px solid #cfd8e6;border-radius:8px;font:inherit;outline:none}.input:focus{border-color:#2b70b8;box-shadow:0 0 0 3px #2b70b815}.btn-login{width:100%;border:0;border-radius:8px;background:#1559a6;color:#fff;font-weight:750;padding:14px;margin-top:12px;cursor:pointer}.login-message{display:block;background:#fff2f2;color:#a32929;padding:12px;border-radius:8px;margin:14px 0}.login-foot{text-align:center;color:#8993a2;font-size:12px;margin-top:24px}
.topbar{height:62px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px;position:fixed;left:0;right:0;top:0;z-index:20}.topbar-brand{display:flex;align-items:center;gap:13px}.topbar-brand b{font-size:24px;color:#0d4f94}.topbar-brand span{font-size:12px;color:#7b8798}.topbar-user{display:flex;align-items:center;gap:12px;font-size:13px}.user-dot{width:8px;height:8px;border-radius:50%;background:#38a169}.logout{color:#a22929;text-decoration:none;font-weight:700}.mobile-btn{display:none}.layout{display:flex;padding-top:62px;min-height:100vh}.sidebar{position:fixed;top:62px;bottom:0;left:0;width:248px;background:#0c2f58;color:white;padding:16px 10px;overflow:auto}.content{margin-left:248px;width:calc(100% - 248px);padding:28px}
.nav-direct,.nav-head{width:100%;border:0;background:none;color:#e9f2fc;text-decoration:none;display:flex;align-items:center;justify-content:space-between;padding:12px 13px;border-radius:8px;font:inherit;font-weight:650;cursor:pointer;text-align:left}.nav-direct{justify-content:flex-start;gap:10px}.nav-direct:hover,.nav-head:hover,.nav-group.open>.nav-head{background:#ffffff12}.nav-head b{font-size:20px;transition:.2s}.nav-group.open>.nav-head b{transform:rotate(90deg)}.nav-sub{display:none;padding:2px 0 7px 13px}.nav-group.open .nav-sub{display:block}.nav-sub a{display:block;color:#bcd0e7;text-decoration:none;padding:8px 12px;border-left:1px solid #31557c;font-size:12.5px}.nav-sub a:hover{color:white;background:#ffffff0a}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:22px}.period-pill,.badge{background:#e9f2fc;color:#1559a6;border-radius:999px;padding:7px 11px;font-size:11px;font-weight:800}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.kpi,.card{background:white;border:1px solid var(--line);border-radius:12px;box-shadow:0 4px 18px #17203308}.kpi{padding:20px}.kpi span{font-size:12px;color:#6c7787;font-weight:700}.kpi strong{display:block;font-size:26px;margin:10px 0 7px}.kpi small{color:#5e6b7d}.dashboard-grid{display:grid;grid-template-columns:1.5fr 1fr;gap:16px;margin-top:16px}.card{padding:20px}.card-head{display:flex;justify-content:space-between}.card-head h3{margin:0 0 5px}.fake-chart{height:210px;display:flex;gap:16px;align-items:end;border-bottom:1px solid #dfe6ef;padding:18px}.fake-chart span{flex:1;background:linear-gradient(#2f78c6,#0f4d8f);border-radius:6px 6px 0 0}.alert-row{display:flex;gap:15px;padding:14px 0;border-bottom:1px solid #edf0f5}.alert-row b{width:28px;height:28px;background:#edf5ff;color:#14569f;border-radius:7px;display:grid;place-items:center}.progress-line{display:flex;justify-content:space-between;margin:13px 0 6px;font-size:12px}.progress{height:8px;background:#edf1f6;border-radius:8px;overflow:hidden}.progress i{height:100%;display:block;background:#1d65b2}.activity{padding-left:18px;margin:0}.activity li{padding:10px 0;border-bottom:1px solid #edf0f5}.activity b{color:#185a9e;margin-right:5px}.grid{width:100%;border-collapse:collapse}.grid th{background:#f3f6fa;color:#536073;text-align:left;font-size:12px;padding:12px;border-bottom:1px solid var(--line)}.grid td{padding:12px;border-bottom:1px solid #edf0f5;font-size:13px}
@media(max-width:1000px){.kpis{grid-template-columns:1fr 1fr}.dashboard-grid{grid-template-columns:1fr}.topbar-brand span{display:none}}@media(max-width:760px){.login-screen{grid-template-columns:1fr}.login-brand{display:none}.login-form-wrap{min-height:100vh;padding:26px}.mobile-btn{display:inline-block}.sidebar{transform:translateX(-100%);transition:.2s;z-index:30}.menu-open .sidebar{transform:translateX(0)}.content{margin-left:0;width:100%;padding:18px}.topbar-user>span:first-child{display:none}.kpis{grid-template-columns:1fr}.page-head{display:block}}


/* ===== iERP Login V1.0.3 - diseño demo compacto ===== */
.login-demo-body{
    margin:0;
    width:100%;
    height:100vh;
    min-height:100vh;
    overflow:hidden;
    background:#f4f6fb;
    font-family:"Segoe UI",Arial,sans-serif;
    color:#1a2035;
}
.login-demo-body form{
    margin:0;
    width:100%;
    height:100vh;
}
.login-demo-shell{
    width:100%;
    height:100vh;
    display:grid;
    grid-template-columns:1fr 1fr;
    overflow:hidden;
}
.login-demo-hero{
    position:relative;
    overflow:hidden;
    padding:clamp(22px,3.4vh,42px) clamp(28px,4vw,52px);
    background:#3b64dc;
    color:#fff;
    display:flex;
    flex-direction:column;
}
.login-demo-grid{
    position:absolute;
    inset:0;
    background-image:
        linear-gradient(rgba(255,255,255,.06) 1px,transparent 1px),
        linear-gradient(90deg,rgba(255,255,255,.06) 1px,transparent 1px);
    background-size:60px 60px;
    pointer-events:none;
}
.login-demo-hero>*{position:relative;z-index:1}
.login-demo-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:48px;
}
.login-demo-brand{
    font:600 18px Consolas,monospace;
    letter-spacing:3px;
}
.login-demo-brand b{
    display:inline-block;
    width:8px;
    height:8px;
    border-radius:50%;
    background:#fff;
    margin-right:10px;
}
.login-demo-logo{
    width:clamp(92px,9vw,132px);
    max-height:58px;
    object-fit:contain;
    display:block;
}
.login-demo-main{
    margin-top:clamp(20px,3vh,34px);
}
.login-demo-main h1{
    font-size:clamp(36px,4vw,54px);
    line-height:1.04;
    margin:0 0 15px;
    letter-spacing:-1px;
}
.login-demo-main h1 span{
    font-weight:300;
    opacity:.65;
}
.login-demo-lead{
    max-width:540px;
    color:rgba(255,255,255,.76);
    line-height:1.55;
    font-size:clamp(14px,1.2vw,18px);
}
.login-demo-tags{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-top:clamp(18px,2.5vh,26px);
}
.login-demo-tags span{
    font:11px Consolas,monospace;
    letter-spacing:1px;
    border:1px solid rgba(255,255,255,.28);
    padding:6px 9px;
}
.login-demo-stats{
    margin-top:auto;
    display:flex;
    gap:clamp(18px,3vw,36px);
    border-top:1px solid rgba(255,255,255,.18);
    padding-top:clamp(16px,2.3vh,24px);
}
.login-demo-stats div{min-width:0}
.login-demo-stats strong{
    display:block;
    font:600 clamp(17px,1.8vw,22px) Consolas,monospace;
}
.login-demo-stats small{
    opacity:.62;
    font-size:clamp(11px,1vw,13px);
}
.login-demo-access{
    min-width:0;
    height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:clamp(18px,4vh,40px);
    background:#f4f6fb;
    overflow:hidden;
}
.login-demo-card{
    width:100%;
    max-width:410px;
}
.login-demo-eyebrow{
    font:11px Consolas,monospace;
    letter-spacing:3px;
    color:#3b64dc;
    text-transform:uppercase;
}
.login-demo-card h2{
    font-size:clamp(25px,2.4vw,29px);
    margin:9px 0 5px;
}
.login-demo-sub{
    color:#6b7a9a;
    font-size:14px;
    margin-bottom:clamp(20px,3vh,30px);
}
.login-demo-msg{
    display:block;
    margin-bottom:12px;
    padding:9px 11px;
    font-size:12px;
    border-left:3px solid #dc2626;
    background:#fee2e2;
    color:#b91c1c;
}
.login-demo-field{
    margin-bottom:clamp(12px,1.8vh,16px);
}
.login-demo-field label{
    display:block;
    font:10px Consolas,monospace;
    letter-spacing:2px;
    color:#6b7a9a;
    text-transform:uppercase;
    margin-bottom:6px;
}
.login-demo-wrap{position:relative}
.login-demo-input{
    width:100%;
    height:44px;
    border:1px solid rgba(59,100,220,.22);
    background:#fff;
    padding:0 42px 0 14px;
    font-size:14px;
    outline:none;
    border-radius:0;
    font-family:"Segoe UI",Arial,sans-serif;
}
.login-demo-input:focus{
    border-color:#3b64dc;
    box-shadow:0 0 0 3px rgba(59,100,220,.1);
}
.login-demo-eye{
    position:absolute;
    right:8px;
    top:7px;
    width:30px;
    height:30px;
    border:0;
    background:transparent;
    color:#56647e;
    cursor:pointer;
    font-size:16px;
}
.login-demo-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    font-size:12.5px;
    color:#6b7a9a;
    margin:4px 0 clamp(16px,2.4vh,22px);
}
.login-demo-row label{white-space:nowrap}
.login-demo-row a{
    color:#3b64dc;
    text-decoration:none;
    white-space:nowrap;
}
.login-demo-btn{
    width:100%;
    height:46px;
    border:0;
    background:#3b64dc;
    color:#fff;
    font:600 12px Consolas,monospace;
    letter-spacing:2px;
    cursor:pointer;
}
.login-demo-btn:hover{background:#2a4dbf}
.login-demo-footer{
    display:flex;
    justify-content:space-between;
    gap:15px;
    border-top:1px solid rgba(59,100,220,.14);
    padding-top:16px;
    margin-top:22px;
    color:#6b7a9a;
    font:10px Consolas,monospace;
}

/* Resoluciones de escritorio bajas: compactar para evitar scroll */
@media (max-height:760px) and (min-width:821px){
    .login-demo-hero{padding-top:20px;padding-bottom:20px}
    .login-demo-logo{width:92px;max-height:42px}
    .login-demo-main{margin-top:14px}
    .login-demo-main h1{font-size:38px;margin-bottom:10px}
    .login-demo-lead{font-size:14px;line-height:1.45}
    .login-demo-tags{margin-top:14px}
    .login-demo-tags span{padding:5px 8px;font-size:10px}
    .login-demo-stats{padding-top:14px}
    .login-demo-stats strong{font-size:17px}
    .login-demo-stats small{font-size:10px}
    .login-demo-access{padding:18px 30px}
    .login-demo-sub{margin-bottom:16px}
    .login-demo-field{margin-bottom:10px}
    .login-demo-input{height:40px}
    .login-demo-row{margin-bottom:14px}
    .login-demo-btn{height:42px}
    .login-demo-footer{margin-top:16px;padding-top:12px}
}

/* Móvil: se permite desplazamiento porque una sola columna requiere más altura */
@media(max-width:820px){
    .login-demo-body,
    .login-demo-body form{
        height:auto;
        min-height:100vh;
        overflow:auto;
    }
    .login-demo-shell{
        height:auto;
        min-height:100vh;
        grid-template-columns:1fr;
        overflow:visible;
    }
    .login-demo-hero{
        min-height:290px;
        padding:26px 28px;
    }
    .login-demo-logo{width:92px}
    .login-demo-main{margin-top:18px}
    .login-demo-main h1{font-size:34px}
    .login-demo-stats{display:none}
    .login-demo-access{
        height:auto;
        min-height:520px;
        padding:32px 22px;
        overflow:visible;
    }
}


/* ===== iERP V1.0.6 - formularios / toast / modal / processing ===== */
.page-actions{display:flex;gap:10px;align-items:center}
.btn-primary,.btn-secondary,.btn-danger,.btn-icon{border:0;cursor:pointer;font-family:inherit}
.btn-primary{background:#3b64dc;color:#fff;padding:11px 18px;font-weight:600}
.btn-secondary{background:#eef2ff;color:#334155;padding:10px 16px}
.btn-danger{background:#dc2626;color:#fff;padding:10px 16px}
.btn-icon{background:transparent;color:#3b64dc;padding:5px 8px}
.form-card{background:#fff;border:1px solid #e6eaf2;padding:22px;margin-bottom:18px}
.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-field label{display:block;font-size:11px;font-weight:600;letter-spacing:.7px;text-transform:uppercase;color:#6b7a9a;margin-bottom:6px}
.form-field input[type=text],.form-field input[type=password],.form-field input[type=number],.form-field select,.form-field textarea{width:100%;min-height:42px;border:1px solid #d9e0ee;padding:9px 11px;background:#fff;font:14px "Segoe UI",Arial,sans-serif;outline:none}
.form-field textarea{min-height:80px;resize:vertical}
.form-field input:focus,.form-field select:focus,.form-field textarea:focus{border-color:#3b64dc;box-shadow:0 0 0 3px rgba(59,100,220,.09)}
.form-check{display:flex;align-items:center;gap:8px;min-height:42px}
.form-actions{display:flex;gap:10px;margin-top:18px}
.section-title{font-size:13px;text-transform:uppercase;letter-spacing:1px;color:#3b64dc;border-bottom:1px solid #e9edf5;padding-bottom:8px;margin:22px 0 14px}
.catalog-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:14px}
.catalog-search{max-width:340px;width:100%;height:40px;border:1px solid #d9e0ee;padding:0 12px}
.grid-actions{white-space:nowrap}
.grid tbody tr:hover{background:#f8faff}
.empty-state{padding:30px;color:#6b7a9a;text-align:center}

.toast-host{position:fixed;right:22px;top:76px;z-index:3000;display:flex;flex-direction:column;gap:10px;pointer-events:none}
.toast{min-width:280px;max-width:390px;background:#fff;border:1px solid #e3e8f2;box-shadow:0 14px 35px rgba(15,23,42,.16);padding:13px 15px;display:flex;gap:11px;align-items:flex-start;opacity:0;transform:translateY(-8px);transition:.22s}
.toast.show{opacity:1;transform:translateY(0)}
.toast b{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:12px;flex:0 0 auto}
.toast-success b{background:#dcfce7;color:#15803d}.toast-error b{background:#fee2e2;color:#b91c1c}.toast-info b{background:#dbeafe;color:#1d4ed8}
.toast span{font-size:13px;line-height:1.45;color:#334155}

.processing-overlay,.modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.42);backdrop-filter:blur(2px);display:none;align-items:center;justify-content:center;z-index:4000}
.processing-overlay.show,.modal-overlay.show{display:flex}
.processing-box{background:#fff;min-width:250px;padding:27px;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.22)}
.processing-box strong,.processing-box span{display:block}.processing-box strong{margin-top:13px;font-size:16px}.processing-box span{margin-top:5px;color:#6b7a9a;font-size:12px}
.spinner{width:34px;height:34px;border:3px solid #e4e9f4;border-top-color:#3b64dc;border-radius:50%;margin:auto;animation:ierpSpin .8s linear infinite}
@keyframes ierpSpin{to{transform:rotate(360deg)}}
.confirm-box{background:#fff;max-width:390px;width:calc(100% - 34px);padding:28px;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.24)}
.confirm-icon{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;margin:0 auto 13px;background:#fee2e2;color:#b91c1c;font-weight:700}
.confirm-box h3{margin:0 0 8px}.confirm-box p{color:#64748b;margin:0 0 22px}.confirm-actions{display:flex;justify-content:center;gap:10px}
.badge{display:inline-block;padding:4px 8px;background:#eef2ff;color:#3b64dc;font-size:11px}
.accounting-note{background:#f8fafc;border-left:3px solid #3b64dc;padding:12px 14px;font-size:12px;color:#475569;line-height:1.5}

@media(max-width:980px){.form-grid,.form-grid.two{grid-template-columns:1fr 1fr}}
@media(max-width:650px){.form-grid,.form-grid.two{grid-template-columns:1fr}.catalog-toolbar{align-items:stretch;flex-direction:column}.toast-host{left:14px;right:14px}.toast{min-width:0;max-width:none}}

/* V1.0.7 */
.form-card .section-title:first-child{margin-top:0}
.grid{width:100%;border-collapse:collapse}
.grid th{background:#f7f9fd;color:#526079;font-size:11px;text-transform:uppercase;letter-spacing:.5px;text-align:left;padding:11px 10px;border-bottom:1px solid #e4e9f2}
.grid td{padding:10px;border-bottom:1px solid #edf1f6;font-size:13px;vertical-align:middle}
.form-field select{appearance:auto}


/* ==========================================================
   iERP V1.0.9 - Modales, búsqueda y campos obligatorios
   ========================================================== */
.ierp-page-actions{display:flex;gap:10px;align-items:center}
.ierp-searchbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.ierp-searchbar input{min-width:280px;max-width:460px;width:100%;padding:10px 12px;border:1px solid #d8dee9;border-radius:8px;background:#fff}
.ierp-searchbar input:focus{outline:none;border-color:#2f6fed;box-shadow:0 0 0 3px rgba(47,111,237,.10)}
.required-mark{color:#c62828;font-weight:700;margin-left:3px}
.required-input{border-color:#e3a3a3!important;background:#fffafa!important}
.required-input:focus{border-color:#c62828!important;box-shadow:0 0 0 3px rgba(198,40,40,.10)!important}
.ierp-modal{display:none;position:fixed;inset:0;z-index:2100;background:rgba(15,23,42,.50);overflow:auto;padding:28px}
.ierp-modal.is-open{display:flex;align-items:flex-start;justify-content:center}
.ierp-modal-dialog{width:min(1050px,96vw);background:#fff;border-radius:16px;box-shadow:0 24px 80px rgba(15,23,42,.28);margin:auto;overflow:hidden}
.ierp-modal-dialog.modal-lg{width:min(1220px,97vw)}
.ierp-modal-header{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid #e8edf5}
.ierp-modal-header h2{margin:0;font-size:20px}
.ierp-modal-close{appearance:none;border:0;background:transparent;font-size:28px;line-height:1;cursor:pointer;color:#64748b}
.ierp-modal-body{padding:20px 22px;max-height:78vh;overflow:auto}
.ierp-modal-footer{display:flex;justify-content:flex-end;gap:10px;padding:14px 22px;border-top:1px solid #e8edf5;background:#fafbfc}
body.ierp-modal-open{overflow:hidden}
.ierp-list-card{background:#fff;border:1px solid #e8edf5;border-radius:14px;padding:18px}
.ierp-badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:11px;background:#eef4ff;color:#315da8}
.inv-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-bottom:16px}
.inv-summary .stat{border:1px solid #e8edf5;border-radius:12px;padding:14px;background:#fff}
.inv-summary .stat strong{display:block;font-size:20px;margin-top:4px}


/* ==========================================================
   iERP V1.0.9.1
   Controles uniformes + warning + filtros
   ========================================================== */

/* Fecha con el mismo lenguaje visual que TextBox/DropDownList */
.form-field input[type=date]{
    width:100%;
    min-height:42px;
    box-sizing:border-box;
    border:1px solid #d9e0ee;
    border-radius:8px;
    padding:9px 12px;
    background:#fff;
    color:#1f2937;
    font:14px "Segoe UI",Arial,sans-serif;
    outline:none;
    transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}
.form-field input[type=date]:focus{
    border-color:#3b64dc;
    box-shadow:0 0 0 3px rgba(59,100,220,.09);
}
.form-field input[type=date]::-webkit-calendar-picker-indicator{
    cursor:pointer;
    opacity:.72;
    padding:4px;
}

/* Igualar todos los controles de formulario */
.form-field input[type=text],
.form-field input[type=password],
.form-field input[type=number],
.form-field input[type=date],
.form-field select,
.form-field textarea{
    border-radius:8px;
    box-sizing:border-box;
}

/* Barra de búsqueda / filtros */
.ierp-searchbar{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}
.ierp-searchbar input[type=text],
.ierp-searchbar input[type=search],
.ierp-searchbar select{
    min-height:40px;
    border:1px solid #d8dee9;
    border-radius:8px;
    background:#fff;
    color:#1f2937;
    padding:8px 12px;
    font:14px "Segoe UI",Arial,sans-serif;
    outline:none;
    box-sizing:border-box;
}
.ierp-searchbar select{
    min-width:190px;
    max-width:330px;
}
.ierp-searchbar input[type=text]{
    min-width:280px;
    max-width:460px;
}
.ierp-searchbar input:focus,
.ierp-searchbar select:focus{
    border-color:#3b64dc;
    box-shadow:0 0 0 3px rgba(59,100,220,.09);
}
.ierp-searchbar .btn-secondary,
.ierp-searchbar input[type=submit]{
    min-height:40px;
    border-radius:8px;
}

/* Campos obligatorios: sólo borde tenue hasta intentar guardar */
.required-input{
    border-color:#efb4b4!important;
    background:#fffdfd!important;
}
.required-input:focus{
    border-color:#d14343!important;
    box-shadow:0 0 0 3px rgba(209,67,67,.10)!important;
}

/* Warning diferenciado de error */
.toast-warning b{
    background:#fef3c7;
    color:#b45309;
}
.toast-warning{
    border-left:4px solid #f59e0b;
}

/* Mejorar forma visual de modales */
.ierp-modal-dialog{
    border-radius:16px;
}
.ierp-modal-header{
    background:#fff;
}
.ierp-modal-body .form-card{
    border-radius:10px;
}

/* Responsive de filtros */
@media(max-width:760px){
    .ierp-searchbar input[type=text],
    .ierp-searchbar input[type=search],
    .ierp-searchbar select{
        width:100%;
        min-width:0;
        max-width:none;
    }
}


/* V1.0.10 - Toast debe quedar siempre encima de modales */
.toast-host{
    z-index:9999!important;
    pointer-events:none;
}
.toast-host .toast{
    pointer-events:auto;
}
.ierp-modal{
    z-index:3000!important;
}
.processing-overlay{
    z-index:9000!important;
}


/* ==========================================================
   V1.0.11 - Punto de Venta profesional
   ========================================================== */
.pos-shell{display:flex;flex-direction:column;gap:16px}
.pos-toolbar{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}
.pos-toolbar h1{margin:2px 0 4px;font-size:30px;color:#111827}
.pos-toolbar p{margin:0;color:#64748b}
.pos-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap}
.pos-pay{min-width:170px}
.pos-context-card{background:#fff;border:1px solid #e5eaf3;border-radius:14px;padding:14px 16px;box-shadow:0 5px 18px rgba(15,23,42,.04)}
.pos-context-grid{display:grid;grid-template-columns:repeat(6,minmax(135px,1fr));gap:12px}
.pos-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,.85fr);gap:16px;align-items:stretch}
.pos-sale-panel,.pos-products-panel{background:#fff;border:1px solid #e5eaf3;border-radius:16px;box-shadow:0 10px 28px rgba(15,23,42,.05);overflow:hidden}
.pos-panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid #edf1f7}
.pos-panel-head>div{display:flex;flex-direction:column;gap:2px}
.pos-panel-head small{color:#64748b}
.pos-ticket-label{font-size:11px;letter-spacing:.11em;color:#64748b;font-weight:700}
.pos-entry{display:grid;grid-template-columns:minmax(220px,2fr) .7fr .8fr .8fr auto;gap:10px;padding:16px 18px;background:#f8faff;border-bottom:1px solid #edf1f7;align-items:end}
.pos-add-wrap{padding-bottom:1px}
.pos-add-wrap .btn-primary{min-height:42px}
.pos-ticket-table{min-height:300px;max-height:430px;overflow:auto}
.pos-gridview{margin:0;border:0}
.pos-gridview th{position:sticky;top:0;background:#f8fafc;z-index:1}
.pos-note-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px 18px;border-top:1px solid #edf1f7}
.pos-totals{display:flex;justify-content:flex-end;gap:24px;align-items:center;padding:16px 18px;background:#111827;color:#fff}
.pos-totals>div{display:flex;flex-direction:column;align-items:flex-end;min-width:110px}
.pos-totals span{font-size:12px;color:#cbd5e1}
.pos-totals strong{font-size:18px}
.pos-totals .grand{padding-left:22px;border-left:1px solid #334155;min-width:160px}
.pos-totals .grand strong{font-size:28px;color:#93c5fd}
.pos-products-panel{display:flex;flex-direction:column;min-height:580px}
.pos-search{width:180px;border:1px solid #d9e1ef;border-radius:9px;padding:9px 11px}
.pos-product-cards{padding:12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;overflow:auto;max-height:620px}
.pos-product-card{display:flex;flex-direction:column;gap:5px;text-decoration:none;color:#111827;border:1px solid #e4e9f2;border-radius:12px;padding:12px;background:#fff;transition:.15s ease;min-height:116px}
.pos-product-card:hover{transform:translateY(-1px);border-color:#8fa8ec;box-shadow:0 8px 18px rgba(37,99,235,.08)}
.pos-product-icon{display:flex;width:34px;height:34px;border-radius:10px;align-items:center;justify-content:center;background:#eaf0ff;color:#315bd6;font-weight:800}
.pos-product-name{font-weight:700;line-height:1.25}
.pos-product-meta{font-size:11px;color:#64748b}
.pos-product-card strong{margin-top:auto;color:#1d4ed8;font-size:16px}
.pos-history{margin-top:0}
@media(max-width:1180px){
 .pos-context-grid{grid-template-columns:repeat(3,1fr)}
 .pos-grid{grid-template-columns:1fr}
 .pos-products-panel{min-height:auto}
 .pos-product-cards{grid-template-columns:repeat(4,minmax(0,1fr));max-height:420px}
}
@media(max-width:760px){
 .pos-toolbar{flex-direction:column}
 .pos-context-grid{grid-template-columns:1fr 1fr}
 .pos-entry{grid-template-columns:1fr 1fr}
 .pos-article-select{grid-column:1/-1}
 .pos-add-wrap{grid-column:1/-1}
 .pos-note-row{grid-template-columns:1fr}
 .pos-totals{justify-content:space-between;gap:10px}
 .pos-product-cards{grid-template-columns:1fr 1fr}
}

/* V1.0.11 Dashboard */
.dash-bars{display:flex;flex-direction:column;gap:14px;padding-top:8px}
.dash-bar-row{display:grid;grid-template-columns:90px 1fr 105px;align-items:center;gap:10px}
.dash-bar-row>span{font-size:12px;color:#64748b;text-transform:capitalize}
.dash-bar-row>div{height:10px;background:#eef2f8;border-radius:999px;overflow:hidden}
.dash-bar-row i{display:block;height:100%;background:#4169e1;border-radius:999px;min-width:2px}
.dash-bar-row strong{text-align:right;font-size:13px}
.dash-production-row{display:grid;grid-template-columns:1fr auto;gap:5px 12px;padding:11px 0;border-bottom:1px solid #eef2f6}
.dash-production-row:last-child{border-bottom:0}
.dash-production-row small{grid-column:1/-1;color:#64748b}
.dash-activity li{position:relative;padding-right:88px}
.dash-activity li small{position:absolute;right:0;top:0;color:#94a3b8}
.production-workspace{display:grid;grid-template-columns:1fr;gap:14px}

/* V1.0.12 Configuración */
.settings-grid{display:grid;grid-template-columns:1fr;gap:16px}
.config-logo-box{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:16px;padding:16px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc}
.config-logo-box p{margin:3px 0;color:#64748b;font-size:12px}
.form-field.full{grid-column:1/-1}

.config-logo-preview{width:130px;height:72px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:center;padding:8px}
.config-logo-preview img{max-width:100%;max-height:100%;object-fit:contain}


/* ============================================================
   V1.0.13 - Layout sin scroll horizontal global
   ============================================================ */
html,body,form{max-width:100%;overflow-x:hidden}
.layout{width:100%;max-width:100%}
.content{min-width:0;max-width:calc(100vw - 248px);overflow-x:hidden}
.content>*{min-width:0;max-width:100%}
.ierp-list-card,.form-card,.card{min-width:0;max-width:100%;overflow:hidden}
.ierp-table-scroll{width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;border-radius:10px}
.ierp-table-scroll .grid{min-width:760px;width:100%;max-width:none}
.grid th,.grid td{white-space:nowrap}
.grid td:nth-child(2),.grid td:nth-child(3){white-space:normal}
.form-grid{min-width:0}
.form-field{min-width:0}
.form-field input,.form-field select,.form-field textarea{max-width:100%}
.finance-kpi-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:16px}
.production-order-source{margin-bottom:16px}
.pos-ticket-config{display:flex;align-items:flex-end;flex-direction:column;gap:4px}
@media(max-width:760px){
 .content{max-width:100vw}
 .ierp-table-scroll .grid{min-width:680px}
 .finance-kpi-row{grid-template-columns:1fr}
}

/* Cualquier listado heredado que aún no use ierp-table-scroll desplaza sólo su tarjeta. */
.ierp-list-card{overflow-x:auto!important;overflow-y:hidden!important}


/* ============================================================
   iERP V1.0.15 - UX/UI consistente
   ============================================================ */

/* Branding */
.topbar-brand{gap:10px}
.topbar-fsg-logo{
    width:64px;
    height:34px;
    object-fit:contain;
    display:block;
}
.topbar-brand b{
    font-size:22px;
    color:#0d4f94;
    letter-spacing:-.4px;
}
@media(max-width:760px){
    .topbar-fsg-logo{width:50px;height:30px}
}

/* Formularios más limpios */
.ierp-modal-body .form-card{
    border-radius:14px;
    border:1px solid #e4eaf4;
    box-shadow:0 4px 14px rgba(15,23,42,.035);
}
.form-card{
    border-radius:14px;
}
.form-field input[type=text],
.form-field input[type=password],
.form-field input[type=number],
.form-field input[type=date],
.form-field input[type=time],
.form-field select,
.form-field textarea{
    border-radius:10px;
    transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.form-field input[type=date],
.form-field input[type=time]{
    width:100%;
    min-height:42px;
    border:1px solid #d9e0ee;
    padding:9px 11px;
    background:#fff;
    font:14px "Segoe UI",Arial,sans-serif;
    outline:none;
}
.date-readonly{
    width:100%;
    min-height:42px;
    border:1px solid #d9e0ee;
    border-radius:10px;
    padding:9px 11px;
    background:#f8fafc!important;
    color:#334155;
    font:14px "Segoe UI",Arial,sans-serif;
}
.accounting-note-important{
    border-left-width:4px;
    background:#f7f9ff;
    border-radius:0 10px 10px 0;
}

/* Botones principales */
.btn-primary,.btn-secondary,.btn-danger{
    border-radius:9px;
    min-height:40px;
    transition:transform .12s ease,box-shadow .12s ease,background .12s ease;
}
.btn-primary:hover,.btn-secondary:hover,.btn-danger:hover{
    transform:translateY(-1px);
    box-shadow:0 5px 14px rgba(15,23,42,.10);
}
.btn-primary:active,.btn-secondary:active,.btn-danger:active{
    transform:translateY(0);
}
.form-actions{
    align-items:center;
    flex-wrap:wrap;
    padding-top:2px;
}

/* Iconos SVG embebidos: no requieren librería externa */
.btn-action{
    background-repeat:no-repeat!important;
    background-position:14px center!important;
    background-size:17px 17px!important;
    padding-left:42px!important;
}
.btn-save{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z'/%3E%3Cpolyline points='17 21 17 13 7 13 7 21'/%3E%3Cpolyline points='7 3 7 8 15 8'/%3E%3C/svg%3E");
}
.btn-process{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.btn-add,.btn-new{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}
.btn-print{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 6 2 18 2 18 9'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8'/%3E%3C/svg%3E");
}
.btn-clear{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14H6L5 6m3 0V4h8v2'/%3E%3C/svg%3E");
}

/* Acciones compactas en grids */
.grid-action-cell{
    width:48px;
    min-width:48px;
    text-align:center!important;
}
.grid-action-icon{
    width:32px;
    height:32px;
    min-width:32px;
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    border-radius:8px;
    text-decoration:none!important;
    font-size:18px;
    line-height:1;
    font-weight:700;
    border:1px solid transparent;
    transition:background .14s ease,border-color .14s ease,transform .14s ease;
}
.grid-action-icon:hover{
    transform:translateY(-1px);
}
.action-edit{color:#315bd6!important;background:#eef3ff;border-color:#dbe5ff}
.action-edit:hover{background:#e2eaff;border-color:#bdcdfd}
.action-open{color:#0f766e!important;background:#ecfdf5;border-color:#d1fae5}
.action-adjust{color:#7c3aed!important;background:#f5f3ff;border-color:#ede9fe}
.action-approve{color:#15803d!important;background:#f0fdf4;border-color:#dcfce7}
.action-reject,.action-delete{color:#b91c1c!important;background:#fef2f2;border-color:#fee2e2}
.grid-actions td:first-child,.grid-actions th:first-child{
    position:sticky;
    left:0;
    z-index:2;
    background:#fff;
}
.grid-actions th:first-child{
    background:#f8fafc;
}
.grid-actions tbody tr:hover td:first-child{
    background:#f8faff;
}

/* Listados */
.ierp-list-card,.card{
    border-radius:14px;
}
.ierp-searchbar input{
    border-radius:9px;
}


/* ============================================================
   V1.0.16 - sidebar contraíble y filtros universales
   ============================================================ */
.sidebar-toggle{
 border:0;background:#eef3fb;color:#173b67;width:34px;height:34px;border-radius:8px;
 cursor:pointer;font-size:17px;display:inline-flex;align-items:center;justify-content:center;
}
.sidebar,.content{transition:width .2s ease,margin-left .2s ease,max-width .2s ease,transform .2s ease}
body.sidebar-collapsed .sidebar{transform:translateX(-100%)}
body.sidebar-collapsed .content{margin-left:0;width:100%;max-width:100vw}
body.sidebar-collapsed .sidebar-toggle{background:#dfe9f7}
.ierp-status-filter{
 min-height:40px;border:1px solid #d8e0ed;border-radius:9px;background:#fff;
 padding:8px 34px 8px 11px;font:13px "Segoe UI",Arial,sans-serif;color:#334155;
}
.ierp-searchbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ierp-searchbar>input[type=text]{min-width:240px;flex:1}
@media(max-width:760px){.sidebar-toggle{display:none}}

.filter-grid{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:12px;align-items:end}
.filter-wide{grid-column:span 1}.filter-actions>div{display:flex;gap:8px}.filter-note{display:block;color:#64748b;margin-top:8px}
.summary-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:14px 0}
.summary-strip>div{background:#fff;border:1px solid #e3e9f3;border-radius:12px;padding:13px 16px}
.summary-strip span{display:block;color:#64748b;font-size:11px;text-transform:uppercase;font-weight:700}.summary-strip strong{font-size:19px;color:#172033}
.btn-search{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E")}
.btn-success{background:#198754;color:#fff;border:0;padding:9px 16px;font-weight:700}
.btn-approve{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")}
.movement-status-help{margin-top:12px;font-size:12px;font-weight:800;color:#475569;display:flex;gap:7px;align-items:center}.status-dot{width:8px;height:8px;border-radius:50%;background:#e6a700}
.approval-config-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.config-switch{display:flex;gap:10px;border:1px solid #e3e9f3;border-radius:11px;padding:12px}.config-switch span{display:flex;flex-direction:column}.config-switch small{color:#64748b;margin-top:3px}
@media(max-width:900px){.filter-grid{grid-template-columns:1fr 1fr}.summary-strip{grid-template-columns:1fr 1fr}.approval-config-grid{grid-template-columns:1fr}}
@media print{.topbar,.sidebar,.page-head .ierp-page-actions,.report-filter-card,.toast-host{display:none!important}.content{margin:0!important;width:100%!important;max-width:100%!important;padding:0!important}.ierp-table-scroll{overflow:visible!important}.grid{min-width:0!important;font-size:10px}.summary-strip{margin:0 0 10px}}

.confirm-box-modern{max-width:430px;border-radius:18px;padding:26px 28px;box-shadow:0 24px 70px rgba(15,23,42,.28)}
.confirm-icon-danger{background:#fff0f0;color:#c62828;border:1px solid #ffd4d4}
.ierp-action-confirm.show{display:flex}

/* ============================================================
   V1.0.17 - filtros, estatus y reportes
   ============================================================ */
.modal-status-wrap{display:flex;align-items:center;gap:10px}
.status-label{font-size:10px;font-weight:800;color:#64748b;letter-spacing:.08em}
.ierp-status-badge{display:inline-flex;align-items:center;justify-content:center;min-width:92px;padding:6px 10px;border-radius:999px;background:#eef4ff;color:#234ea2;font-size:11px;font-weight:800;letter-spacing:.04em}
.movement-filter-panel{width:100%}
.movement-filter-grid,.report-filter-grid{grid-template-columns:repeat(4,minmax(150px,1fr))}
.filter-actions-row{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px;padding-top:12px;border-top:1px solid #edf1f7}
.report-filter-card{overflow:visible}
.inventory-control-help{background:#f8fbff;border:1px solid #dbe8fa;border-left:4px solid #315bd6;border-radius:12px;padding:15px 17px;margin:0 0 16px}
.inventory-control-help strong{color:#163d77}.inventory-control-help p{margin:6px 0;color:#516174;line-height:1.5;font-size:13px}
.grid-action-cell{white-space:nowrap;width:72px}
.grid-action-icon{display:inline-flex;align-items:center;justify-content:center;width:29px;height:29px;border-radius:7px;text-decoration:none;margin-right:4px;font-weight:800}
.action-edit{background:#edf4ff;color:#2454a6}.action-delete{background:#fff0f0;color:#c62828}.action-edit:hover{background:#dfeaff}.action-delete:hover{background:#ffe0e0}
@media(max-width:980px){.movement-filter-grid,.report-filter-grid{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.movement-filter-grid,.report-filter-grid{grid-template-columns:1fr}.filter-actions-row>*{width:100%}}

/* V1.0.22 - Cotización comercial */
.quote-modal-dialog{max-width:1220px}
.quote-header-card,.quote-detail-card{box-shadow:none;border:1px solid #e5eaf2}
.quote-header-grid{grid-template-columns:repeat(4,minmax(160px,1fr))}
.quote-field-wide{grid-column:span 2}
.quote-help{margin-top:14px;padding:11px 13px;border-radius:10px;background:#f7f9fc;border:1px solid #e1e7f0;color:#526174;font-size:12px;line-height:1.45}
.quote-divider{display:flex;align-items:center;gap:12px;margin:19px 0 13px;font-size:11px;font-weight:800;letter-spacing:.11em;color:#65758b}
.quote-divider:before,.quote-divider:after{content:"";height:1px;background:#dfe6ef;flex:1}
.quote-detail-grid{grid-template-columns:minmax(260px,2fr) minmax(180px,1.2fr) repeat(3,minmax(130px,1fr))}
.quote-line-actions{justify-content:flex-end}
@media(max-width:1000px){.quote-header-grid,.quote-detail-grid{grid-template-columns:1fr 1fr}.quote-field-wide{grid-column:auto}}
@media(max-width:640px){.quote-header-grid,.quote-detail-grid{grid-template-columns:1fr}}

/* ============================================================
   iERP V1.0.24 - Recursos Humanos Workspace
   ============================================================ */
.rh-workspace-shell{display:grid;grid-template-columns:220px minmax(0,1fr);gap:18px;min-height:calc(100vh - 125px)}
.rh-workspace-nav{background:linear-gradient(180deg,#203653 0%,#172b45 100%);border-radius:16px;padding:18px 12px;color:#fff;display:flex;flex-direction:column;min-height:680px;box-shadow:0 12px 28px rgba(19,41,68,.14)}
.rh-brand{display:flex;align-items:center;gap:11px;padding:3px 8px 18px;border-bottom:1px solid rgba(255,255,255,.11);margin-bottom:12px}
.rh-brand-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:11px;background:rgba(255,255,255,.13);font-weight:900;font-size:13px}
.rh-brand strong{display:block;font-size:14px}.rh-brand small{display:block;opacity:.65;margin-top:2px;font-size:11px}
.rh-workspace-nav nav{display:flex;flex-direction:column;gap:5px}
.rh-workspace-nav nav a{display:flex;align-items:center;gap:10px;color:rgba(255,255,255,.84);text-decoration:none;padding:10px 11px;border-radius:9px;font-size:13px;font-weight:600;transition:.15s}
.rh-workspace-nav nav a:hover{background:rgba(255,255,255,.1);color:#fff}
.rh-workspace-nav nav a span{width:20px;text-align:center;opacity:.8}
.rh-nav-separator{margin:13px 10px 5px;font-size:9px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.42)}
.rh-workspace-foot{margin-top:auto;font-size:10px;opacity:.43;padding:12px 9px 2px}
.rh-workspace-content{min-width:0}
.rh-workspace-topbar{background:#fff;border:1px solid #e5eaf1;border-radius:13px;padding:11px 15px;display:flex;align-items:center;justify-content:space-between;margin-bottom:15px}
.rh-workspace-topbar strong{display:block;font-size:14px;color:#21354f}.rh-workspace-topbar .eyebrow{font-size:9px}
.rh-back-erp{text-decoration:none}
.rh-home-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin:8px 0 18px}.rh-home-head h1{margin:4px 0 3px;font-size:27px}.rh-home-head p{margin:0;color:#6b7b8f}.rh-home-actions{display:flex;gap:8px}
.rh-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:15px}
.rh-kpi-card{background:#fff;border:1px solid #e5eaf1;border-radius:14px;padding:15px;display:flex;gap:12px;align-items:center;min-height:92px}
.rh-kpi-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:12px;background:#f0f5fb;font-size:18px;color:#385a82}
.rh-kpi-card small,.rh-kpi-card span:last-child{display:block;color:#7c8999;font-size:10px}.rh-kpi-card strong{display:block;font-size:24px;color:#20344e;line-height:1.15;margin:2px 0}
.rh-shortcuts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:15px}
.rh-shortcuts a{background:#fff;border:1px solid #e5eaf1;border-radius:14px;padding:14px;text-decoration:none;color:#253a54;display:grid;grid-template-columns:36px 1fr;column-gap:9px;align-items:center}
.rh-shortcuts a>span{grid-row:1/3;display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:#f6f8fb}
.rh-shortcuts strong{font-size:12px}.rh-shortcuts small{color:#7d8a99;font-size:9px;margin-top:2px}
.rh-home-columns{display:grid;grid-template-columns:1.25fr 1fr;gap:15px}.rh-home-columns .ierp-list-card{margin:0}
@media(max-width:1100px){.rh-kpi-grid,.rh-shortcuts{grid-template-columns:repeat(2,1fr)}.rh-home-columns{grid-template-columns:1fr}}
@media(max-width:850px){.rh-workspace-shell{grid-template-columns:1fr}.rh-workspace-nav{min-height:auto}.rh-workspace-nav nav{display:grid;grid-template-columns:repeat(2,1fr)}.rh-nav-separator,.rh-workspace-foot{display:none}}
@media(max-width:600px){.rh-kpi-grid,.rh-shortcuts{grid-template-columns:1fr}.rh-home-head{display:block}.rh-home-actions{margin-top:12px;flex-wrap:wrap}}

/* RH como espacio de trabajo independiente dentro de la misma sesión iERP */
.rh-module-mode .sidebar{display:none!important}
.rh-module-mode .content{margin-left:0!important;width:100%!important;max-width:100vw!important;padding:18px!important}
.rh-module-mode #btnSidebarToggle{display:none!important}

/* Flujo transversal Ventas -> Producción -> Embarques */
.erp-flow-strip{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:#fff;border:1px solid #e3e9f2;border-radius:12px;padding:10px 14px;margin:0 0 16px}
.erp-flow-strip span{background:#f5f8fc;border:1px solid #e3e9f2;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:700;color:#35516f}
.erp-flow-strip b{color:#8da0b5;font-size:13px}

.folio-input{min-width:90px;max-width:140px}.folio-number{max-width:100px;text-align:right}

.report-module-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:14px}
.report-module-card{display:flex;flex-direction:column;gap:8px;padding:18px;border:1px solid #dfe7f2;border-radius:14px;background:#fff;text-decoration:none;color:#182235;min-height:135px}
.report-module-card:hover{box-shadow:0 8px 24px rgba(25,48,82,.08);transform:translateY(-1px)}
.report-module-card b{font-size:16px}.report-module-card span{font-size:12px;color:#718096;line-height:1.45}.report-module-card strong{margin-top:auto;color:#3567e8;font-size:12px}
.report-summary{padding:8px 0 12px;color:#65758b;font-size:12px}

.cash-kpis{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:12px;margin-bottom:16px}
.cash-kpis>div{background:#fff;border:1px solid #dfe7f2;border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:6px}
.cash-kpis small{color:#72809a;text-transform:uppercase;font-size:10px;font-weight:700;letter-spacing:.05em}
.cash-kpis strong{font-size:20px;color:#172238}.cash-columns{display:grid;grid-template-columns:1.35fr 1fr;gap:16px}
@media(max-width:1100px){.cash-kpis{grid-template-columns:repeat(2,1fr)}.cash-columns{grid-template-columns:1fr}}

.rh-module-mode .rh-workspace-shell{width:100%!important;max-width:none!important}
.rh-config-card{max-width:980px}.rh-formula{padding:12px 14px;border:1px solid #dfe7f2;border-radius:9px;background:#f7f9fc;font-weight:700;color:#294764}

/* V1.0.53.35 - Busqueda local sobre DropDownList WebForms: conserva el select original para postback */
.ierp-search-select{position:relative;min-width:0}.ierp-native-select{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;left:0;top:0}.ierp-search-trigger{width:100%;min-height:40px;background:#fff;border:1px solid #cbd5e1;border-radius:8px;text-align:left;padding:8px 32px 8px 12px;color:#18253e;font:inherit;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ierp-search-trigger:after{content:'⌄';position:absolute;right:12px;color:#64748b}.ierp-search-trigger:disabled{background:#f1f5f9;color:#64748b}.ierp-search-pop{position:absolute;z-index:2000;top:calc(100% + 4px);left:0;right:0;min-width:260px;background:white;border:1px solid #cbd5e1;box-shadow:0 12px 32px #101a302b;border-radius:9px;padding:6px}.ierp-search-pop[hidden]{display:none}.ierp-search-pop input{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:6px;padding:8px;font:inherit}.ierp-search-list{max-height:265px;overflow:auto;margin-top:5px}.ierp-search-option{display:block;width:100%;text-align:left;border:0;border-radius:5px;background:white;padding:9px;color:#14223b;cursor:pointer;font:inherit}.ierp-search-option:hover,.ierp-search-option.active{background:#e8effe}.ierp-search-option:disabled{color:#8894a5}.ierp-search-list p{padding:8px;color:#69788e}
@media print{.ierp-search-pop{display:none!important}}

/* V1.0.53.35.1: el menú se teletransporta al body y flota por encima de modales. */
.ierp-search-pop{position:fixed!important;z-index:12000!important;left:0;right:auto!important;top:auto;bottom:auto;box-sizing:border-box;overflow:hidden;min-width:0!important;}
.ierp-search-pop[hidden]{display:none!important;}
.ierp-search-list{overflow-y:auto;overscroll-behavior:contain;}
.ierp-search-option:focus-visible{outline:2px solid #3965cf;outline-offset:-2px;background:#e8effe;}

/* V1.0.53.43: el buscador compartido debe superar los modales de mayor z-index.
   El panel está portado directamente a document.body; no lo limita overflow. */
.ierp-search-pop{position:fixed!important;z-index:2147483600!important;pointer-events:auto;}
.ierp-search-pop[hidden]{display:none!important;}
