:root {
  --brand: #00a1fe;
  --brand-dark: #007fca;
  --brand-soft: #e8f7ff;
  --ink: #172230;
  --muted: #6e7a88;
  --muted-2: #9aa5b1;
  --line: #e8edf2;
  --surface: #ffffff;
  --canvas: #f5f8fb;
  --success: #1d9b68;
  --success-soft: #e8f7ef;
  --warning: #d47c13;
  --warning-soft: #fff5e5;
  --danger: #c64c55;
  --danger-soft: #fff0f0;
  --purple: #7769d8;
  --purple-soft: #f1efff;
  --shadow: 0 12px 28px rgba(31, 53, 72, 0.06);
  --radius: 14px;
}

/* Etiqueta asociada al registro */
.asset-label-highlight { display: grid; gap: 8px; margin-bottom: 20px; padding: 18px 20px; border-left: 4px solid var(--brand); background: var(--brand-soft); color: var(--ink); }
.asset-label-caption { color: var(--brand-dark); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.asset-label-code { font-family: ui-monospace, monospace; font-size: 32px; line-height: 1.2; letter-spacing: 0; overflow-wrap: anywhere; }

/* Navegación y mantenimiento */
.nav-group { display: grid; gap: 3px; }
.nav-group-label { display: flex; align-items: center; justify-content: space-between; padding: 13px 13px 4px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.nav-group-label .nav-count { color: #89621c; background: #fff4d7; }
.nav-subitem { min-height: 38px; padding-left: 27px; font-size: 12px; font-weight: 600; }
.nav-subitem .nav-icon { font-size: 15px; }
.panel-heading-actions { display: flex; align-items: center; gap: 10px; }
.stock-row { position: relative; }
.stock-row .table-action { flex: 0 0 auto; }
.movement-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.movement-filters input, .movement-filters select { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 0 9px; font: inherit; font-size: 11px; }
.movement-filters input[type="search"] { min-width: 190px; }
.maintenance-grid { align-items: start; }
.maintenance-help { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 18px 20px; }
.maintenance-help h2 { margin: 0 0 5px; font-size: 16px; }
.maintenance-help p { margin: 0; }
.tiny-button { min-height: 29px; padding: 0 8px; font-size: 10px; }
.inactive-badge { display: inline-block; color: #8c641b; background: #fff3d2; border-radius: 999px; padding: 2px 5px; font-size: 9px; font-weight: 700; vertical-align: middle; }
.is-inactive { opacity: .68; }
.maintenance-zone-list { display: grid; gap: 8px; padding: 10px 0 0 26px; }
.maintenance-zone-item { border-top: 1px solid #edf1f3; padding-top: 9px; }
.maintenance-zone-item > div:first-child, .maintenance-place-item { display: flex; align-items: center; gap: 8px; }
.maintenance-zone-item > div:first-child > div:first-child, .maintenance-place-item > div { flex: 1; min-width: 0; }
.maintenance-zone-item strong, .maintenance-zone-item small, .maintenance-place-item strong, .maintenance-place-item small { display: block; }
.maintenance-zone-item strong, .maintenance-place-item strong { font-size: 11px; }
.maintenance-zone-item small, .maintenance-place-item small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.maintenance-place-list { display: grid; gap: 5px; padding: 7px 0 0 22px; }
.maintenance-place-item { border: 1px solid #edf1f3; border-radius: 7px; padding: 7px; background: #fff; }
.maintenance-place-item > span { width: 22px; color: var(--brand-dark); text-align: center; }

@media (max-width: 720px) {
  .movement-filters { justify-content: stretch; }
  .movement-filters input, .movement-filters select { width: 100%; min-width: 0; }
  .maintenance-help { display: grid; }
  .maintenance-help .button { justify-self: start; }
}

/* Acceso ficticio de demostración · versión 1.3 */
.app-frame.app-locked { display: none; }
.login-shell[hidden] { display: none; }
.login-shell { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(360px, 510px) minmax(300px, 470px); align-items: stretch; justify-content: center; gap: clamp(32px, 6vw, 88px); padding: clamp(26px, 5vw, 72px); background: linear-gradient(135deg, #f5f8fb 0%, #eef8fd 100%); }
.login-card { align-self: center; width: 100%; padding: clamp(28px, 4vw, 46px); border: 1px solid rgba(208, 222, 232, .9); border-radius: 22px; background: rgba(255, 255, 255, .96); box-shadow: 0 22px 55px rgba(31, 53, 72, .10); }
.login-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: -.1px; }
.login-logo { width: 112px; height: auto; display: block; }
.login-brand-divider { width: 1px; height: 19px; background: #dfe8ee; }
.login-card-heading { margin: 54px 0 26px; }
.login-card-heading h1 { margin: 0 0 9px; color: var(--ink); font-size: clamp(30px, 4vw, 42px); line-height: 1.05; letter-spacing: -1.4px; }
.login-card-heading p:not(.eyebrow) { max-width: 375px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-form { display: grid; gap: 17px; }
.login-field { display: grid; gap: 7px; }
.login-field label { color: var(--ink); font-size: 12px; font-weight: 800; }
.login-field input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #dce6ec; border-radius: 9px; outline: none; color: var(--ink); background: #fff; font: inherit; font-size: 13px; transition: border-color .18s ease, box-shadow .18s ease; }
.login-field input::placeholder { color: #a5b0b9; }
.login-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 161, 254, .13); }
.login-field input.input-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(198, 76, 85, .10); }
.password-field { position: relative; }
.password-field input { padding-right: 80px; }
.password-toggle { position: absolute; top: 50%; right: 10px; min-height: 30px; padding: 0 8px; transform: translateY(-50%); border: 0; border-radius: 6px; color: var(--brand-dark); background: transparent; cursor: pointer; font: inherit; font-size: 11px; font-weight: 800; }
.password-toggle:hover, .password-toggle:focus-visible { background: var(--brand-soft); outline: none; }
.login-message { min-height: 0; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.4; }
.login-message[hidden] { display: none; }
.login-message.error { color: #9f3741; background: var(--danger-soft); }
.login-message.success { color: #18734f; background: var(--success-soft); }
.login-submit { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border: 0; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 800; }
.login-submit:disabled { cursor: wait; opacity: .82; }
.login-submit.is-loading { background: var(--brand-dark); }
.login-demo-note { display: flex; align-items: flex-start; gap: 8px; margin: 22px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.login-demo-note code { color: var(--brand-dark); font-family: 'Cascadia Mono', Consolas, monospace; font-size: 10px; }
.login-demo-dot { width: 7px; height: 7px; flex: 0 0 7px; margin-top: 5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.login-aside { align-self: center; max-width: 405px; padding: 14px 0; color: var(--ink); }
.login-aside-mark { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 31px; border-radius: 16px; color: #fff; background: var(--brand); box-shadow: 0 10px 22px rgba(0, 161, 254, .23); font-size: 28px; }
.login-aside h2 { max-width: 380px; margin: 0 0 14px; font-size: clamp(31px, 4.6vw, 51px); line-height: 1.03; letter-spacing: -2px; }
.login-aside > p:not(.eyebrow) { max-width: 350px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.login-aside-stats { display: flex; gap: 34px; margin-top: 42px; padding-top: 22px; border-top: 1px solid rgba(180, 204, 216, .75); }
.login-aside-stats div { display: grid; gap: 4px; }
.login-aside-stats strong { color: var(--brand-dark); font-size: 24px; line-height: 1; }
.login-aside-stats span { color: var(--muted); font-size: 11px; }
.login-prototype-label { display: inline-flex; align-items: center; gap: 8px; margin-top: 42px; color: var(--muted); font-size: 11px; font-weight: 800; }
.login-prototype-label .status-dot { width: 7px; height: 7px; }
@media (max-width: 860px) {
  .login-shell { grid-template-columns: minmax(320px, 510px); padding: 24px; }
  .login-aside { display: none; }
}
@media (max-width: 480px) {
  .login-shell { display: block; padding: 16px; }
  .login-card { min-height: calc(100vh - 32px); min-height: calc(100svh - 32px); display: flex; flex-direction: column; justify-content: center; padding: 25px 21px; border-radius: 16px; }
  .login-card-heading { margin-top: 44px; }
  .login-demo-note { margin-top: 19px; }
}

.maintenance-tree-actions { flex-wrap: wrap; justify-content: flex-end; }
.maintenance-node-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.maintenance-node-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.maintenance-node-title > div { min-width: 0; }
.maintenance-node-title strong, .maintenance-node-title small { display: block; }
.maintenance-node-title strong { font-size: 12px; }
.maintenance-node-title small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.tree-toggle { width: 24px; height: 24px; flex: 0 0 24px; padding: 0; border: 1px solid #dfe8ee; border-radius: 7px; background: #fff; color: var(--brand-dark); font-size: 15px; line-height: 1; }
.tree-toggle:hover, .tree-toggle:focus-visible { background: var(--brand-soft); border-color: #a8defa; outline: none; }
.maintenance-child-list { margin-left: 18px; }
.maintenance-zone-item .maintenance-node-head { padding-bottom: 2px; }
.maintenance-zone-item .maintenance-node-title strong { font-size: 11px; }

@media (max-width: 720px) {
  .maintenance-tree-actions { justify-content: flex-start; }
  .maintenance-node-head { align-items: flex-start; }
  .maintenance-node-head .catalog-actions { flex-wrap: wrap; justify-content: flex-end; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: 'Myriad Pro', 'Segoe UI', Inter, Arial, sans-serif; font-size: 14px; line-height: 1.45; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

.app-frame { min-height: 100vh; }
.topbar { height: 76px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-width: 260px; }
.brand-logo { display: block; width: 118px; height: auto; }
.brand-divider { height: 26px; width: 1px; background: var(--line); }
.brand-product { font-weight: 600; letter-spacing: -0.2px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.prototype-badge { background: #f0f5f8; border-radius: 999px; padding: 8px 12px; color: #657281; font-size: 12px; font-weight: 600; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: 7px; vertical-align: 1px; }
.avatar-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf8fe; color: var(--brand-dark); font-weight: 700; }
.icon-button { border: 0; background: transparent; color: var(--ink); }
.mobile-menu-button { display: none; font-size: 22px; }

.workspace { display: flex; min-height: calc(100vh - 76px); }
.sidebar { width: 250px; background: var(--surface); border-right: 1px solid var(--line); padding: 28px 16px 20px; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-heading { color: #a1acb8; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; padding: 0 13px 11px; }
.main-nav { display: grid; gap: 4px; }
.nav-item { border: 0; background: transparent; border-radius: 10px; min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 0 13px; color: #667382; text-align: left; font-weight: 600; position: relative; width: 100%; }
.nav-item:hover { background: #f5f9fc; color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.nav-item.active::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0; background: var(--brand); }
.nav-icon { width: 19px; text-align: center; font-size: 18px; font-weight: 400; }
.nav-count { margin-left: auto; font-size: 11px; color: #84909c; background: #f3f6f8; border-radius: 999px; padding: 2px 7px; }
.phase-nav { color: #8b96a2; }
.phase-pill { margin-left: auto; border: 1px solid #dce5ec; color: #94a0ac; border-radius: 5px; font-size: 10px; padding: 2px 5px; font-weight: 700; }
.sidebar-section-spacer { height: 34px; }
.sidebar-footer { background: #f6f9fb; border-radius: 12px; margin: auto 4px 0; padding: 15px 13px; display: grid; gap: 4px; }
.sidebar-footer-label { color: var(--brand-dark); font-size: 10px; font-weight: 700; letter-spacing: .9px; }
.sidebar-footer strong { font-size: 13px; }
.sidebar-footer span { color: var(--muted); font-size: 11px; }

.main-content { width: 100%; max-width: 1550px; padding: 38px 52px 64px; margin: 0 auto; overflow: hidden; }
.view { display: none; animation: fade-in .22s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 30px; }
.overview-header { align-items: center; }
.eyebrow { margin: 0 0 7px; color: var(--brand-dark); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(28px, 3vw, 36px); letter-spacing: -1px; line-height: 1.12; margin-bottom: 8px; }
h2 { font-size: 17px; letter-spacing: -.3px; margin-bottom: 0; }
.page-description { color: var(--muted); margin: 0; font-size: 15px; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.button { border: 1px solid transparent; border-radius: 9px; min-height: 41px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; transition: .18s ease; white-space: nowrap; }
.button.primary { background: var(--brand); color: #fff; box-shadow: 0 5px 12px rgba(0, 161, 254, .18); }
.button.primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button.secondary { background: var(--surface); color: #4f5f6d; border-color: #dce5eb; }
.button.secondary:hover { border-color: #b8cbd7; background: #f9fcfd; }
.button.danger { color: var(--danger); border-color: #f4cfd2; background: var(--danger-soft); }
.button-icon { font-size: 16px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 145px; padding: 21px 22px; box-shadow: var(--shadow); }
.kpi-card.accent-card { background: var(--brand); color: #fff; border-color: var(--brand); }
.kpi-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.accent-card .kpi-label { color: rgba(255,255,255,.78); }
.kpi-icon { width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--brand-dark); background: var(--brand-soft); font-size: 15px; }
.kpi-icon.neutral { background: #f1f4f6; color: #7e8a95; }
.kpi-icon.green { background: var(--success-soft); color: var(--success); }
.kpi-icon.orange { background: var(--warning-soft); color: var(--warning); }
.accent-card .kpi-icon { background: rgba(255,255,255,.17); color: #fff; }
.kpi-value { font-size: 36px; font-weight: 700; line-height: 1; margin: 19px 0 9px; letter-spacing: -1.4px; }
.kpi-meta { color: var(--muted); font-size: 11px; }
.kpi-meta span { color: var(--muted-2); }
.kpi-meta.positive { color: var(--success); font-weight: 700; }
.kpi-meta.warning { color: var(--warning); }
.accent-card .kpi-meta { color: rgba(255,255,255,.9); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr); gap: 22px; margin-bottom: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.alert-panel, .activity-panel { padding: 23px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
.compact-heading { margin-bottom: 18px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-heading-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; }
.warning-bg { color: var(--warning); background: var(--warning-soft); }
.stock-list { display: grid; gap: 11px; margin-bottom: 17px; }
.stock-row { display: flex; align-items: center; gap: 11px; min-height: 48px; }
.stock-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; color: var(--brand-dark); background: var(--brand-soft); font-size: 17px; }
.stock-row:nth-child(2) .stock-icon { color: var(--purple); background: var(--purple-soft); }
.stock-row:nth-child(3) .stock-icon { color: var(--warning); background: var(--warning-soft); }
.stock-name { flex: 1; min-width: 0; }
.stock-name strong { display: block; font-size: 13px; }
.stock-name small { display: block; color: var(--muted); margin-top: 1px; font-size: 11px; }
.stock-count { font-size: 12px; font-weight: 700; text-align: right; }
.stock-count small { display: block; color: var(--muted); font-weight: 400; margin-top: 1px; }
.text-button { border: 0; background: transparent; color: var(--brand-dark); padding: 0; font-weight: 700; font-size: 12px; }
.text-button:hover { text-decoration: underline; }
.text-button span { margin-left: 6px; }
.activity-list { display: grid; gap: 2px; }
.activity-item { display: grid; grid-template-columns: 31px minmax(0,1fr) auto; gap: 11px; align-items: start; padding: 8px 0; }
.activity-icon { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; }
.activity-item:nth-child(2) .activity-icon { background: var(--success-soft); color: var(--success); }
.activity-item:nth-child(3) .activity-icon { background: var(--purple-soft); color: var(--purple); }
.activity-item:nth-child(4) .activity-icon { background: var(--warning-soft); color: var(--warning); }
.activity-copy strong { display: block; font-size: 12px; font-weight: 700; }
.activity-copy span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.activity-time { color: var(--muted-2); font-size: 10px; white-space: nowrap; padding-top: 2px; }
.quick-panel { padding: 22px 23px 19px; }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-action { border: 1px solid #edf1f4; background: #fbfcfd; border-radius: 10px; display: flex; align-items: center; gap: 11px; padding: 13px 12px; text-align: left; color: var(--ink); min-width: 0; }
.quick-action:hover { border-color: #bfe8fb; background: #f7fcff; }
.quick-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.quick-icon.blue { color: var(--brand-dark); background: var(--brand-soft); }
.quick-icon.purple { color: var(--purple); background: var(--purple-soft); }
.quick-icon.orange { color: var(--warning); background: var(--warning-soft); }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: 12px; }
.quick-action small { color: var(--muted); font-size: 10px; margin-top: 3px; white-space: nowrap; }
.quick-arrow { color: var(--muted-2); margin-left: auto; font-size: 18px; }

.filter-panel { padding: 16px; margin-bottom: 15px; }
.search-field { height: 44px; display: flex; align-items: center; gap: 10px; background: #f8fafb; border: 1px solid #e7edf1; border-radius: 8px; padding: 0 12px; }
.search-icon { font-size: 21px; color: var(--muted); line-height: 1; }
.search-field input { border: 0; background: transparent; outline: none; width: 100%; color: var(--ink); font-size: 13px; }
.search-field input::placeholder { color: #9aa6b2; }
kbd { border: 1px solid #dce5eb; border-radius: 4px; background: #fff; color: #8995a1; font-size: 10px; padding: 2px 5px; }
.filter-row { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)) auto; gap: 10px; margin-top: 12px; align-items: end; }
.filter-row label { display: grid; gap: 5px; }
.filter-row label span { color: var(--muted); font-size: 10px; font-weight: 700; }
select { color: var(--ink); background: #fff; border: 1px solid #dfe7ec; border-radius: 7px; min-height: 37px; padding: 0 10px; outline: none; }
select:focus, input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,161,254,.12); }
.clear-filters { border: 0; color: var(--brand-dark); background: transparent; font-size: 11px; font-weight: 700; padding: 0 4px 9px; white-space: nowrap; }
.clear-filters:hover { text-decoration: underline; }
.inventory-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 12px 2px; }
.muted { color: var(--muted); }
.inventory-toolbar .muted, .label-toolbar .muted { font-size: 12px; }
.view-toggle { border: 1px solid #dfe7ec; background: #fff; color: var(--brand-dark); border-radius: 7px; height: 30px; width: 32px; font-size: 18px; }
.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 850px; }
th { color: #87939e; font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; text-align: left; height: 46px; padding: 0 17px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 17px; border-bottom: 1px solid #eef2f5; vertical-align: middle; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.inventory-table tbody tr:hover, .movement-table tbody tr:hover { background: #fbfdfe; }
.inventory-table tbody tr { cursor: pointer; }
.asset-cell { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.asset-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--brand-dark); background: var(--brand-soft); font-size: 18px; flex-shrink: 0; }
.asset-icon.screen { color: var(--purple); background: var(--purple-soft); }
.asset-icon.print { color: var(--warning); background: var(--warning-soft); }
.asset-icon.mobile { color: #c45c91; background: #fff0f7; }
.asset-icon.accessory { color: #607d9c; background: #edf4fb; }
.asset-cell strong { display: block; font-size: 12px; }
.asset-cell small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 5px 9px; white-space: nowrap; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-assigned { color: var(--brand-dark); background: var(--brand-soft); }
.status-available, .status-stock { color: var(--success); background: var(--success-soft); }
.status-repair { color: var(--warning); background: var(--warning-soft); }
.status-retired { color: var(--danger); background: var(--danger-soft); }
.status-location { color: #5f6e7a; }
.person-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.person-avatar { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: #edf8fe; color: var(--brand-dark); font-size: 10px; font-weight: 700; }
.person-empty { color: var(--muted-2); }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; opacity: .2; transition: .15s ease; }
tr:hover .row-actions { opacity: 1; }
.table-action { width: 28px; height: 28px; border: 1px solid #e0e7ec; color: #697885; background: #fff; border-radius: 6px; }
.table-action:hover { color: var(--brand-dark); border-color: #acdff5; }
.empty-state { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 5px; color: var(--muted); }
.empty-state strong { color: var(--ink); }
.empty-icon { color: var(--brand); font-size: 30px; }

.location-summary, .movement-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 22px; }
.summary-chip { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 11px; padding: 15px 18px; display: flex; align-items: center; gap: 11px; }
.summary-chip-icon { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; color: var(--brand-dark); background: var(--brand-soft); font-size: 18px; }
.summary-chip-icon.green { color: var(--success); background: var(--success-soft); }
.summary-chip-icon.purple { color: var(--purple); background: var(--purple-soft); }
.summary-chip strong, .summary-chip small { display: block; }
.summary-chip strong { font-size: 20px; line-height: 1; }
.summary-chip small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.location-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.location-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.location-card-head { display: flex; align-items: center; gap: 12px; padding: 19px 20px; border-bottom: 1px solid var(--line); }
.location-marker { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-size: 19px; }
.location-card:nth-child(2) .location-marker { color: var(--purple); background: var(--purple-soft); }
.location-card:nth-child(3) .location-marker { color: var(--warning); background: var(--warning-soft); }
.location-card:nth-child(4) .location-marker { color: var(--success); background: var(--success-soft); }
.location-card-head strong, .location-card-head span { display: block; }
.location-card-head strong { font-size: 14px; }
.location-card-head span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.location-card-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.location-assets { padding: 4px 20px 9px; }
.location-asset { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 45px; padding: 0; border: 0; border-bottom: 1px solid #f0f3f5; background: transparent; text-align: left; color: var(--ink); }
.location-asset:hover { background: #fbfdfe; }
.location-asset:last-child { border-bottom: 0; }
.location-asset-name { flex: 1; min-width: 0; }
.location-asset-name strong, .location-asset-name span { display: block; }
.location-asset-name strong { font-size: 11px; }
.location-asset-name span { color: var(--muted); font-size: 10px; margin-top: 1px; }
.location-asset-status { font-size: 10px; color: var(--muted); }

.movement-summary { grid-template-columns: repeat(4, 1fr); }
.movement-stat { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 16px 18px; display: grid; gap: 4px; box-shadow: var(--shadow); color: var(--muted); font-size: 11px; }
.stat-number { font-size: 23px; color: var(--ink); line-height: 1; font-weight: 700; }
.green-text { color: var(--success); }
.purple-text { color: var(--purple); }
.orange-text { color: var(--warning); }
.movement-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 20px; border-bottom: 1px solid var(--line); }
.movement-header h2 { margin-bottom: 4px; }
.movement-header select { min-height: 33px; font-size: 12px; }
.movement-type { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 11px; }
.movement-type .type-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.movement-type.asignacion { color: var(--brand-dark); }
.movement-type.asignacion .type-dot { background: var(--brand); }
.movement-type.traslado { color: var(--purple); }
.movement-type.traslado .type-dot { background: var(--purple); }
.movement-type.devolucion { color: var(--warning); }
.movement-type.devolucion .type-dot { background: var(--warning); }
.movement-type.alta { color: var(--success); }
.movement-type.alta .type-dot { background: var(--success); }
.movement-type.ajuste { color: #607d9c; }
.movement-type.ajuste .type-dot { background: #607d9c; }
.movement-type.baja { color: var(--danger); }
.movement-type.baja .type-dot { background: var(--danger); }

.label-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.label-size-select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.label-size-select select { min-height: 33px; font-size: 11px; }
.labels-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.print-label { background: #fff; border: 1px dashed #cfdbe2; border-radius: 10px; min-height: 190px; padding: 15px; display: flex; gap: 14px; align-items: center; position: relative; }
.print-label::after { content: 'DEMO'; position: absolute; top: 9px; right: 11px; color: #a8b4bc; font-size: 8px; font-weight: 700; letter-spacing: .7px; }
.label-logo { width: 73px; height: auto; position: absolute; left: 15px; top: 14px; opacity: .85; }
.label-details { padding-top: 28px; min-width: 0; }
.label-details .eyebrow { font-size: 8px; margin-bottom: 4px; }
.label-code { font-size: 17px; letter-spacing: .4px; margin-bottom: 3px; }
.label-details p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.label-details .label-status { display: inline-block; margin-top: 9px; font-size: 9px; color: var(--brand-dark); background: var(--brand-soft); padding: 4px 6px; border-radius: 4px; font-weight: 700; }

.phase2-page { max-width: 620px; margin: 70px auto; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 50px 40px; }
.phase2-mark { width: 52px; height: 52px; border-radius: 16px; background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; font-weight: 800; font-size: 19px; margin: 0 auto 23px; }
.phase2-page .eyebrow { color: var(--purple); }
.phase2-page h1 { margin-bottom: 13px; }
.phase2-page p:not(.eyebrow) { color: var(--muted); font-size: 15px; margin: 0 auto 25px; max-width: 480px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(23,34,48,.43); z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal { background: #fff; width: min(620px, 100%); max-height: min(780px, calc(100vh - 36px)); overflow: auto; border-radius: 16px; box-shadow: 0 25px 70px rgba(15,32,45,.2); animation: modal-in .18s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { padding: 22px 24px 17px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 20px; margin-bottom: 4px; }
.modal-header p { color: var(--muted); font-size: 12px; margin: 0; }
.close-modal { width: 31px; height: 31px; background: #f5f8fa; color: #70808e; border: 0; border-radius: 8px; font-size: 20px; line-height: 1; }
.modal-body { padding: 21px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 24px 21px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { display: grid; gap: 6px; }
.form-field label, .form-field > span { color: #677582; font-size: 11px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid #dce5eb; border-radius: 7px; min-height: 38px; padding: 0 10px; outline: none; color: var(--ink); background: #fff; }
.form-field textarea { padding: 9px 10px; min-height: 74px; resize: vertical; }
.form-note { background: #f7fafc; border-radius: 8px; padding: 10px 12px; color: var(--muted); font-size: 11px; margin: 0 0 16px; }
.detail-top { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.detail-top .asset-icon { width: 48px; height: 48px; font-size: 24px; }
.detail-top strong { display: block; font-size: 18px; }
.detail-top span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 22px; }
.detail-item dt { color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.detail-item dd { margin: 0; font-size: 12px; font-weight: 600; }
.detail-section-title { font-size: 11px; font-weight: 700; color: var(--brand-dark); letter-spacing: .7px; text-transform: uppercase; margin: 23px 0 12px; }
.detail-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-actions .button { min-height: 39px; padding: 0 8px; font-size: 11px; }
.confirm-icon { width: 45px; height: 45px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); font-size: 24px; margin-bottom: 12px; }
.confirm-message { color: var(--muted); margin: 0; font-size: 13px; }
.confirm-body { padding-top: 26px; padding-bottom: 26px; }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 9px; width: min(350px, calc(100vw - 44px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: #1d2c3a; color: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 15px 35px rgba(12,25,36,.2); animation: toast-in .22s ease; font-size: 12px; }
.toast-success { color: #9df0c6; font-size: 17px; }
.toast p { margin: 2px 0 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .main-content { padding-left: 30px; padding-right: 30px; }
  .filter-row { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .clear-filters { justify-self: start; padding-bottom: 0; }
  .labels-sheet { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .topbar { padding: 0 18px; height: 68px; }
  .mobile-menu-button { display: block; margin-right: 8px; }
  .brand { min-width: 0; gap: 9px; }
  .brand-logo { width: 95px; }
  .brand-divider { display: none; }
  .brand-product { display: none; }
  .prototype-badge { display: none; }
  .workspace { min-height: calc(100vh - 68px); }
  .sidebar { position: fixed; z-index: 30; top: 68px; bottom: 0; left: 0; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 12px 0 24px rgba(16,39,55,.1); }
  .sidebar.open { transform: translateX(0); }
  .main-content { padding: 28px 20px 45px; }
  .page-header, .overview-header { align-items: flex-start; flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .location-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar-actions { gap: 0; }
  h1 { font-size: 29px; }
  .page-description { font-size: 13px; }
  .header-actions { width: 100%; }
  .header-actions .button { flex: 1; }
  .kpi-card { min-height: 128px; padding: 17px; }
  .kpi-value { font-size: 30px; margin-top: 16px; }
  .kpi-label { font-size: 11px; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-action small { white-space: normal; }
  .filter-panel { padding: 11px; }
  .filter-row { grid-template-columns: 1fr; }
  .filter-row label { width: 100%; }
  .inventory-toolbar { margin-top: 17px; }
  .location-summary, .movement-summary { grid-template-columns: 1fr; }
  .labels-sheet { grid-template-columns: 1fr; }
  .label-toolbar { align-items: flex-start; gap: 13px; flex-direction: column; }
  .movement-header { align-items: flex-start; flex-direction: column; }
  .movement-header select { width: 100%; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .detail-actions { grid-template-columns: 1fr; }
  .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .button { flex: 1; }
  .phase2-page { margin: 35px auto; padding: 35px 22px; }
}

/* Formulario técnico de equipos */
.asset-form-section { border: 1px solid var(--line); border-radius: 12px; padding: 17px; background: #fff; margin-bottom: 15px; }
.asset-form-section:last-child { margin-bottom: 0; }
.asset-form-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; padding-bottom: 13px; border-bottom: 1px solid #eef2f5; }
.asset-form-section-head .eyebrow { margin-bottom: 4px; }
.asset-form-section-head h3 { font-size: 15px; margin: 0; }
.form-section-note { color: var(--muted-2); font-size: 10px; padding-top: 3px; text-align: right; }
.form-help { color: var(--muted); font-size: 10px; line-height: 1.35; }
.form-field .form-help { margin-top: -2px; }
.technical-group { margin-top: 13px; padding: 14px; border: 1px solid #e8f0f5; border-radius: 10px; background: #fbfdfe; }
.technical-group h4 { margin: 0 0 13px; color: var(--ink); font-size: 13px; }
.technical-group.hidden { display: none; }
.technical-form-hint { margin: 0 0 12px; }
.detail-technical { margin-top: 3px; }
.detail-technical-section { border: 1px solid #edf2f5; border-radius: 10px; padding: 13px; margin-bottom: 10px; background: #fbfdfe; }
.detail-technical-section h4 { margin: 0 0 12px; font-size: 12px; color: var(--ink); }
.technical-detail-grid { gap: 12px 18px; }
.detail-observations { background: #f7fafc; border-radius: 9px; padding: 11px 12px; margin-top: 17px; }
.detail-observations strong { display: block; font-size: 11px; color: var(--brand-dark); margin-bottom: 4px; }
.detail-observations p { margin: 0; color: var(--muted); font-size: 12px; }

@media (max-width: 600px) {
  .asset-form-section { padding: 14px; }
  .asset-form-section-head { flex-direction: column; gap: 4px; }
  .form-section-note { text-align: left; }
  .technical-group { padding: 11px; }
}


/* Extensión del mockup: estructura física, mapa y configuración */
.config-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.config-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 11px 14px; font-weight: 700; font-size: 12px; }
.config-tab:hover { color: var(--ink); }
.config-tab.active { border-bottom-color: var(--brand); color: var(--brand-dark); }
.config-panel.hidden { display: none; }
.map-controls { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1.6fr; gap: 12px; align-items: end; padding: 14px; margin-bottom: 18px; }
.map-select { display: grid; gap: 5px; }
.map-select > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.map-select select { width: 100%; }
.map-legend { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11px; padding-bottom: 9px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b6c5cf; margin-right: 5px; }
.legend-dot.place { background: #9eacb7; }
.legend-dot.occupied { background: var(--brand); }
.legend-dot.shared { background: var(--warning); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .85fr); gap: 18px; align-items: start; }
.map-canvas { padding: 20px; min-height: 580px; overflow: hidden; }
.map-schematic-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 17px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.map-schematic-header h2 { margin: 0 0 3px; font-size: 18px; }
.map-schematic-header .eyebrow { margin-bottom: 5px; font-size: 9px; }
.small-button { min-height: 33px; padding: 0 10px; font-size: 11px; }
.map-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(175px, auto); gap: 12px; min-height: 390px; }
.map-zone { min-width: 0; border: 1px solid #dfe8ee; border-radius: 11px; padding: 12px; background: #fbfdfe; display: flex; flex-direction: column; gap: 10px; }
.map-zone.tone-purple { background: #fcfbff; border-color: #e4e1f7; }
.map-zone.tone-green { background: #fbfefc; border-color: #dcefe6; }
.map-zone.tone-orange { background: #fffdf9; border-color: #f1e5d2; }
.map-zone-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 1px solid rgba(120,145,160,.15); padding-bottom: 9px; }
.zone-kicker { display: block; color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .8px; margin-bottom: 2px; }
.map-zone-head strong, .map-zone-head small { display: block; }
.map-zone-head strong { font-size: 12px; }
.map-zone-head small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.map-zone-actions { display: flex; align-items: center; gap: 4px; color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.icon-small-button { width: 26px; height: 26px; border: 1px solid #dce6eb; color: #6f7e89; background: #fff; border-radius: 6px; font-size: 12px; display: inline-grid; place-items: center; }
.icon-small-button:hover { color: var(--brand-dark); border-color: #a6dff6; }
.map-place-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; align-content: start; }
.map-place { min-height: 57px; border: 1px solid #e2e9ee; background: #fff; border-radius: 8px; padding: 8px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: 7px; text-align: left; color: var(--ink); position: relative; }
.map-place:hover, .map-place.selected { border-color: #8bd7f7; background: #f2fbff; box-shadow: 0 4px 10px rgba(0,161,254,.08); }
.map-place.selected { outline: 2px solid rgba(0,161,254,.18); }
.map-place-icon { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; background: #f0f4f6; color: #687986; font-size: 14px; }
.map-place.selected .map-place-icon { color: var(--brand-dark); background: var(--brand-soft); }
.map-place-copy { min-width: 0; }
.map-place-copy strong, .map-place-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-place-copy strong { font-size: 10px; }
.map-place-copy small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.map-place-count { border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 9px; padding: 2px 5px; font-weight: 800; align-self: start; }
.map-equipment-list { position: absolute; right: 7px; bottom: -7px; display: flex; gap: 2px; }
.map-equipment { border: 1px solid #f3d7a9; background: #fff9ed; color: var(--warning); border-radius: 4px; padding: 2px 4px; font-size: 8px; font-weight: 800; z-index: 2; }
.map-equipment:hover { background: #fff2d5; }
.map-empty-zone, .map-empty-floor { color: var(--muted); font-size: 11px; text-align: center; padding: 25px 10px; grid-column: 1 / -1; }
.map-schematic-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; color: var(--muted); font-size: 10px; }
.place-detail { padding: 20px; min-height: 580px; }
.place-detail-empty { min-height: 500px; display: grid; place-items: center; align-content: center; text-align: center; gap: 5px; color: var(--muted); padding: 20px; }
.place-detail-empty strong { color: var(--ink); font-size: 14px; }
.place-detail-empty .empty-icon { font-size: 34px; }
.place-detail-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 15px; }
.place-detail-head h2 { font-size: 19px; margin-bottom: 3px; }
.place-detail-head > div > span { color: var(--muted); font-size: 11px; }
.close-inline { width: 28px; height: 28px; border: 0; border-radius: 7px; background: #f4f7f9; color: #758491; font-size: 18px; }
.place-facts { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px 15px; margin: 0; }
.place-facts dt { color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.place-facts dd { margin: 0; font-size: 11px; font-weight: 700; }
.place-detail-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 17px 0; }
.place-detail-actions .button { min-height: 35px; padding: 0 5px; font-size: 10px; }
.detail-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); font-size: 10px; margin-left: 4px; }
.place-assets-list { display: grid; gap: 5px; }
.place-asset-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid #edf1f3; background: #fbfcfd; border-radius: 7px; padding: 7px; text-align: left; color: var(--ink); }
.place-asset-row:hover { border-color: #b9e8fb; background: #f7fcff; }
.place-asset-row > span:nth-child(2) { flex: 1; min-width: 0; }
.place-asset-row strong, .place-asset-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-asset-row strong { font-size: 10px; }
.place-asset-row small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.place-asset-row > span:last-child { color: var(--muted-2); }
.small-copy { font-size: 11px; }
.incident-summary { display: grid; gap: 7px; }
.incident-row { display: flex; gap: 8px; align-items: flex-start; background: #fffaf1; border: 1px solid #f5e5c8; border-radius: 7px; padding: 8px; }
.incident-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); margin-top: 4px; flex-shrink: 0; }
.incident-row strong, .incident-row small { display: block; }
.incident-row strong { font-size: 10px; }
.incident-row small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.catalog-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 18px; }
.catalog-card { padding: 20px; }
.catalog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 7px; }
.catalog-head .eyebrow { margin-bottom: 4px; }
.office-config-item { border-bottom: 1px solid #eef2f4; padding: 15px 0; }
.office-config-item:last-child { border-bottom: 0; }
.office-config-head, .floor-config-head { display: flex; align-items: center; gap: 9px; }
.office-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }
.office-config-head > div:nth-child(2), .floor-config-head > div:nth-child(2) { flex: 1; min-width: 0; }
.office-config-head strong, .office-config-head small, .floor-config-head strong, .floor-config-head small { display: block; }
.office-config-head strong, .floor-config-head strong { font-size: 12px; }
.office-config-head small, .floor-config-head small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.catalog-actions { display: flex; gap: 4px; }
.floor-config-list { padding: 10px 0 0 43px; display: grid; gap: 11px; }
.floor-config-item { border-left: 2px solid #e8eef2; padding-left: 12px; }
.floor-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--purple); background: var(--purple-soft); border-radius: 6px; font-size: 12px; flex-shrink: 0; }
.zone-chip-list { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 0 0 33px; }
.zone-chip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #e1e8ed; border-radius: 999px; padding: 4px 5px 4px 8px; color: #5d6d79; font-size: 10px; background: #fbfcfd; }
.zone-chip button { border: 0; background: transparent; color: #8897a2; width: 17px; height: 17px; border-radius: 50%; padding: 0; }
.zone-chip button:hover { background: var(--brand-soft); color: var(--brand-dark); }
.category-config-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef2f4; }
.category-config-row:last-child { border-bottom: 0; }
.category-config-icon { width: 29px; height: 29px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.category-config-row:nth-child(2n) .category-config-icon { background: var(--purple-soft); color: var(--purple); }
.category-config-row > div { flex: 1; min-width: 0; }
.category-config-row strong, .category-config-row small { display: block; }
.category-config-row strong { font-size: 11px; }
.category-config-row small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.category-config-row small b { color: var(--brand-dark); }
.readonly-location { min-height: 38px; border: 1px solid #e5edf1; background: #f7fafb; border-radius: 7px; display: flex; align-items: center; padding: 0 10px; color: #5e6f7b; font-size: 12px; }
.detail-location-highlight { display: flex; align-items: center; gap: 10px; background: var(--brand-soft); border: 1px solid #c9edfc; border-radius: 9px; padding: 11px; margin-bottom: 17px; }
.detail-location-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--brand-dark); background: #fff; font-size: 17px; flex-shrink: 0; }
.detail-location-highlight > div { flex: 1; min-width: 0; }
.detail-location-highlight span, .detail-location-highlight strong { display: block; }
.detail-location-highlight span { color: var(--brand-dark); font-size: 10px; }
.detail-location-highlight strong { color: var(--ink); font-size: 11px; margin-top: 2px; }
.detail-history { display: grid; gap: 10px; max-height: 160px; overflow: auto; padding-right: 4px; }
.history-row { display: flex; gap: 9px; align-items: flex-start; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 4px; flex-shrink: 0; }
.history-row strong, .history-row small { display: block; }
.history-row strong { font-size: 10px; }
.history-row small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.table-link { border: 0; background: transparent; padding: 0; text-align: left; color: var(--ink); }
.table-link:hover strong { color: var(--brand-dark); text-decoration: underline; }
.tracking-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.tracking-badge.individual { color: var(--brand-dark); background: var(--brand-soft); }
.tracking-badge.quantity { color: var(--purple); background: var(--purple-soft); }
.label-code-block { margin-top: 28px; min-width: 0; display: grid; gap: 3px; }
.label-overline { color: var(--brand-dark); font-size: 8px; font-weight: 800; letter-spacing: .8px; }
.label-code { font-size: 25px; letter-spacing: 1px; line-height: 1; }
.label-model, .label-category { display: block; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-write-note { margin-left: auto; align-self: flex-end; color: #8f9da7; font-size: 8px; line-height: 1.35; text-align: right; font-weight: 800; letter-spacing: .6px; }

/* Explorador principal de oficinas */
.location-explorer { padding: 20px; margin-bottom: 18px; }
.location-explorer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.location-explorer-head h2 { margin: 0 0 4px; font-size: 18px; }
.location-explorer-head .eyebrow { margin-bottom: 5px; }
.office-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 9px; }
.office-switch-button, .plant-switch-button { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid #e1e9ee; background: #fff; color: var(--ink); border-radius: 10px; text-align: left; padding: 10px; min-height: 58px; }
.office-switch-button:hover, .plant-switch-button:hover { border-color: #a6dff6; background: #f7fcff; }
.office-switch-button.selected, .plant-switch-button.selected { border-color: #8bd7f7; background: var(--brand-soft); box-shadow: 0 3px 9px rgba(0,161,254,.08); }
.office-switch-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #fff; color: var(--brand-dark); font-size: 10px; font-weight: 800; flex-shrink: 0; }
.office-switch-button > span:nth-child(2), .plant-switch-button > span:nth-child(2) { flex: 1; min-width: 0; }
.office-switch-button strong, .office-switch-button small, .plant-switch-button strong, .plant-switch-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-switch-button strong, .plant-switch-button strong { font-size: 12px; }
.office-switch-button small, .plant-switch-button small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.office-switch-count, .plant-switch-button > span:last-child { color: var(--muted); font-size: 10px; white-space: nowrap; }
.plant-switch-wrap { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 14px; }
.switch-label { display: block; color: var(--muted); font-size: 10px; font-weight: 800; margin-bottom: 8px; }
.plant-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.plant-switch-button { width: auto; min-width: 220px; min-height: 50px; padding: 8px 10px; }
.plant-switch-button .floor-icon { background: #fff; }
.location-explorer-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.zone-explorer { padding: 20px; min-width: 0; }
.zone-explorer .compact-heading { margin-bottom: 14px; }
.zone-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.office-zone-list { display: grid; gap: 12px; }
.office-zone-section { border: 1px solid #dfe8ee; border-radius: 12px; padding: 14px; background: #fbfdfe; }
.office-zone-section.tone-purple { background: #fcfbff; border-color: #e4e1f7; }
.office-zone-section.tone-green { background: #fbfefc; border-color: #dcefe6; }
.office-zone-section.tone-orange { background: #fffdf9; border-color: #f1e5d2; }
.office-zone-head { display: flex; justify-content: space-between; gap: 12px; }
.office-zone-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.office-zone-title-row h3 { margin: 2px 0 0; font-size: 15px; }
.office-zone-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.zone-summary-toggle, .office-zone-summary-head .text-button { color: var(--brand-dark); font-size: 11px; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.office-zone-summary { margin-top: 12px; padding: 11px; border: 1px solid #cceafa; border-radius: 9px; background: #f5fcff; }
.office-zone-summary-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.office-zone-summary-head strong { font-size: 11px; }
.office-zone-summary p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.office-zone-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.office-zone-metrics span { display: grid; gap: 2px; }
.office-zone-metrics b { font-size: 14px; }
.office-zone-metrics em { color: var(--muted); font-size: 9px; font-style: normal; }
.office-place-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding-top: 11px; border-top: 1px solid rgba(120,145,160,.15); }
.office-place-heading .eyebrow { margin: 0; font-size: 9px; }
.office-place-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.office-place-card { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; border: 1px solid #e6edf1; border-radius: 8px; background: #fff; color: var(--ink); padding: 9px; text-align: left; }
.office-place-card:hover, .office-place-card.selected { border-color: #8bd7f7; background: #f7fcff; }
.office-place-card .place-explorer-copy { min-width: 0; flex: 1; }
.office-place-card .place-explorer-copy strong, .office-place-card .place-explorer-copy small, .office-place-card .place-explorer-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-place-card .place-explorer-copy em { color: var(--muted-2); font-size: 9px; font-style: normal; margin-top: 2px; }
.office-place-arrow { color: var(--brand-dark); font-size: 14px; }
.zone-summary-card { border: 1px solid #dfe8ee; border-radius: 11px; padding: 13px; background: #fbfdfe; color: var(--ink); text-align: left; display: grid; gap: 8px; min-width: 0; }
.zone-summary-card.tone-purple { background: #fcfbff; border-color: #e4e1f7; }
.zone-summary-card.tone-green { background: #fbfefc; border-color: #dcefe6; }
.zone-summary-card.tone-orange { background: #fffdf9; border-color: #f1e5d2; }
.zone-summary-card:hover, .zone-summary-card.selected { border-color: #8bd7f7; background: #f2fbff; box-shadow: 0 4px 10px rgba(0,161,254,.08); }
.zone-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.zone-card-top strong { display: block; font-size: 13px; }
.zone-card-arrow { color: var(--brand-dark); font-size: 15px; }
.zone-summary-card > small { color: var(--muted); font-size: 10px; }
.zone-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; border-top: 1px solid rgba(120,145,160,.15); padding-top: 8px; }
.zone-metrics span { display: grid; gap: 2px; }
.zone-metrics b { font-size: 14px; color: var(--ink); }
.zone-metrics em { color: var(--muted); font-size: 9px; font-style: normal; }
.zone-card-footer { color: var(--muted-2); font-size: 9px; }
.place-explorer { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 17px; }
.place-explorer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.place-explorer-head h3 { margin: 0 0 3px; font-size: 15px; }
.place-explorer-head p { margin: 0; color: var(--muted); font-size: 11px; }
.place-explorer-head .eyebrow { margin-bottom: 4px; font-size: 9px; }
.place-explorer-list { display: grid; gap: 6px; }
.place-explorer-card { display: flex; align-items: center; gap: 9px; width: 100%; border: 1px solid #e6edf1; border-radius: 8px; background: #fff; color: var(--ink); padding: 9px; text-align: left; }
.place-explorer-card:hover, .place-explorer-card.selected { border-color: #8bd7f7; background: #f7fcff; }
.place-explorer-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #f0f4f6; color: #687986; flex-shrink: 0; }
.place-explorer-copy { flex: 1; min-width: 0; }
.place-explorer-copy strong, .place-explorer-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-explorer-copy strong { font-size: 11px; }
.place-explorer-copy small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.place-explorer-count { color: var(--brand-dark); font-size: 10px; font-weight: 800; white-space: nowrap; text-align: right; }
.place-explorer-count small { display: block; color: var(--muted); font-size: 9px; font-weight: 500; }
.place-explorer-empty, .empty-state-inline { min-height: 155px; display: grid; place-items: center; align-content: center; gap: 5px; color: var(--muted); text-align: center; padding: 22px; font-size: 11px; }
.place-explorer-empty strong { color: var(--ink); font-size: 13px; }
.place-explorer-empty .empty-icon { font-size: 30px; }
.map-plan-label { display: block; color: var(--brand-dark); font-size: 10px; margin-top: 6px; }
.map-place-copy em { display: block; color: var(--muted-2); font-size: 8px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.form-help { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }

@media (max-width: 1120px) {
  .map-layout { grid-template-columns: 1fr; }
  .location-explorer-grid { grid-template-columns: 1fr; }
  .place-detail { min-height: 0; }
  .place-detail-empty { min-height: 230px; }
  .catalog-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .map-controls { grid-template-columns: repeat(2, 1fr); }
  .map-legend { justify-content: flex-start; grid-column: 1 / -1; padding-bottom: 0; }
  .map-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .map-zone { grid-column: auto !important; grid-row: auto !important; }
  .map-canvas { min-height: 0; }
  .map-schematic-footer { display: grid; }
}
@media (max-width: 600px) {
  .config-tabs { overflow-x: auto; }
  .config-tab { white-space: nowrap; }
  .map-controls { grid-template-columns: 1fr; }
  .map-legend { grid-column: auto; }
  .map-canvas, .place-detail, .catalog-card { padding: 15px; }
  .map-schematic-header { display: grid; }
  .map-schematic-header .button { justify-self: start; }
  .map-place-grid { grid-template-columns: 1fr; }
  .location-explorer { padding: 15px; }
  .location-explorer-head, .place-explorer-head { display: grid; }
  .location-explorer-head .button, .place-explorer-head .button { justify-self: start; }
  .plant-switch { display: grid; grid-template-columns: 1fr; }
  .plant-switch-button { width: 100%; min-width: 0; }
  .zone-summary-grid { grid-template-columns: 1fr; }
  .zone-metrics { grid-template-columns: repeat(3, 1fr); }
  .office-zone-metrics { grid-template-columns: repeat(3, 1fr); }
  .office-place-grid { grid-template-columns: 1fr; }
  .place-explorer-count { display: none; }
  .place-detail-actions { grid-template-columns: 1fr; }
  .place-facts { grid-template-columns: 1fr 1fr; }
  .floor-config-list { padding-left: 0; }
  .zone-chip-list { padding-left: 0; }
  .label-code { font-size: 22px; }
}

/* Variante visual 1.1: marco más compacto y menú lateral plegable. */
.sidebar { transition: width .2s ease, padding .2s ease; }
.sidebar-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-collapse-button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--brand-dark); font-size: 20px; line-height: 1; padding: 0; }
.sidebar-collapse-button:hover, .sidebar-collapse-button:focus-visible { background: var(--brand-soft); border-color: #a8defa; outline: none; }
.main-content { max-width: none; margin: 0; padding-left: 34px; padding-right: 34px; }
.sidebar-collapsed .sidebar { width: 76px; padding-left: 10px; padding-right: 10px; }
.sidebar-collapsed .sidebar-heading { padding-left: 0; padding-right: 0; justify-content: center; }
.sidebar-collapsed .sidebar-heading > span,
.sidebar-collapsed .nav-item > span:not(.nav-icon),
.sidebar-collapsed .nav-group-label > span:first-child,
.sidebar-collapsed .sidebar-footer { display: none; }
.sidebar-collapsed .sidebar-heading-row { justify-content: center; }
.sidebar-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .nav-item.active::before { left: -10px; }
.sidebar-collapsed .nav-icon { width: auto; font-size: 19px; }
.sidebar-collapsed .nav-group-label { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar-collapsed .nav-count { margin-left: 0; }

@media (max-width: 900px) {
  .main-content { padding-left: 20px; padding-right: 20px; }
  .sidebar-collapsed .sidebar { width: 76px; }
}

@media (max-width: 600px) {
  .main-content { padding-left: 18px; padding-right: 18px; }
}

/* Variante visual 1.2: referencias de Atrium en modo consulta. */
:root {
  --canvas: #f3f5f7;
  --line: #e1e7eb;
  --shadow: 0 5px 16px rgba(31, 53, 72, 0.055);
  --radius: 11px;
}
body { background: var(--canvas); font-size: 13px; }
.topbar { height: 62px; padding: 0 22px; box-shadow: 0 1px 0 rgba(31, 53, 72, .04); }
.brand { min-width: 220px; gap: 10px; }
.brand-logo { width: 104px; }
.brand-divider { height: 20px; }
.brand-product { color: #34434f; font-size: 13px; }
.prototype-badge { padding: 6px 10px; font-size: 11px; }
.avatar-button { width: 32px; height: 32px; font-size: 12px; }
.workspace { min-height: calc(100vh - 62px); }
.sidebar { width: 222px; padding: 18px 12px 16px; }
.sidebar-heading { padding-left: 10px; padding-right: 10px; padding-bottom: 9px; font-size: 9px; }
.nav-item { min-height: 40px; gap: 9px; padding-left: 10px; padding-right: 10px; border-radius: 8px; font-size: 12px; }
.nav-item.active::before { left: -12px; top: 8px; bottom: 8px; }
.nav-group-label { padding-left: 10px; padding-right: 10px; padding-top: 11px; }
.sidebar-section-spacer { height: 24px; }
.sidebar-footer { padding: 12px 11px; margin-left: 3px; margin-right: 3px; }
.main-content { padding: 26px 28px 50px; }
.page-header { margin-bottom: 22px; }
.eyebrow { margin-bottom: 5px; font-size: 9px; letter-spacing: 1.1px; }
h1 { font-size: clamp(26px, 3vw, 33px); letter-spacing: -.8px; margin-bottom: 6px; }
.page-description { font-size: 13px; }
.header-actions { gap: 8px; }
.button { min-height: 38px; padding-left: 13px; padding-right: 13px; border-radius: 8px; font-size: 12px; }
.kpi-grid { gap: 12px; margin-bottom: 18px; }
.kpi-card { min-height: 124px; padding: 17px 18px; }
.kpi-value { font-size: 31px; }
.panel { box-shadow: var(--shadow); }
.alert-panel, .activity-panel { padding: 19px; }
.panel-heading { margin-bottom: 16px; }
.quick-panel { padding: 18px 19px 16px; }
.filter-panel { padding: 13px; margin-bottom: 12px; }
.table-panel, .location-card, .location-explorer, .map-canvas, .place-detail, .catalog-card { box-shadow: var(--shadow); }
.location-card-head { padding: 16px 17px; }
.location-assets { padding-left: 17px; padding-right: 17px; }
.location-explorer { padding: 17px; margin-bottom: 15px; }
.location-explorer-head { margin-bottom: 15px; }
.zone-summary-card { border-radius: 9px; padding: 11px; }
.place-explorer-card, .office-place-card { border-radius: 7px; padding: 8px; }
.maintenance-help { padding: 15px 17px; }

@media (max-width: 900px) {
  .topbar { height: 60px; padding: 0 16px; }
  .workspace { min-height: calc(100vh - 60px); }
  .sidebar { top: 60px; }
  .main-content { padding: 22px 18px 40px; }
}

@media (max-width: 600px) {
  .brand { min-width: 0; }
  .brand-logo { width: 94px; }
  .brand-divider, .brand-product { display: none; }
  .topbar-actions { gap: 8px; }
  .prototype-badge { display: none; }
  .main-content { padding-left: 14px; padding-right: 14px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Oficinas 1.2: zonas a ancho completo y fichas en ventana modal. */
.location-explorer-grid { display: block; margin-bottom: 18px; }
.office-zone-list { grid-template-columns: 1fr; gap: 14px; }
.office-zone-list.zone-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.office-zone-list.zone-count-many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.office-zone-section { height: 100%; display: flex; flex-direction: column; }
.office-place-grid { grid-template-columns: 1fr; margin-top: 0; padding-top: 8px; }
.office-place-grid.zone-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.office-place-grid.zone-count-many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modal.place-modal { width: 80vw; height: 80vh; max-width: none; max-height: 80vh; overflow: auto; }
.modal.place-modal .place-detail-content { padding: 24px; }
.modal.place-modal .place-detail-head { margin-bottom: 18px; }
.place-movement-list { display: grid; gap: 8px; }
.place-movement-row { padding: 9px 10px; border: 1px solid #e5edf1; border-radius: 8px; background: #fbfcfd; }
.place-movement-row > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.place-movement-row strong, .place-movement-row small, .place-movement-row p, .place-movement-row em { display: block; }
.place-movement-row strong { font-size: 11px; }
.place-movement-row small, .place-movement-row p, .place-movement-row em { color: var(--muted); font-size: 10px; }
.place-movement-row p { margin: 5px 0 0; line-height: 1.4; }
.place-movement-row em { margin-top: 3px; font-style: normal; }

@media (max-width: 1120px) {
  .office-zone-list.zone-count-2,
  .office-zone-list.zone-count-many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .office-place-grid.zone-count-2,
  .office-place-grid.zone-count-many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .office-zone-list,
  .office-zone-list.zone-count-2,
  .office-zone-list.zone-count-many { grid-template-columns: 1fr; }
  .office-place-grid,
  .office-place-grid.zone-count-2,
  .office-place-grid.zone-count-many { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .modal.place-modal { width: calc(100vw - 24px); height: calc(100vh - 24px); max-height: calc(100vh - 24px); }
  .modal.place-modal .place-detail-content { padding: 18px 16px; }
  .place-movement-row > div { display: grid; gap: 3px; }
}

/* Formato común de ventanas emergentes (alta, edición, confirmación y detalle). */
.modal, .modal.place-modal { display: flex; flex-direction: column; overflow: hidden; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.modal.place-modal { width: min(1100px, calc(100vw - 32px)); height: auto; max-height: calc(100vh - 32px); }
.modal > .modal-header { flex: none; padding: 20px 24px; align-items: flex-start; }
.modal > .modal-header h2 { margin: 0 0 4px; }
.modal > .modal-header p:empty { display: none; }
.modal > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px; }
.modal > .modal-body > * + * { margin-top: 16px; }
.modal > .modal-body > *:first-child { margin-top: 0; }
.modal > .modal-body > *:last-child { margin-bottom: 0; }
.modal > .modal-body .form-grid { gap: 16px; }
.modal > .modal-body .form-check { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.modal > .modal-body .form-check input { width: auto; min-height: 0; }
.modal > .modal-body .place-detail-content { padding: 0; }
.modal > .modal-footer { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 24px; margin: 0; border-top: 1px solid var(--line); background: #fff; }
@media (max-width: 640px) {
  .modal-backdrop { padding: 12px; }
  .modal, .modal.place-modal { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .modal > .modal-header, .modal > .modal-body, .modal > .modal-footer { padding-left: 18px; padding-right: 18px; }
  .modal > .modal-body { padding-top: 18px; padding-bottom: 18px; }
  .modal > .modal-footer .button { flex: 1 1 auto; }
}

/* Maintenance hierarchy + custom order */
.maintenance-place-list { padding-left: 30px; }
.maintenance-place-list.nested { padding-left: 34px; padding-top: 6px; }
.maintenance-subzone-item { border: 1px solid #edf1f3; border-radius: 7px; padding: 7px; background: #fbfcfd; }
.maintenance-subzone-item .maintenance-node-title strong { font-size: 11px; }
.maintenance-subzone-item.is-inactive, .maintenance-place-item.is-inactive { opacity: .65; }
.sort-controls { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; width: auto !important; }
.sort-controls .icon-small-button { width: 22px; height: 22px; min-width: 22px; font-size: 11px; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 11px; letter-spacing: -2px; padding: 0 3px; user-select: none; }
[data-sort-group].is-dragging { opacity: .45; }
[data-sort-group].drop-target { outline: 2px dashed var(--brand-dark); outline-offset: 2px; }

/* Space explorer: row-major grids, one shared sequence, nested children. */
.office-zone-list { align-items: start; grid-auto-flow: row; }
.office-zone-section { position: relative; height: auto; min-width: 0; border-radius: 8px; container-type: inline-size; }
.office-zone-head, .office-zone-head > div, .office-zone-title-row, .office-zone-title-row h3 { min-width: 0; width: 100%; }
.office-zone-title-row h3 { color: var(--brand-dark); overflow-wrap: anywhere; }
.office-zone-head p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-zone-children { margin-top: 14px; padding: 10px 0 0 10px; border-top: 1px solid var(--line); }
.office-space-item { min-width: 0; }
.office-place-grid { grid-auto-flow: row; align-items: start; min-width: 0; }
.office-place-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; min-height: 58px; }
.office-space-item > .office-place-card { grid-template-columns: minmax(0, 1fr) auto; }
.office-subzone-places { margin: 8px 0 0 12px; padding-left: 10px; border-left: 1px solid var(--line); min-width: 0; container-type: inline-size; }
.office-element-tooltip { position: absolute; inset: auto 0 calc(100% + 6px); z-index: 30; display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: 12px; line-height: 1.4; font-weight: 400; white-space: normal; overflow-wrap: anywhere; visibility: hidden; opacity: 0; pointer-events: none; }
.office-place-card:hover, .office-place-card:focus-visible { z-index: 31; }
.office-place-card:hover > .office-element-tooltip, .office-place-card:focus-visible > .office-element-tooltip { visibility: visible; opacity: 1; }
.office-place-card:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 3px; }
@container (max-width: 440px) {
  .office-place-grid.zone-count-many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .office-place-card { grid-template-columns: auto minmax(0, 1fr) auto; }
  .office-place-card .place-explorer-count { display: none; }
}
@container (max-width: 260px) {
  .office-place-grid.zone-count-2, .office-place-grid.zone-count-many { grid-template-columns: minmax(0, 1fr); }
}

/* Menú lateral fijo: el contenido central se desplaza de forma independiente */
@media (min-width: 901px) { .sidebar { position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; align-self: flex-start; } }
.sidebar-tooltip { position: fixed; z-index: 1000; transform: translateY(-50%); background: #102737; color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 16px rgba(16,39,55,.2); }
.sidebar-tooltip[hidden] { display: none; }
.form-wide { grid-column: 1 / -1; }
.form-field[hidden] { display: none; }
#usersPanel .data-table { width: 100%; border-collapse: collapse; }
#usersPanel .data-table th, #usersPanel .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }

/* Selector jerárquico de ubicaciones (movimientos y alta de material) */
.place-picker-overlay { position: fixed; inset: 0; background: rgba(23,34,48,.5); z-index: 120; display: grid; place-items: center; padding: 18px; }
.place-picker { background: var(--surface); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border-radius: 16px; box-shadow: 0 25px 70px rgba(15,32,45,.25); display: flex; flex-direction: column; overflow: hidden; animation: modal-in .18s ease; }
.place-picker-tools { padding: 16px 24px 0; display: grid; gap: 12px; }
.place-picker-search { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.place-picker-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.picker-crumb { background: var(--brand-soft); color: var(--brand-dark); border: 0; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.picker-crumb:hover { background: var(--brand); color: #fff; }
.picker-crumb-sep { color: var(--muted-2); }
.place-picker-body { flex: 1; overflow-y: auto; padding: 20px 24px 24px; }
.place-picker .modal-footer { flex: none; }
.picker-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; font: inherit; color: var(--ink); }
.picker-card:hover, .picker-card:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.picker-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.picker-card .place-explorer-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.picker-card .place-explorer-copy small { color: var(--muted); font-size: 11px; }
.place-pick-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.place-pick-row p { margin: 0; }

/* Catálogos: cifras Total / En stock y desglose */
.category-stock-figures { display: flex; align-items: center; gap: 10px; margin-left: auto; padding: 0 12px; }
.category-stock-figures > span:not(.category-stock-sep) { display: grid; justify-items: center; }
.category-stock-figures b { font-size: 18px; line-height: 1.1; }
.category-stock-figures em { font-style: normal; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.category-stock-sep { color: var(--muted-2); font-size: 18px; }
.category-stock-figures.below-min b:last-child, .category-stock-figures.below-min span:last-child b { color: var(--danger); }
.stock-warning { color: var(--danger); font-weight: 700; }
.category-status-list { display: grid; gap: 6px; margin-bottom: 8px; }
.category-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tree-count { margin-left: auto; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 1px 10px; font-size: 11px; font-weight: 700; }
.category-tree { display: grid; gap: 4px; }
.category-tree-node { border: 1px solid var(--line); border-radius: 10px; padding: 2px 0; }
.category-tree-node > summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-weight: 600; list-style: none; }
.category-tree-node > summary::-webkit-details-marker { display: none; }
.category-tree-node > summary::before { content: '▸'; color: var(--muted-2); }
.category-tree-node[open] > summary::before { content: '▾'; }
.category-tree-children { display: grid; gap: 4px; padding: 4px 12px 10px 28px; }
.category-tree-units { display: grid; gap: 2px; padding: 4px 12px 10px 28px; }
.category-unit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }

/* Material and assignment actions share the existing modal layout. */
.place-assets-list { display: flex; flex-wrap: wrap; gap: 12px; container-type: inline-size; }
.place-material-item { flex: 1 1 calc((100% - 36px) / 4); min-width: 0; display: grid; grid-template-rows: 1fr auto; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.place-material-item .place-asset-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 0; border: 0; background: transparent; min-width: 0; }
.place-material-item .place-asset-row strong, .place-material-item .place-asset-row small { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.place-material-item .place-asset-row strong { font-size: 13px; line-height: 1.4; }
.place-material-item .place-asset-row small { font-size: 12px; line-height: 1.5; }
.place-material-actions { display: flex; justify-content: flex-end; gap: 8px; }
.assignment-options { display: flex; flex-wrap: wrap; gap: 10px; }
.assignment-options .button { flex: 1 1 180px; white-space: normal; }
.material-icon-wrap { position: relative; display: inline-flex; }
.material-icon-button.button { width: 44px; height: 44px; min-width: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.material-icon-button:focus-visible, .place-material-item .place-asset-row:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.material-action-tooltip { position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 5; width: max-content; max-width: 180px; padding: 7px 10px; border-radius: 6px; color: var(--surface); background: var(--ink); font-size: 12px; line-height: 1.4; pointer-events: none; visibility: hidden; opacity: 0; }
.material-icon-wrap:hover .material-action-tooltip, .material-icon-wrap:focus-within .material-action-tooltip { visibility: visible; opacity: 1; }
@container (max-width: 900px) { .place-material-item { flex-basis: calc((100% - 24px) / 3); } }
@container (max-width: 650px) { .place-material-item { flex-basis: calc((100% - 12px) / 2); } }
@container (max-width: 420px) { .place-material-item { flex-basis: 100%; } }
#assignmentPreview { padding: 14px; background: var(--brand-soft); color: var(--ink); border-radius: 6px; overflow-wrap: anywhere; line-height: 1.6; }

/* One preserved place sheet below a single secondary dialog. */
#placeModalBase { position: absolute; z-index: 0; max-width: calc(100vw - 32px); }
#modalBackdrop.has-secondary > #modal { position: relative; z-index: 1; box-shadow: var(--shadow); }
#modalBackdrop.has-secondary { isolation: isolate; }
#modalBackdrop.has-secondary::before { content: ''; position: absolute; inset: 0; background: var(--canvas); opacity: .65; z-index: 1; pointer-events: none; }
#modalBackdrop.has-secondary > #modal { z-index: 2; }

/* Real place code (lugares.codigo), always visible next to the name. */
.place-code-badge { display: inline-block; flex: none; margin-right: 4px; padding: 1px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-dark); border: 1px solid var(--line); font: 600 0.78em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; white-space: nowrap; vertical-align: middle; }
.place-code-badge.is-missing { background: var(--warning-soft); color: var(--warning); font-family: inherit; font-weight: 500; font-style: italic; opacity: .75; }
.office-place-card .place-explorer-copy strong, .picker-place .place-explorer-copy strong { white-space: normal; overflow-wrap: anywhere; }
