/* ========================================================
   HG · ALMACÉN — Tema claro profesional
   Huarcaya Group · ERP v2
======================================================== */

:root {
  /* Fondos */
  --bg-0:     #f5f4f2;
  --bg-1:     #ffffff;
  --bg-2:     #f0eeeb;
  --bg-3:     #e8e5e0;
  --bg-input: #ffffff;

  /* Bordes */
  --line-1:  #e2ddd8;
  --line-2:  #d4cfc9;
  --line-3:  #bfb9b2;

  /* Texto */
  --fg-0:    #1a1714;
  --fg-1:    #3d3830;
  --fg-2:    #7a746c;
  --fg-3:    #a8a29b;

  /* Acento dorado Huarcaya */
  --acc:       oklch(0.600 0.140 52);
  --acc-hi:    oklch(0.520 0.150 50);
  --acc-lo:    oklch(0.680 0.130 54);
  --acc-dim:   oklch(0.600 0.140 52 / 0.10);
  --acc-bdr:   oklch(0.600 0.140 52 / 0.35);
  --acc-fg:    #ffffff;

  /* Semáforos */
  --ok:         #16a34a;
  --ok-dim:     #dcfce7;
  --warn:       #d97706;
  --warn-dim:   #fef3c7;
  --danger:     #dc2626;
  --danger-dim: #fee2e2;
  --info:       #2563eb;
  --info-dim:   #dbeafe;

  --ff-ui:   "IBM Plex Sans", system-ui, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, monospace;
  --side-w:   236px;
  --topbar-h: 54px;
}

* { box-sizing: border-box; }
html, body { background: var(--bg-0); color: var(--fg-0); }
body {
  font-family: var(--ff-ui);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  padding-left: var(--side-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum','zero'; }
.uc   { text-transform: uppercase; letter-spacing: 0.06em; }
.text-muted   { color: var(--fg-2) !important; }
.text-dim     { color: var(--fg-3) !important; }
.text-acc     { color: var(--acc) !important; }
.text-ok      { color: var(--ok) !important; }
.text-danger-c{ color: var(--danger) !important; }
.text-warn    { color: var(--warn) !important; }

::selection { background: var(--acc-dim); color: var(--acc-hi); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--bg-0); }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid var(--bg-0); }
*::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

/* ===== Sidebar ===== */
.hg-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--side-w);
  background: var(--bg-1);
  border-right: 1px solid var(--line-1);
  overflow-y: auto;
  z-index: 1040;
  display: flex; flex-direction: column;
  box-shadow: 2px 0 12px rgba(0,0,0,0.05);
}
.hg-sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--line-1);
  background: var(--bg-1);
}
.hg-brand-logo {
  height: 30px; width: auto; max-width: 38px;
  object-fit: contain;
}
.hg-brand-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--acc), var(--acc-lo));
  color: white;
  font-family: var(--ff-mono); font-weight: 700;
  font-size: 13px; border-radius: 6px;
  display: grid; place-items: center;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px var(--acc-bdr);
}
.hg-brand-name { font-weight: 700; font-size: 13px; color: var(--fg-0); }
.hg-brand-sub  { color: var(--fg-3); font-size: 10px; margin-top: 1px; letter-spacing: 0.04em; font-family: var(--ff-mono); }

/* ===== Módulos ERP ===== */
.hg-module-bar {
  display: flex;
  border-bottom: 1px solid var(--line-1);
  background: var(--bg-0);
  padding: 6px 6px;
  gap: 3px;
}
.hg-module-btn {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 7px 2px;
  border-radius: 6px;
  color: var(--fg-3);
  font-size: 8.5px;
  font-family: var(--ff-mono);
  text-transform: uppercase; letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid transparent;
  position: relative;
  transition: background .15s, color .15s, border-color .15s;
  overflow: hidden;
}
.hg-module-btn span {
  max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  display: block; text-align: center;
}
.hg-module-btn i { font-size: 15px; }
.hg-module-btn:hover { background: var(--acc-dim); color: var(--acc); border-color: var(--acc-bdr); }
.hg-module-btn.active {
  background: var(--acc-dim);
  color: var(--acc-hi);
  border-color: var(--acc-bdr);
  font-weight: 700;
}
.hg-module-btn.active i { color: var(--acc); }
.hg-module-btn.soon { opacity: 0.40; cursor: not-allowed; pointer-events: none; }
.hg-soon-icon { position: absolute; top: 3px; right: 3px; font-size: 7px; color: var(--fg-3); }

/* ===== Nav lateral ===== */
.hg-nav { padding: 10px 0; flex: 1; }
.hg-nav__group {
  padding: 14px 14px 6px;
  color: var(--fg-3);
  font-size: 9.5px;
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.hg-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  margin: 1px 8px;
  border-radius: 6px;
  color: var(--fg-2);
  font-size: 12.5px;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.hg-nav__item:hover { background: var(--bg-2); color: var(--fg-0); }
.hg-nav__item i { color: var(--fg-3); font-size: 15px; width: 16px; text-align: center; transition: color .12s; }
.hg-nav__item.active {
  background: var(--acc-dim);
  color: var(--acc-hi);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--acc);
}
.hg-nav__item.active i { color: var(--acc); }

/* Badge nav */
.hg-badge {
  margin-left: auto;
  background: var(--acc-dim);
  color: var(--acc);
  font-family: var(--ff-mono); font-size: 9.5px;
  padding: 1px 7px; border-radius: 99px;
  border: 1px solid var(--acc-bdr);
  font-weight: 600;
}

/* Footer sidebar */
.hg-sidebar__footer { padding: 0 8px 16px; border-top: 1px solid var(--line-1); margin-top: auto; padding-top: 8px; }
.hg-stats { padding: 4px 14px; font-family: var(--ff-mono); font-size: 11px; color: var(--fg-3); }
.hg-stats > div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--line-1); }
.hg-stats > div:last-child { border: 0; }
.hg-stats > div b { color: var(--acc); font-weight: 600; }

/* ===== Topbar ===== */
.hg-topbar {
  position: fixed; top: 0; left: var(--side-w); right: 0;
  height: var(--topbar-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-1);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 1030;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.hg-topbar__menu {
  background: transparent; border: 0; color: var(--fg-2);
  font-size: 18px; padding: 6px 10px; border-radius: 6px;
  cursor: pointer; transition: background .12s;
}
.hg-topbar__menu:hover { background: var(--bg-2); color: var(--fg-0); }
.hg-topbar__module { font-size: 11px; color: var(--acc); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border-right: 1px solid var(--line-1); padding-right: 12px; margin-right: 4px; font-family: var(--ff-mono); }
.hg-topbar__search { position: relative; flex: 1; max-width: 480px; }
.hg-topbar__search input {
  width: 100%; height: 34px;
  background: var(--bg-0);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0 12px 0 34px;
  color: var(--fg-0);
  font-family: var(--ff-mono); font-size: 12px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.hg-topbar__search input:focus { border-color: var(--acc-bdr); box-shadow: 0 0 0 3px var(--acc-dim); background: var(--bg-1); }
.hg-topbar__search input::placeholder { color: var(--fg-3); }
.hg-topbar__search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fg-3); font-size: 14px; }
.hg-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--ff-mono); font-size: 10px; color: var(--fg-3);
  border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 4px;
  background: var(--bg-1);
}
.hg-topbar__sp { flex: 1; }
.hg-topbar__status { color: var(--fg-3); font-size: 10.5px; display: flex; align-items: center; gap: 8px; font-family: var(--ff-mono); }
.hg-statusdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-dim); }
.hg-topbar__user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 8px;
  border: 1px solid var(--line-1);
  background: var(--bg-0);
  cursor: pointer; transition: background .12s;
}
.hg-topbar__user:hover { background: var(--bg-2); }
.hg-topbar__user-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--acc), var(--acc-hi));
  color: white; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; font-family: var(--ff-mono);
}
.hg-topbar__user-name { font-size: 12px; font-weight: 600; line-height: 1.1; color: var(--fg-0); }
.hg-topbar__user-role { font-size: 10px; color: var(--fg-3); line-height: 1.1; font-family: var(--ff-mono); }

/* ===== Main / Page ===== */
.hg-main { min-height: calc(100vh - var(--topbar-h)); padding: 0; }
.hg-pagehdr {
  display: flex; align-items: end; justify-content: space-between;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--line-1);
  background: var(--bg-1);
  gap: 24px;
}
.hg-crumbs { color: var(--fg-3); font-size: 11px; font-family: var(--ff-mono); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 4px; }
.hg-crumbs .sep { color: var(--line-2); margin: 0 6px; }
.hg-pagehdr h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.02em; color: var(--fg-0); }
.hg-pagehdr p  { color: var(--fg-2); font-size: 12px; margin: 3px 0 0; }
.hg-page { padding: 20px 28px 36px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: 10px;
  color: var(--fg-0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.card-header {
  background: var(--bg-0);
  border-bottom: 1px solid var(--line-1);
  padding: 11px 16px;
  font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  border-radius: 10px 10px 0 0;
}
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

/* KPI tile */
.hg-kpi {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow .15s;
}
.hg-kpi:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.hg-kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--line-2); border-radius: 10px 10px 0 0; }
.hg-kpi--acc::before    { background: linear-gradient(90deg, var(--acc), var(--acc-lo)); }
.hg-kpi--ok::before     { background: var(--ok); }
.hg-kpi--warn::before   { background: var(--warn); }
.hg-kpi--danger::before { background: var(--danger); }
.hg-kpi--info::before   { background: var(--info); }
.hg-kpi__lbl { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); display: flex; align-items: center; gap: 6px; }
.hg-kpi__val { font-family: var(--ff-mono); font-size: 28px; font-weight: 700; line-height: 1.15; margin-top: 6px; color: var(--fg-0); font-variant-numeric: tabular-nums; }
.hg-kpi__sub { font-family: var(--ff-mono); font-size: 11px; color: var(--fg-3); margin-top: 4px; }

/* ===== Formularios ===== */
.form-control, .form-select {
  background: var(--bg-input);
  border: 1px solid var(--line-2);
  color: var(--fg-0);
  font-family: var(--ff-mono);
  font-size: 12.5px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  transition: border-color .15s, box-shadow .15s;
}
textarea.form-control { height: auto; min-height: 64px; padding: 8px 10px; font-family: var(--ff-ui); }
.form-control:focus, .form-select:focus {
  background: var(--bg-1);
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-dim);
  color: var(--fg-0); outline: none;
}
.form-control::placeholder { color: var(--fg-3); }
.form-control[readonly] { background: var(--bg-2); color: var(--fg-2); }
.form-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--fg-2); font-family: var(--ff-mono); margin-bottom: 5px; font-weight: 600; }
.form-label .req { color: var(--danger); }
.form-text { color: var(--fg-3); font-family: var(--ff-mono); font-size: 11px; margin-top: 4px; }

/* ===== Botones ===== */
.btn {
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  height: 34px;
  padding: 0 14px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--fg-1);
  transition: background .12s, border-color .12s, box-shadow .12s;
  cursor: pointer;
}
.btn:hover { background: var(--bg-2); border-color: var(--line-3); color: var(--fg-0); }
.btn-primary { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; box-shadow: 0 2px 6px var(--acc-bdr); }
.btn-primary:hover { background: var(--acc-hi); border-color: var(--acc-hi); color: #fff; box-shadow: 0 4px 12px var(--acc-bdr); }
.btn-outline-secondary, .btn-light { background: var(--bg-0); border-color: var(--line-2); color: var(--fg-2); }
.btn-outline-secondary:hover, .btn-light:hover { background: var(--bg-2); color: var(--fg-0); border-color: var(--line-3); }
.btn-danger { background: transparent; color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: var(--danger-dim); border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 6px; }
.btn-lg { height: 40px; font-size: 13px; border-radius: 8px; }
.btn-check:checked + .btn-outline-secondary { background: var(--acc-dim); border-color: var(--acc-bdr); color: var(--acc-hi); }

/* ===== Tablas / DataTables ===== */
table.dataTable, .table {
  color: var(--fg-0);
  border-collapse: separate !important;
  border-spacing: 0;
  font-size: 12px; margin: 0;
}
table.dataTable thead th, .table thead th {
  background: var(--bg-0);
  font-family: var(--ff-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line-2);
  padding: 9px 12px;
  white-space: nowrap;
}
table.dataTable tbody td, .table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-1);
  color: var(--fg-1);
  white-space: nowrap;
  background: transparent;
}
table.dataTable tbody tr:hover td, .table tbody tr:hover td { background: var(--bg-0); color: var(--fg-0); }
table.dataTable tbody tr.selected td { background: var(--acc-dim) !important; }
.table .num, .table .text-end { text-align: right; font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
td.mono, th.mono { font-family: var(--ff-mono); }

/* DataTables wrappers */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { color: var(--fg-2); font-family: var(--ff-mono); font-size: 11.5px; padding: 8px 14px; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--bg-0); border: 1px solid var(--line-2);
  color: var(--fg-0); border-radius: 6px; padding: 4px 10px; font-family: var(--ff-mono);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: transparent !important; border: 1px solid var(--line-2) !important;
  color: var(--fg-2) !important; border-radius: 6px; margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--acc) !important; color: #fff !important; border-color: var(--acc) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--bg-2) !important; color: var(--fg-0) !important; }

/* ===== Chips ===== */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px;
  font-family: var(--ff-mono); font-size: 10.5px;
  letter-spacing: 0.04em; font-weight: 500;
}
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.chip-in        { background: var(--ok-dim);      color: var(--ok); }
.chip-out       { background: var(--danger-dim);   color: var(--danger); }
.chip-adj       { background: var(--info-dim);     color: var(--info); }
.chip-trans     { background: var(--warn-dim);     color: var(--warn); }
.chip-ok        { background: var(--ok-dim);       color: var(--ok); }
.chip-low       { background: var(--warn-dim);     color: var(--warn); }
.chip-crit      { background: var(--danger-dim);   color: var(--danger); }
.chip-neutral   { background: var(--bg-2);         color: var(--fg-2); border: 1px solid var(--line-2); }
.chip-disponible { background: var(--ok-dim);      color: var(--ok); }
.chip-reservado  { background: var(--warn-dim);    color: var(--warn); }
.chip-despachado { background: var(--bg-2);        color: var(--fg-2); border: 1px solid var(--line-2); }
.chip-observado  { background: var(--danger-dim);  color: var(--danger); }
.qty-in  { color: var(--ok); font-weight: 700; font-family: var(--ff-mono); }
.qty-out { color: var(--danger); font-weight: 700; font-family: var(--ff-mono); }

/* ===== Autocomplete dropdown ===== */
.hg-ac { position: relative; }
.hg-ac__pop {
  position: absolute; top: 100%; left: 0; right: 0;
  margin-top: 4px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  max-height: 280px; overflow-y: auto;
  z-index: 1050;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}
.hg-ac__item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-1);
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center;
  transition: background .1s;
}
.hg-ac__item:last-child { border: 0; }
.hg-ac__item:hover, .hg-ac__item.active { background: var(--bg-0); }
.hg-ac__item .code { font-family: var(--ff-mono); font-size: 11.5px; color: var(--acc); font-weight: 600; }
.hg-ac__item .name { font-size: 12.5px; color: var(--fg-0); }
.hg-ac__item .meta { font-family: var(--ff-mono); font-size: 10.5px; color: var(--fg-3); text-align: right; }
.hg-ac__empty { padding: 16px 12px; text-align: center; font-family: var(--ff-mono); font-size: 12px; color: var(--fg-3); }
mark { background: var(--acc-dim); color: var(--acc-hi); border-radius: 2px; padding: 0 2px; font-style: normal; }

/* ===== SweetAlert overrides (light) ===== */
.swal2-popup {
  background: var(--bg-1) !important;
  color: var(--fg-0) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 12px !important;
  font-family: var(--ff-ui) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15) !important;
}
.swal2-title { color: var(--fg-0) !important; font-weight: 700 !important; }
.swal2-html-container { color: var(--fg-2) !important; }
.swal2-confirm { background: var(--acc) !important; color: #fff !important; border-radius: 7px !important; }
.swal2-cancel  { background: var(--bg-2) !important; color: var(--fg-1) !important; border-radius: 7px !important; }

/* ===== Modal overrides ===== */
.modal-content { background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px; color: var(--fg-0); box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.modal-header  { border-bottom: 1px solid var(--line-1); padding: 16px 20px; background: var(--bg-0); border-radius: 12px 12px 0 0; }
.modal-footer  { border-top: 1px solid var(--line-1); background: var(--bg-0); border-radius: 0 0 12px 12px; }
.modal-title   { font-size: 15px; font-weight: 700; color: var(--fg-0); }
.modal-body    { padding: 20px; }
.btn-close     { opacity: 0.5; }
.btn-close:hover { opacity: 1; }

/* Dropzone */
.hg-dropzone {
  border: 2px dashed var(--line-2);
  border-radius: 10px; padding: 32px 20px;
  text-align: center; background: var(--bg-0);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.hg-dropzone:hover, .hg-dropzone.is-over { border-color: var(--acc); background: var(--acc-dim); }
.hg-dropzone i { font-size: 36px; color: var(--acc); }

/* Material image placeholder */
.hg-matimg {
  width: 100%; aspect-ratio: 1;
  background: repeating-linear-gradient(45deg, var(--bg-2) 0 8px, var(--bg-3) 8px 16px);
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--ff-mono); font-size: 10.5px;
  color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.08em;
}

/* Inventario stats */
.hg-inv-stat {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: 10px; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.hg-inv-stat i { font-size: 28px; color: var(--acc); opacity: .7; }
.hg-inv-stat__val { font-family: var(--ff-mono); font-size: 22px; font-weight: 700; }
.hg-inv-stat__lbl { font-size: 10.5px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .06em; font-family: var(--ff-mono); }

/* Columna ubicacion */
.col-ubicacion { font-size: 11.5px; font-family: var(--ff-mono); color: var(--info); }

/* Responsive */
@media (max-width: 992px) {
  body { padding-left: 0; }
  .hg-sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: none; }
  .hg-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.12); }
  .hg-topbar { left: 0; }
  .hg-topbar__status { display: none; }
  .hg-pagehdr { padding: 14px 16px 12px; }
  .hg-page { padding: 14px 16px 24px; }
}
/* ============================================================
   HG · ERP — Badge del módulo activo (v3)
   Reemplaza .hg-module-bar — agregar al final de app.css
============================================================ */

/* Ocultar la barra anterior si existía */
.hg-module-bar { display: none !important; }

/* Badge del módulo actual */
.hg-module-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  margin: 0;
  background: linear-gradient(135deg, var(--acc) 0%, var(--acc-hi) 100%);
  color: #fff;
  border-bottom: 1px solid var(--line-1);
}
.hg-module-badge i {
  font-size: 22px;
  opacity: 0.95;
}
.hg-module-badge span {
  font-family: var(--ff-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
/* ============================================================
   HG · ERP — Fix v3 (scroll modal + ajustes)
   Agregar al final de assets/css/app.css
============================================================ */

/* ── Fix scroll en modal de permisos ──────────────────────── */
.modal-dialog-scrollable {
  max-height: 90vh;
}
.modal-dialog-scrollable .modal-content {
  max-height: 90vh;
}
.modal-dialog-scrollable .modal-body {
  overflow-y: auto !important;
  max-height: calc(90vh - 130px);
  scroll-behavior: smooth;
}

/* Mejorar checkboxes de permisos (más anchos y clickeables) */
#formPerms label {
  min-width: 200px;
  transition: background .12s, border-color .12s;
}
#formPerms label:hover {
  background: var(--bg-0) !important;
  border-color: var(--acc) !important;
}
#formPerms input[type="checkbox"]:checked + span {
  color: var(--acc-hi);
  font-weight: 600;
}

/* ── Perfil de Inventario PT ──────────────────────────────── */
.inv-prof {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}
@media (max-width: 992px) {
  .inv-prof { grid-template-columns: 1fr; }
}
.inv-prof__img {
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.inv-prof__img img { width: 100%; height: 100%; object-fit: contain; }
.inv-prof__img-placeholder {
  text-align: center;
  color: var(--fg-3);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.inv-prof__img-placeholder i { font-size: 48px; display: block; margin-bottom: 8px; }

.inv-prof__croquis {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px;
  margin-top: 14px;
  position: relative;
  min-height: 200px;
}
.inv-prof__croquis-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.inv-prof__croquis-img {
  width: 100%;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line-1);
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--fg-3);
  font-family: var(--ff-mono);
  font-size: 11px;
  position: relative;
}
.inv-prof__croquis-img img { max-width: 100%; max-height: 320px; }
.inv-prof__croquis-marker {
  position: absolute;
  width: 18px; height: 18px;
  background: var(--danger);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(220,38,38,.25);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220,38,38,.25); }
  50%      { box-shadow: 0 0 0 8px rgba(220,38,38,.10); }
}

/* ── KPIs de inventario en perfil ────────────────────────── */
.inv-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.inv-kpi-grid > .hg-kpi { padding: 12px 14px; }
.inv-kpi-grid > .hg-kpi .hg-kpi__val { font-size: 22px; }

/* ── Requerimientos ───────────────────────────────────────── */
.req-priority-baja     { background: #e0e7ff; color: #4338ca; }
.req-priority-normal   { background: var(--info-dim); color: var(--info); }
.req-priority-alta     { background: var(--warn-dim); color: var(--warn); }
.req-priority-urgente  { background: var(--danger-dim); color: var(--danger); }
.req-estado-borrador   { background: var(--bg-3); color: var(--fg-2); }
.req-estado-pendiente  { background: var(--warn-dim); color: var(--warn); }
.req-estado-aprobado   { background: var(--ok-dim); color: var(--ok); }
.req-estado-rechazado  { background: var(--danger-dim); color: var(--danger); }
.req-estado-completado { background: var(--info-dim); color: var(--info); }
