:root{--navy:#102a43;--blue:#176b87;--teal:#1b998b;--bg:#f3f6f9;--text:#203040;--muted:#708090;--line:#e5ebf0;--white:#fff;--shadow:0 12px 32px rgba(16,42,67,.07)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,"Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--text)}a{color:inherit;text-decoration:none}
.auth-bg{min-height:100vh;display:grid;place-items:center;padding:32px 20px;background:linear-gradient(90deg,rgba(7,28,48,.38),rgba(7,28,48,.08)),url("../images/fondo_bodega_login.png") center/cover fixed no-repeat;position:relative}.auth-bg:before{content:"";position:fixed;inset:0;background:linear-gradient(135deg,rgba(5,28,49,.18),rgba(9,91,112,.10));pointer-events:none}.auth-card{position:relative;z-index:1;backdrop-filter:blur(8px);background:rgba(255,255,255,.96);}
.auth-card{width:min(100%,440px);background:#fff;padding:38px;border:1px solid #e7edf2;border-radius:22px;box-shadow:var(--shadow)}
.brand-mark{height:54px;width:54px;display:grid;place-items:center;border-radius:16px;background:linear-gradient(135deg,var(--blue),var(--teal));color:#fff;font-weight:800;font-size:20px;letter-spacing:-1px;margin-bottom:22px}
.auth-card h1{margin:5px 0 8px;font-size:29px;letter-spacing:-.7px}.muted{color:var(--muted);line-height:1.55}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.5px;color:var(--teal);margin:0 0 8px}
form{margin-top:25px}label{display:block;font-size:13px;font-weight:650;margin:15px 0;color:#34495e}input{display:block;width:100%;padding:12px 13px;border:1px solid #d8e1e8;border-radius:10px;margin-top:7px;font:inherit;outline:none;background:#fbfcfd}input:focus{border-color:var(--teal);box-shadow:0 0 0 3px #1b998b20}.btn-primary{width:100%;border:0;border-radius:10px;padding:13px 16px;background:linear-gradient(110deg,var(--blue),var(--teal));color:#fff;font-weight:750;font-size:14px;cursor:pointer;margin-top:10px}.alert,.success{padding:11px 13px;border-radius:9px;font-size:13px;margin-top:15px;background:#fff0f0;color:#a33333}.success{background:#e9f8f1;color:#18704c}.small{font-size:12px;margin-top:20px}
.app-shell{min-height:100vh;display:flex}.sidebar{width:248px;background:var(--navy);color:#dce8f0;padding:25px 16px;display:flex;flex-direction:column;flex-shrink:0}.sidebar-brand{display:flex;align-items:center;gap:11px;padding:0 8px 28px}.sidebar-brand strong,.sidebar-brand small{display:block}.sidebar-brand strong{font-size:14px;color:#fff}.sidebar-brand small{font-size:11px;color:#9bb3c5;margin-top:4px}.small-mark{height:39px;width:39px;border-radius:12px;margin:0;font-size:15px}.sidebar nav{display:grid;gap:7px}.sidebar nav a,.sidebar-bottom a{display:flex;align-items:center;gap:10px;padding:12px;border-radius:10px;color:#b8cbd8;font-size:13px}.sidebar nav a.active,.sidebar nav a:hover,.sidebar-bottom a:hover{background:#21465d;color:#fff}.tag{font-size:9px;text-transform:uppercase;margin-left:auto;color:#a3b6c4}.sidebar-bottom{margin-top:auto;border-top:1px solid #2b4a60;padding-top:15px}
.main-content{padding:30px 34px;min-width:0;flex:1;max-width:1700px;margin:0 auto}.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:25px}.topbar h1{font-size:27px;letter-spacing:-.7px;margin:0}.user-pill{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);padding:8px 13px;border-radius:13px}.avatar{height:37px;width:37px;border-radius:11px;display:grid;place-items:center;background:#d9f1ed;color:#147d73;font-weight:800}.user-pill strong,.user-pill small{display:block}.user-pill strong{font-size:12px}.user-pill small{font-size:10px;color:var(--muted);margin-top:3px}
.welcome{display:flex;align-items:center;justify-content:space-between;padding:25px 30px;background:linear-gradient(115deg,#12526d,#168a87);border-radius:18px;color:#fff;box-shadow:var(--shadow);margin-bottom:22px}.welcome h2{font-size:24px;margin:0 0 7px}.welcome p:not(.eyebrow){color:#d7eeee;margin:0;font-size:13px}.eyebrow.light{color:#bcece5}.welcome-icon{font-size:60px;opacity:.75;padding:0 20px}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}.kpi,.panel{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}.kpi{padding:21px}.kpi-label{font-size:12px;color:var(--muted);font-weight:650;display:block}.kpi strong{font-size:28px;letter-spacing:-.7px;display:block;margin:14px 0 7px;color:#183b50}.kpi small{font-size:11px;color:#8999a6}
.content-grid{display:grid;grid-template-columns:1.45fr 1fr;gap:18px}.panel{padding:22px;min-width:0}.panel-heading{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.panel h3{font-size:15px;margin:0 0 6px}.panel-heading p{font-size:11px;color:var(--muted);margin:0}.status{font-size:10px;background:#e6f7f3;color:#168071;padding:6px 8px;border-radius:7px;white-space:nowrap}
.empty-chart{height:190px;display:flex;align-items:flex-end;justify-content:center;gap:24px;position:relative;margin-top:22px;padding:0 25px 36px;border-bottom:1px solid var(--line);background:repeating-linear-gradient(to bottom,transparent 0,transparent 45px,#eef2f5 46px)}.empty-chart span{position:absolute;bottom:8px;color:#94a2ad;font-size:10px}.bar{width:34px;border-radius:7px 7px 0 0;opacity:.72}.bar1{height:65px;background:#2e8ca3}.bar2{height:125px;background:#1b998b}.bar3{height:90px;background:#69b9ae}.bar4{height:150px;background:#5c91b2}
.material-list{list-style:none;padding:0;margin:20px 0 0}.material-list li{display:flex;align-items:center;gap:10px;padding:14px 0;border-bottom:1px solid #eef2f5;font-size:12px}.material-list li:last-child{border-bottom:0}.material-list b{margin-left:auto;font-size:10px;color:var(--muted);font-weight:600}.material-dot{height:9px;width:9px;border-radius:3px}.dot1{background:#2e8ca3}.dot2{background:#1b998b}.dot3{background:#d4a34c}.dot4{background:#7a83b8}
.notice{margin-top:18px;padding:15px 18px;border-radius:12px;background:#e8f4f8;border:1px solid #d4e9f0;color:#36596b;font-size:12px;line-height:1.6}
@media(max-width:1050px){.sidebar{width:215px}.main-content{padding:24px}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.content-grid{grid-template-columns:1fr}}
@media(max-width:650px){.app-shell{display:block}.sidebar{width:100%;padding:14px}.sidebar-brand{padding-bottom:14px}.sidebar nav{grid-template-columns:repeat(2,minmax(0,1fr))}.sidebar-bottom{margin-top:12px}.main-content{padding:18px}.topbar{align-items:flex-start;flex-direction:column}.welcome{padding:20px}.welcome-icon{display:none}.kpi-grid{gap:10px}.kpi{padding:15px}.kpi strong{font-size:23px}.auth-card{padding:26px}}

/* Administración de usuarios */
.users-layout{display:grid;grid-template-columns:minmax(330px,.9fr) minmax(0,1.45fr);gap:18px;align-items:start}
.user-form-panel,.users-table-panel{padding:22px}.admin-form{margin-top:18px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}
.form-grid label{margin:9px 0 12px}
.form-grid input,.form-grid select{display:block;width:100%;padding:11px 12px;border:1px solid #d8e1e8;border-radius:9px;margin-top:7px;font:inherit;background:#fbfcfd;color:var(--text);outline:none}
.form-grid input:focus,.form-grid select:focus{border-color:var(--teal);box-shadow:0 0 0 3px #1b998b20}
.full-width{grid-column:1/-1}
.permissions-box{border:1px solid var(--line);background:#f9fbfc;border-radius:12px;padding:14px;margin:8px 0 16px}
.permissions-title strong,.permissions-title span{display:block}.permissions-title strong{font-size:12px}.permissions-title span{font-size:11px;color:var(--muted);margin-top:4px}
.permissions-grid{display:grid;grid-template-columns:1fr;gap:8px;margin-top:12px}
.permission-option{display:flex;gap:9px;align-items:flex-start;margin:0;padding:10px;background:#fff;border:1px solid #e8edf1;border-radius:9px;cursor:pointer}
.permission-option input{margin:3px 0 0;accent-color:var(--teal);flex-shrink:0}
.permission-option span strong,.permission-option span small{display:block}.permission-option span strong{font-size:10px;letter-spacing:.3px}.permission-option span small{font-size:11px;color:var(--muted);line-height:1.4;margin-top:3px}
.btn-inline{width:auto;min-width:145px;padding:12px 18px}
.btn-secondary,.btn-table{display:inline-flex;align-items:center;justify-content:center;border:1px solid #dbe4ea;background:#fff;color:#36566a;border-radius:8px;padding:8px 10px;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap}
.btn-secondary:hover,.btn-table:hover{background:#eef6f7}
.table-wrap{width:100%;overflow-x:auto;margin-top:18px}.users-table{width:100%;border-collapse:collapse;font-size:12px}
.users-table th{text-align:left;font-size:10px;letter-spacing:.4px;text-transform:uppercase;color:#7b8b97;background:#f7f9fb;padding:12px 10px;border-bottom:1px solid var(--line)}
.users-table td{padding:13px 10px;border-bottom:1px solid #edf1f4;vertical-align:middle}
.users-table td strong,.users-table td small{display:block}.users-table td strong{font-size:12px}.users-table td small{font-size:10px;color:var(--muted);margin-top:4px;max-width:210px;overflow-wrap:anywhere}
.role-badge,.state-badge{display:inline-block;border-radius:7px;padding:6px 8px;font-size:9px;font-weight:800;white-space:nowrap;background:#eaf2f8;color:#35647b}
.state-active{background:#e4f7ed;color:#18734d}.state-inactive{background:#fff0ed;color:#a94438}
.actions-cell{vertical-align:middle!important;white-space:nowrap}.action-buttons{display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;align-items:center;justify-content:flex-start;min-height:34px}.action-buttons form{display:inline-flex;align-items:center;margin:0}.action-buttons a,.action-buttons button{margin:0;line-height:1.2}.inline-form{margin:0}.btn-danger{color:#a94438;border-color:#f1d8d3}.btn-enable{color:#18734d;border-color:#ccebdc}
.notice-success{background:#e9f8f1;border-color:#cdeedd;color:#18704c}.notice-error{background:#fff0f0;border-color:#f3d2d2;color:#9c3434}
@media(max-width:1200px){.users-layout{grid-template-columns:1fr}.permissions-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.form-grid{grid-template-columns:1fr}.full-width{grid-column:auto}.permissions-grid{grid-template-columns:1fr}.user-form-panel,.users-table-panel{padding:16px}.users-table{min-width:720px}}
/* Corrección visual de permisos individuales */
.permissions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.permission-option {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100%;
    box-sizing: border-box;
    padding: 14px !important;
    margin: 0 !important;
    background: #ffffff;
    border: 1px solid #dce6ec;
    border-radius: 10px;
    cursor: pointer;
}

.permission-option input[type="checkbox"] {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 3px 0 0 !important;
    accent-color: #168f89;
}

.permission-option span {
    display: block;
    flex: 1;
    min-width: 0;
}

.permission-option span strong {
    display: block;
    color: #15344d;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.permission-option span small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 11px;
    line-height: 1.5;
}

.permission-option:hover {
    border-color: #168f89;
    background: #f5fbfa;
}

.permission-option:has(input:checked) {
    border-color: #168f89;
    background: #eef9f7;
}

.permissions-box {
    padding: 16px;
    overflow: hidden;
}

@media (min-width: 1201px) {
    .permissions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .permissions-grid {
        grid-template-columns: 1fr;
    }
}
/* Módulo de ingresos */
.operation-panel{padding:22px;margin-bottom:20px}
.operation-panel .admin-form{margin-top:18px}
.operation-panel textarea{display:block;width:100%;box-sizing:border-box;resize:vertical;padding:11px 12px;border:1px solid #d8e1e8;border-radius:9px;margin-top:7px;font:inherit;background:#fbfcfd;color:var(--text)}
.operation-panel textarea:focus{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px #1b998b20}
.filter-form{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:18px 0 10px;padding:14px;background:#f8fafc;border:1px solid var(--line);border-radius:10px}
.filter-form label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:700;color:#43566a}
.filter-form input,.filter-form select{min-width:145px;padding:9px 10px;border:1px solid #d8e1e8;border-radius:8px;background:#fff;color:var(--text);font:inherit}
.filter-form .btn-primary{width:auto;padding:10px 15px}
.summary-pill{font-size:11px;color:var(--muted);background:#eaf7f5;border-radius:8px;padding:9px 12px}
.summary-pill strong{color:#117b75;margin-left:5px}
.notice-success{background:#e9f8f1;border-color:#cdeedd;color:#18704c}
.notice-error{background:#fff0f0;border-color:#f3d2d2;color:#9c3434}
@media(max-width:650px){.operation-panel{padding:15px}.filter-form{align-items:stretch}.filter-form label,.filter-form input,.filter-form select{width:100%;box-sizing:border-box}.filter-form .btn-primary,.filter-form .btn-secondary{width:100%;text-align:center}}


/* Identidad corporativa: Apex Tool Group y desarrollador TI Soluciones */
.sidebar-brand-apex{display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:18px 16px 16px;border-bottom:1px solid rgba(255,255,255,.13);margin-bottom:14px}
.apex-logo-link{display:flex;align-items:center;justify-content:center;background:#fff;border-radius:8px;padding:8px 10px;min-height:62px}
.apex-logo{display:block;width:100%;max-width:174px;max-height:56px;object-fit:contain}
.sidebar-brand-caption{display:flex;flex-direction:column;gap:3px}
.sidebar-brand-caption strong{font-size:14px;color:#fff;line-height:1.25}
.sidebar-brand-caption small{font-size:11px;color:#b9c9d8}
.sidebar-bottom{margin-top:auto;padding:0 14px 14px}
.developer-brand{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:12px 8px 14px;margin-bottom:10px;border-top:1px solid rgba(255,255,255,.16);border-bottom:1px solid rgba(255,255,255,.16);color:#fff}
.developer-caption{font-size:10px;color:#d4e0e9}
.ti-logo{display:block;width:70px;height:48px;object-fit:contain;object-position:left center;background:#fff;border-radius:6px;padding:4px}
.developer-brand strong{font-size:10px;line-height:1.3;letter-spacing:.1px}
.developer-brand small{font-size:10px;color:#c1d0dd}
.logout-link{display:block;padding:9px 7px;font-size:12px;color:#e1ebf3}
.login-brand-logos{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 24px;min-height:70px}
.login-apex-logo{width:64%;max-height:72px;object-fit:contain}
.login-ti-logo{width:27%;max-height:58px;object-fit:contain}
.login-divider{width:1px;height:54px;background:#dce5eb;flex:0 0 1px}
@media(max-width:760px){
 .sidebar-brand-apex{padding:12px 10px}
 .apex-logo{max-width:145px}
 .developer-brand{padding-left:3px}
 .ti-logo{width:58px;height:42px}
 .login-brand-logos{gap:8px}
}


/* Ajuste de alineación según referencia corporativa */
.sidebar{width:234px;padding:14px 12px 12px;overflow:hidden}
.sidebar-brand-apex{display:flex!important;flex:0 0 auto;width:100%;min-width:0;box-sizing:border-box;flex-direction:column!important;align-items:stretch!important;gap:0!important;padding:8px 8px 18px!important;margin:0 0 14px!important;border-bottom:1px solid rgba(255,255,255,.14)!important}
.apex-logo-link{display:flex!important;width:100%!important;min-width:0!important;height:76px;min-height:76px!important;max-height:76px;box-sizing:border-box;align-items:center!important;justify-content:center!important;padding:6px 8px!important;margin:0 0 0!important;background:#fff;border-radius:5px;overflow:hidden}
.apex-logo{display:block!important;width:100%!important;max-width:190px!important;height:62px!important;max-height:62px!important;object-fit:contain!important;flex:0 1 auto}
.sidebar-brand-caption{display:none!important}
.sidebar nav{width:100%;min-width:0}
.sidebar nav a{width:100%;min-width:0;box-sizing:border-box}
.sidebar-bottom{display:flex!important;flex-direction:column!important;align-items:stretch!important;width:100%;min-width:0;box-sizing:border-box;margin-top:auto!important;padding:12px 4px 0!important;border-top:1px solid #2b4a60}
.developer-brand{display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;gap:5px!important;width:100%!important;min-width:0!important;box-sizing:border-box;padding:0 4px 12px!important;margin:0!important;border:0!important;color:#fff}
.developer-caption{display:block!important;width:100%;font-size:10px!important;line-height:1.3;margin:0!important}
.ti-logo{display:block!important;float:none!important;position:static!important;width:72px!important;height:50px!important;max-width:100%;object-fit:contain!important;object-position:center!important;background:#fff;border-radius:5px;padding:4px;box-sizing:border-box;margin:0!important}
.developer-brand strong{display:block!important;width:100%!important;font-size:10px!important;line-height:1.35!important;white-space:normal!important;margin:0!important}
.developer-brand small{display:block!important;width:100%;font-size:10px!important;line-height:1.4;margin-top:2px!important}
.sidebar-bottom .logout-link{display:flex!important;width:100%;box-sizing:border-box;margin:0!important;padding:10px 4px!important;border-top:1px solid rgba(255,255,255,.12);font-size:12px}
@media(max-width:760px){
 .sidebar{width:214px;padding:12px 9px}
 .sidebar-brand-apex{padding:6px 5px 14px!important}
 .apex-logo-link{height:65px;min-height:65px!important;max-height:65px}
 .apex-logo{height:52px!important;max-height:52px!important}
 .sidebar-bottom{padding-left:2px!important;padding-right:2px!important}
}


/* FIX DEFINITIVO DE IDENTIDAD Y ALINEACION DEL MENU LATERAL */
.app-shell > .sidebar {
  flex: 0 0 248px !important;
  width: 248px !important;
  min-width: 248px !important;
  max-width: 248px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding: 14px 16px 12px !important;
  display: flex !important;
  flex-direction: column !important;
}
.app-shell > .sidebar .sidebar-brand-apex {
  display: flex !important;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  margin: 0 0 14px !important;
  padding: 8px 6px 16px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.14) !important;
  overflow: hidden !important;
}
.app-shell > .sidebar .apex-logo-link {
  display: flex !important;
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 72px !important;
  min-height: 72px !important;
  max-height: 72px !important;
  flex: 0 0 72px !important;
  box-sizing: border-box !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 5px 7px !important;
  margin: 0 !important;
  background: #fff !important;
  border-radius: 4px !important;
  overflow: hidden !important;
}
.app-shell > .sidebar .apex-logo {
  display: block !important;
  position: static !important;
  width: 100% !important;
  height: 60px !important;
  min-width: 0 !important;
  max-width: 190px !important;
  max-height: 60px !important;
  flex: 0 1 auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}
.app-shell > .sidebar .sidebar-brand-caption { display: none !important; }
.app-shell > .sidebar nav {
  display: grid !important;
  position: static !important;
  width: 100% !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
  gap: 7px !important;
  margin: 0 !important;
}
.app-shell > .sidebar nav a {
  display: flex !important;
  position: static !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-wrap: anywhere !important;
}
.app-shell > .sidebar .sidebar-bottom {
  display: flex !important;
  position: static !important;
  width: 100% !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  margin: auto 0 0 !important;
  padding: 12px 0 0 !important;
  border-top: 1px solid #2b4a60 !important;
  overflow: hidden !important;
}
.app-shell > .sidebar .developer-brand {
  display: flex !important;
  position: static !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 2px 12px !important;
  border: 0 !important;
  color: #fff !important;
  overflow: hidden !important;
}
.app-shell > .sidebar .developer-caption {
  display: block !important;
  width: 100% !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
  margin: 0 !important;
}
.app-shell > .sidebar .ti-logo {
  display: block !important;
  position: static !important;
  float: none !important;
  width: 70px !important;
  height: 48px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  max-height: 48px !important;
  flex: 0 0 auto !important;
  object-fit: contain !important;
  object-position: center !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 3px !important;
  background: #fff !important;
  border-radius: 4px !important;
}
.app-shell > .sidebar .developer-brand strong {
  display: block !important;
  width: 100% !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  margin: 0 !important;
}
.app-shell > .sidebar .developer-brand small {
  display: block !important;
  width: 100% !important;
  font-size: 10px !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}
.app-shell > .sidebar .logout-link {
  display: flex !important;
  position: static !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 10px 2px !important;
  border-top: 1px solid rgba(255,255,255,.12) !important;
  font-size: 12px !important;
}
@media (max-width: 650px) {
  .app-shell > .sidebar { width: 100% !important; min-width: 0 !important; max-width: none !important; }
  .app-shell > .sidebar .apex-logo-link { max-width: 220px !important; }
}

/* Identidad de la aplicación en el encabezado de todas las páginas */
.topbar > div:first-child::before{content:"LOGÍSTICA INVERSA";display:block;font-size:15px;font-weight:800;letter-spacing:.35px;color:#173f58;margin:0 0 8px;line-height:1.2}
.topbar > div:first-child .eyebrow{display:block}
@media(max-width:650px){.topbar > div:first-child::before{font-size:14px;margin-bottom:6px}}

/* Panel de indicadores mejorado */
.dashboard-chart{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:end;height:210px;margin-top:22px;padding:12px 12px 0;border-bottom:1px solid var(--line);background:repeating-linear-gradient(to bottom,transparent 0,transparent 44px,#eef2f5 45px)}
.dashboard-chart .chart-col{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:8px;min-width:0}
.dashboard-chart .chart-bar{width:min(54px,65%);min-height:5px;border-radius:8px 8px 0 0;background:linear-gradient(180deg,#45b7d1,#176bcb);position:relative}
.dashboard-chart .chart-bar.green{background:linear-gradient(180deg,#61d7b0,#159a79)}.dashboard-chart .chart-bar.orange{background:linear-gradient(180deg,#ffc078,#f08a36)}.dashboard-chart .chart-bar.purple{background:linear-gradient(180deg,#b8a2ff,#7653d6)}
.dashboard-chart .chart-value{font-size:10px;color:#526678;font-weight:700}.dashboard-chart .chart-label{font-size:10px;color:#708090;text-align:center;padding-bottom:10px}
.material-progress{height:7px;overflow:hidden;background:#edf2f7;border-radius:10px;min-width:55px;flex:1}.material-progress span{display:block;height:100%;border-radius:10px;background:linear-gradient(90deg,#1b998b,#58c7a8)}
.kpi{position:relative;overflow:hidden}.kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--teal)}
@media(max-width:650px){.dashboard-chart{gap:6px;padding-left:2px;padding-right:2px}.dashboard-chart .chart-label{font-size:9px}}
@media(min-width:1200px){.kpi-grid{grid-template-columns:repeat(5,minmax(0,1fr))}}


/* Gráfico de movimientos: versión refinada, responsive y sin dependencias externas */
.movement-panel{padding:24px 25px 20px;background:linear-gradient(180deg,#fff 0%,#fcfdff 100%)}
.movement-chart{display:grid;grid-template-columns:48px minmax(0,1fr);gap:10px;height:270px;margin-top:24px}
.chart-y-axis{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;padding:0 0 34px;color:#8b9aaa;font-size:10px;font-variant-numeric:tabular-nums}
.chart-plot{position:relative;min-width:0;border-bottom:1px solid #dfe7ef}
.chart-gridlines{position:absolute;inset:0 0 34px;display:flex;flex-direction:column;justify-content:space-between;pointer-events:none}
.chart-gridlines i{display:block;border-top:1px dashed #e5ebf2;width:100%}
.chart-bars{position:absolute;inset:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(8px,2.2vw,28px);padding:0 clamp(5px,1.4vw,18px);align-items:stretch}
.chart-bar-item{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:0;z-index:1}
.chart-bar-item>strong{font-size:11px;color:#344b61;font-weight:750;margin-bottom:7px;font-variant-numeric:tabular-nums;white-space:nowrap}
.chart-track{height:calc(100% - 58px);width:min(54px,75%);display:flex;align-items:flex-end;justify-content:center}
.chart-bar-fill{width:100%;min-height:3px;border-radius:7px 7px 2px 2px;box-shadow:0 4px 10px rgba(28,73,112,.13);transition:filter .2s,transform .2s}
.chart-bar-item:hover .chart-bar-fill{filter:saturate(1.2);transform:scaleX(1.06)}
.chart-bar-item>span{height:34px;display:flex;align-items:center;justify-content:center;text-align:center;font-size:10px;color:#617488;line-height:1.25;padding-top:8px;max-width:100%}
.chart-legend{display:flex;justify-content:center;gap:20px;flex-wrap:wrap;margin:17px 0 0}
.chart-legend span{display:flex;align-items:center;gap:7px;font-size:10px;color:#607488;white-space:nowrap}
.chart-legend i{display:inline-block;width:9px;height:9px;border-radius:3px}
.chart-footnote{border-top:1px solid #edf1f5;padding-top:13px;margin:16px 0 0;color:#8493a2;font-size:10px;line-height:1.55}
@media(max-width:650px){.movement-panel{padding:18px 14px}.movement-chart{grid-template-columns:36px minmax(0,1fr);height:235px;gap:6px}.chart-bars{gap:5px;padding:0 2px}.chart-bar-item>strong{font-size:9px}.chart-bar-item>span{font-size:9px}.chart-legend{gap:10px}.chart-legend span{font-size:9px}}

/* Dashboard ampliado: recupera tarjetas, donut y paneles informativos sin espacios vacíos */
.main-content{width:100%;max-width:none;padding:26px 30px 30px}
.dashboard-grid{grid-template-columns:minmax(0,1.35fr) minmax(360px,.95fr);gap:18px;align-items:stretch}
.dashboard-grid>.panel{min-height:300px}
.dashboard-grid .movement-panel{min-height:350px}
.inventory-visual{display:grid;grid-template-columns:minmax(125px,.8fr) minmax(0,1.2fr);gap:18px;align-items:center;padding:22px 4px 14px}
.donut-chart{width:min(190px,100%);aspect-ratio:1;border-radius:50%;display:grid;place-items:center;position:relative;margin:auto;box-shadow:inset 0 0 0 1px #fff}
.donut-chart:before{content:"";position:absolute;inset:22%;background:#fff;border-radius:50%;box-shadow:0 2px 12px #17324d12}
.donut-center{z-index:1;text-align:center;display:flex;flex-direction:column;gap:5px;align-items:center;padding:0 5px}
.donut-center strong{font-size:22px;color:#183b50;letter-spacing:-.6px}.donut-center span{font-size:10px;color:#708090}
.donut-legend{display:grid;gap:13px;min-width:0}.donut-legend>div{display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:8px;align-items:center;font-size:11px}.donut-legend i{width:9px;height:9px;border-radius:3px}.donut-legend span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#607488}.donut-legend b{color:#20384f;font-size:11px}
.materials-detail-panel,.impact-panel{min-height:260px}.panel-link{font-size:11px;font-weight:700;color:#176bce;white-space:nowrap}.dashboard-table-wrap{overflow-x:auto;margin-top:20px}.dashboard-table{border-collapse:collapse;width:100%;font-size:11px;white-space:nowrap}.dashboard-table th{text-align:left;background:#f3f7fb;color:#607488;font-size:10px;font-weight:700;padding:12px 10px}.dashboard-table td{padding:13px 10px;border-bottom:1px solid #edf1f5;color:#526678}.dashboard-table tr:last-child td{border-bottom:0}.dashboard-table td:first-child{font-weight:700;color:#233e53}.dashboard-table td strong{color:#13806e}.table-material-dot{display:inline-block;width:8px;height:8px;background:#2878e5;border-radius:3px;margin-right:8px}.dashboard-table .material-progress{margin-top:5px;min-width:45px;height:5px}
.impact-leaf{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:#e1f8ee;color:#168b61;font-size:22px}.impact-highlight{margin-top:22px;border-radius:14px;padding:22px;background:linear-gradient(115deg,#e8faf2,#f2fcf8);display:flex;flex-direction:column;gap:7px}.impact-highlight span{font-size:12px;color:#4e7768}.impact-highlight strong{font-size:30px;letter-spacing:-.8px;color:#147d55}.impact-highlight small,.impact-metrics small{font-size:10px;color:#718c81}.impact-metrics{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.impact-metrics>div{display:flex;align-items:center;gap:10px;padding:14px;border:1px solid #edf1f5;border-radius:12px;min-width:0}.impact-icon{width:34px;height:34px;flex-shrink:0;border-radius:10px;display:grid;place-items:center;font-size:19px}.impact-icon.green{background:#e2f8ef;color:#149768}.impact-icon.orange{background:#fff0e2;color:#e88731}.impact-metrics strong,.impact-metrics small{display:block}.impact-metrics strong{font-size:15px;color:#20384f;margin-bottom:4px}.impact-note{font-size:10px;line-height:1.5;color:#82909c;margin:14px 0 0}
@media(max-width:1050px){.dashboard-grid{grid-template-columns:1fr}.dashboard-grid>.panel{min-height:0}.inventory-visual{grid-template-columns:minmax(125px,.6fr) minmax(0,1fr)}}
@media(max-width:650px){.main-content{padding:16px}.inventory-visual{grid-template-columns:1fr;gap:18px}.donut-chart{width:170px}.impact-metrics{grid-template-columns:1fr}.dashboard-table{min-width:650px}}



/* Ajuste de legibilidad solicitado: tipografía más grande sin alterar la distribución del dashboard */
body { font-size: 14px; }
.main-content { font-size: 14px; }
.topbar > div:first-child::before { font-size: 16px; }
.topbar .eyebrow, .eyebrow { font-size: 12px; }
.page-title, h1 { font-size: 25px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
.panel h2, .panel h3 { font-size: 16px; }
.panel-subtitle, .muted, .hint { font-size: 12px; line-height: 1.5; }
.kpi .label, .kpi-label { font-size: 12px; }
.kpi strong, .kpi .value { font-size: 27px; }
.kpi small, .kpi .help { font-size: 11px; line-height: 1.45; }
.movement-chart { height: 285px; }
.chart-y-axis { font-size: 12px; }
.chart-bar-item > strong { font-size: 13px; }
.chart-bar-item > span { font-size: 12px; }
.chart-legend { gap: 22px; }
.chart-legend span { font-size: 12px; }
.chart-footnote { font-size: 12px; line-height: 1.6; }
.donut-center strong { font-size: 26px; }
.donut-center span { font-size: 12px; }
.donut-legend > div { font-size: 13px; gap: 9px; }
.donut-legend b { font-size: 13px; }
.dashboard-table { font-size: 13px; }
.dashboard-table th { font-size: 12px; }
.dashboard-table td { font-size: 13px; }
.impact-highlight span { font-size: 14px; }
.impact-highlight strong { font-size: 34px; }
.impact-highlight small, .impact-metrics small { font-size: 12px; line-height: 1.45; }
.impact-metrics strong { font-size: 17px; }
.impact-note { font-size: 12px; line-height: 1.6; }
.panel-link { font-size: 13px; }
.app-shell > .sidebar nav a { font-size: 13px; }
.app-shell > .sidebar .developer-caption,
.app-shell > .sidebar .developer-brand strong,
.app-shell > .sidebar .developer-brand small { font-size: 11px !important; }
@media (max-width: 650px) {
  .page-title, h1 { font-size: 22px; }
  .kpi strong, .kpi .value { font-size: 24px; }
  .chart-legend span, .chart-bar-item > span { font-size: 11px; }
  .dashboard-table { font-size: 12px; }
}


/* Dashboard ejecutivo: refinamiento visual de gráficos y lectura de datos */
.dashboard-grid > .panel {
  border: 1px solid #e3eaf1;
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(19, 48, 76, .055);
  overflow: hidden;
}
.dashboard-grid .panel-heading { gap: 14px; align-items: flex-start; }
.dashboard-grid .panel-heading h3 { color: #16364d; letter-spacing: -.25px; }
.dashboard-grid .panel-heading p { color: #7b8da0; margin-top: 5px; }
.movement-panel { position: relative; }
.movement-chart {
  padding: 14px 14px 0 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fbfe 0%, #fff 100%);
}
.chart-y-axis { padding-right: 5px; color: #8192a4; font-size: 11px; }
.chart-plot { border-bottom: 1px solid #cfdbe6; }
.chart-gridlines i { border-top: 1px solid #e8eef4; }
.chart-bar-item { transition: transform .18s ease; }
.chart-bar-item:hover { transform: translateY(-3px); }
.chart-bar-item > strong {
  padding: 4px 7px;
  border: 1px solid #e5ebf2;
  border-radius: 7px;
  background: #fff;
  color: #263f55;
  box-shadow: 0 2px 6px rgba(26, 54, 79, .04);
}
.chart-track { width: min(58px, 72%); }
.chart-bar-fill {
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 5px 12px rgba(26, 54, 79, .14);
  position: relative;
}
.chart-bar-item:nth-child(1) .chart-bar-fill { background: linear-gradient(180deg,#58a6ff 0%,#2468c9 100%) !important; }
.chart-bar-item:nth-child(2) .chart-bar-fill { background: linear-gradient(180deg,#51d6ae 0%,#159879 100%) !important; }
.chart-bar-item:nth-child(3) .chart-bar-fill { background: linear-gradient(180deg,#ffc078 0%,#e9852c 100%) !important; }
.chart-bar-item:nth-child(4) .chart-bar-fill { background: linear-gradient(180deg,#b4a0ff 0%,#7654d5 100%) !important; }
.chart-bar-item > span { font-weight: 650; color: #526b80; }
.chart-legend { padding: 12px 10px; margin-top: 14px; border: 1px solid #edf1f5; border-radius: 12px; background: #fff; }
.chart-legend span { font-weight: 600; }
.chart-legend i { width: 10px; height: 10px; border-radius: 4px; box-shadow: 0 0 0 3px #f3f6fa; }
.chart-footnote { color: #788b9d; }
.inventory-panel { background: linear-gradient(180deg,#fff 0%,#fcfefd 100%); }
.donut-chart { filter: drop-shadow(0 6px 12px rgba(25, 55, 80, .08)); }
.donut-chart:before { inset: 24%; box-shadow: 0 2px 12px rgba(23,50,77,.07); }
.donut-center strong { font-variant-numeric: tabular-nums; }
.donut-legend > div { padding: 7px 8px; border-radius: 8px; transition: background .15s ease; }
.donut-legend > div:hover { background: #f5f8fb; }
.donut-legend i { width: 10px; height: 10px; border-radius: 4px; }
.dashboard-table thead th { border-bottom: 1px solid #e3eaf1; }
.dashboard-table tbody tr { transition: background .15s ease; }
.dashboard-table tbody tr:hover { background: #f8fbfd; }
.material-progress { background: #eaf0f5; }
.impact-highlight { border: 1px solid #d9f1e6; box-shadow: inset 3px 0 0 #1a9b76; }
@media (max-width: 650px) {
  .movement-chart { padding: 10px 5px 0 0; }
  .chart-bar-item > strong { padding: 3px 4px; font-size: 10px; }
  .chart-legend { justify-content: flex-start; }
}

/* Dashboard ejecutivo: barras agrupadas por semana, con jerarquía visual y mejor lectura */
.welcome{background:linear-gradient(112deg,#123d59 0%,#087f83 58%,#139b8c 100%);border-radius:16px;box-shadow:0 10px 24px rgba(16,70,95,.12)}
.kpi{border-radius:14px;box-shadow:0 5px 18px rgba(19,52,79,.055);transition:transform .18s ease,box-shadow .18s ease}.kpi:hover{transform:translateY(-2px);box-shadow:0 10px 25px rgba(19,52,79,.10)}
.kpi:nth-child(1):before{background:#2878e5}.kpi:nth-child(2):before{background:#22b88a}.kpi:nth-child(3):before{background:#ff963d}.kpi:nth-child(4):before{background:#8b65e8}.kpi:nth-child(5):before{background:#16a6a0}
.dashboard-grid{grid-template-columns:minmax(0,1.15fr) minmax(370px,.85fr);gap:18px}.dashboard-grid>.panel{border-radius:16px;box-shadow:0 8px 25px rgba(20,52,77,.055)}
.weekly-chart{display:grid;grid-template-columns:55px minmax(0,1fr);gap:12px;height:290px;margin:28px 6px 0 0}.weekly-axis{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;padding:0 0 35px;color:#8798aa;font-size:11px;font-variant-numeric:tabular-nums}.weekly-plot{position:relative;border-bottom:1px solid #dbe5ee;min-width:0}.weekly-gridlines{position:absolute;inset:0 0 35px;display:flex;flex-direction:column;justify-content:space-between;pointer-events:none}.weekly-gridlines i{border-top:1px solid #e8eef4;width:100%}.weekly-groups{position:absolute;inset:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:clamp(8px,2vw,24px);padding:0 10px}.weekly-group{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;min-width:0;z-index:1}.weekly-bars{height:calc(100% - 35px);width:100%;display:flex;align-items:flex-end;justify-content:center;gap:clamp(3px,.55vw,8px)}.weekly-bar-wrap{height:100%;width:clamp(8px,1.4vw,22px);display:flex;align-items:flex-end;justify-content:center}.weekly-bar{display:block;width:100%;min-height:0;border-radius:5px 5px 1px 1px;box-shadow:0 3px 7px rgba(24,65,98,.12);transition:filter .18s,transform .18s}.weekly-bar-wrap:hover .weekly-bar{filter:brightness(1.08);transform:scaleX(1.12)}.weekly-label{height:35px;display:flex;align-items:center;justify-content:center;color:#61758a;font-size:11px;font-weight:650}.weekly-legend{margin-top:17px;padding:12px 10px;border:1px solid #e9eff5;border-radius:10px;background:#fbfdff}.panel-heading h3{font-size:17px;letter-spacing:-.2px}.panel-heading p{font-size:11px}.inventory-panel .donut-chart{filter:drop-shadow(0 6px 10px rgba(27,65,97,.10))}.dashboard-table tbody tr:hover{background:#f8fbfe}.status{border-radius:6px;font-weight:700}
@media(max-width:1050px){.dashboard-grid{grid-template-columns:1fr}.weekly-chart{height:260px}}
@media(max-width:650px){.weekly-chart{grid-template-columns:37px minmax(0,1fr);gap:6px;height:230px}.weekly-groups{gap:3px;padding:0 3px}.weekly-bars{gap:2px}.weekly-bar-wrap{width:clamp(5px,2vw,10px)}.weekly-label{font-size:9px}.weekly-axis{font-size:9px}.weekly-legend{gap:9px}.weekly-legend span{font-size:10px}}

/* Dashboard ejecutivo: filtros del gráfico e iconografía de materiales */
.chart-filter{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;max-width:72%;padding:7px;background:#f6f9fc;border:1px solid #e3ebf3;border-radius:11px}
.chart-filter label{font-size:10px;font-weight:750;color:#60758a;margin-left:4px}
.chart-filter select,.chart-filter input{height:29px;min-width:64px;max-width:125px;border:1px solid #d7e2ec;border-radius:6px;background:#fff;color:#203b51;font-size:10px;padding:4px 7px}
.chart-filter input{min-width:120px}
.chart-filter button{height:29px;border:0;border-radius:6px;background:#147f83;color:#fff;font-size:10px;font-weight:750;padding:0 12px;cursor:pointer}
.chart-filter button:hover{background:#105f70}
.chart-month-label,.chart-week-label,.chart-year-label{display:none}
.chart-filter:has(select[name="vista"] option[value="mes"]:checked) .chart-month-label,.chart-filter:has(select[name="vista"] option[value="mes"]:checked) select[name="mes_grafico"]{display:inline-block}
.chart-filter:has(select[name="vista"] option[value="semana"]:checked) .chart-week-label,.chart-filter:has(select[name="vista"] option[value="semana"]:checked) select[name="semana_grafico"]{display:inline-block}
.chart-filter:has(select[name="vista"] option[value="año"]:checked) .chart-year-label,.chart-filter:has(select[name="vista"] option[value="año"]:checked) select[name="anio_grafico"]{display:inline-block}
.chart-filter:has(select[name="vista"] option[value="año"]:checked) .chart-date-label,.chart-filter:has(select[name="vista"] option[value="año"]:checked) input[name="fecha_grafico"]{display:none}
.material-icon{display:inline-flex;width:32px;height:32px;align-items:center;justify-content:center;vertical-align:middle;margin-right:9px;border-radius:8px;background:#f2f6fa;border:1px solid #e6edf4;box-shadow:0 2px 4px rgba(25,55,80,.05)}
.material-icon svg{display:block;width:27px;height:27px}
.table-material-name{vertical-align:middle}
.dashboard-table td:first-child{min-width:170px}
.dashboard-table .table-material-dot{display:none}
@media(max-width:1250px){.chart-filter{max-width:100%;justify-content:flex-start}.panel-heading{flex-wrap:wrap}}
@media(max-width:650px){.chart-filter{width:100%;gap:5px}.chart-filter label{font-size:9px}.chart-filter select,.chart-filter input{max-width:none;min-width:0;flex:1}.chart-filter input{min-width:125px}.material-icon{width:28px;height:28px}}
