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

:root {
  --forest: #10271b;
  --forest-2: #183b29;
  --green: #128342;
  --green-dark: #0d6533;
  --green-light: #e6f4eb;
  --red: #ac1924;
  --red-dark: #84131b;
  --wine: var(--red);
  --wine-dark: var(--red-dark);
  --blue: #1769d2;
  --orange: #ef8b16;
  --paper: #f3f7f4;
  --panel: #fff;
  --ink: #16251d;
  --muted: #69756e;
  --line: #dde2dd;
  --sidebar: 210px;
  --sidebar-half: 105px;
  font-family: "Rubik", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
body.auth-pending #loginSection,
body.auth-pending #formularios,
body.auth-pending #formWorkspace,
body.auth-pending #sessionSummary,
body.auth-pending #logoutButton { visibility: hidden !important; }
button, input { font: inherit; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--sidebar); padding: 26px 14px 20px;
  display: flex; flex-direction: column;
  color: #fff; background: var(--forest);
  border-right: 1px solid rgba(255,255,255,.08);
}

.side-brand { display: block; padding: 0 10px 22px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.12); }
.side-brand img { display: block; width: 145px; max-width: 100%; }
.side-brand span { display: block; margin: 8px 0 0 4px; color: #fff; font-size: 20px; font-weight: 400; letter-spacing: .12em; }
.side-session { padding: 14px 10px 0; display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 8px 10px; align-items: center; }
.side-session[hidden] { display: none; }
.side-session strong { min-width: 0; color: #eef4f0; font-size: 10px; font-weight: 500; line-height: 1.35; }
.side-session .camera-dispatch-shortcut { grid-column: 1 / -1; width: 100%; justify-content: center; }
.nav-label { margin: 20px 12px 8px; color: #75827b; font-size: 9px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { min-height: 46px; padding: 0 12px; display: flex; align-items: center; gap: 10px; color: #bdc8c1; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 500; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-nav a.active { color: #fff; background: var(--green); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.nav-icon { width: 21px; text-align: center; font-size: 18px; line-height: 1; }
.side-status { margin-top: auto; padding: 15px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.side-status-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.online { display: flex; align-items: center; gap: 9px; color: #c4cec8; font-size: 12px; }
.online::before { content: ""; width: 8px; height: 8px; background: #58bd79; border-radius: 50%; box-shadow: 0 0 0 5px rgba(88,189,121,.1); }
.side-status small { display: block; margin-top: 10px; color: #6f7d75; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.side-logout { padding: 0; color: #d9a4aa; background: transparent; border: 0; cursor: pointer; font-size: 9px; line-height: 1.25; text-align: right; }
.side-logout:hover { color: #fff; }
.side-logout[hidden] { display: none; }

.mobile-menu, .menu-overlay { display: none; }
.app-main { min-height: 100vh; margin-left: var(--sidebar); padding: 38px clamp(24px, 3.5vw, 58px) 52px; }
body.login-active .sidebar,
body.login-active .mobile-menu,
body.login-active .menu-overlay { display: none; }
body.login-active .app-main { margin-left: 0; }
.page-title { margin-bottom: 14px; }
.page-title p { margin: 0 0 7px; color: var(--wine); font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(30px, 3vw, 44px); font-weight: 500; letter-spacing: -.04em; }
.page-subtitle { max-width: 520px; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.search { width: min(390px, 36vw); min-height: 48px; padding: 0 17px; color: var(--ink); background: #fff; border: 1px solid var(--line); outline: none; }
.search:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,131,66,.11); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { min-height: 118px; padding: 22px; display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line); }
.stat-icon { flex: 0 0 52px; height: 52px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 50%; font-size: 25px; }
.stat-card.wine .stat-icon { color: var(--wine); background: #f6e9ee; }
.stat-card.blue .stat-icon { color: var(--blue); background: #eaf2fd; }
.stat-card.alert .stat-icon { color: var(--orange); background: #fff3e4; }
.stat-label { display: block; color: var(--muted); font-size: 12px; }
.stat-value { display: block; margin-top: 3px; font-size: 32px; font-weight: 600; letter-spacing: -.04em; }
.stat-value small { font-size: 12px; font-weight: 400; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); }
.panel-head { min-height: 72px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.panel-head h2, .detail-card h2 { margin: 0; font-size: 19px; font-weight: 500; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.btn { min-height: 43px; padding: 0 18px; color: #fff; background: var(--green); border: 1px solid var(--green); cursor: pointer; font-size: 12px; font-weight: 600; }
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover { background: var(--green); border-color: var(--green); }
.btn-outline { color: var(--green); background: #fff; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 18px; }
.workspace-wide { grid-template-columns: minmax(0, 1fr) 320px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 14px 17px; text-align: left; border-bottom: 1px solid #e9ece9; font-size: 12px; }
th { color: var(--muted); background: #f8f9f6; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 9px; color: var(--green); background: var(--green-light); border-radius: 20px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.tag.wait { color: var(--blue); background: #eaf2fd; }
.tag.alert { color: #a25b06; background: #fff0da; }

.location-grid { padding: 22px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.slot { min-height: 64px; display: grid; place-items: center; color: #6c756f; background: #f7f8f5; border: 1px solid #dfe3df; font-size: 13px; font-weight: 600; cursor: pointer; }
.slot.used { color: #fff; background: var(--green); border-color: var(--green); }
.slot.process { color: #fff; background: var(--blue); border-color: var(--blue); }
.slot.camera { color: #fff; background: var(--wine); border-color: var(--wine); }
.slot.ready { color: #fff; background: #4aa950; border-color: #4aa950; }
.slot.warning { color: #fff; background: var(--orange); border-color: var(--orange); }
.slot.selected { outline: 3px solid var(--wine); outline-offset: 3px; }
.legend { padding: 17px 22px; display: flex; flex-wrap: wrap; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 13px; height: 13px; display: inline-block; background: #f7f8f5; border: 1px solid #dfe3df; }
.legend .process-key { background: var(--blue); border-color: var(--blue); }
.legend .ready-key { background: #4aa950; border-color: #4aa950; }
.legend .camera-key { background: var(--wine); border-color: var(--wine); }
.legend .alert-key { background: var(--orange); border-color: var(--orange); }

.detail-card { padding: 25px; background: #fff; border: 1px solid var(--line); }
.detail-kicker { margin: 0 0 8px; color: var(--wine); font-size: 10px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.detail-sub { margin: 8px 0 22px; color: var(--muted); font-size: 12px; }
.detail-list { margin: 0; }
.detail-row { padding: 15px 0; display: grid; grid-template-columns: 1fr auto; gap: 14px; border-top: 1px solid var(--line); }
.detail-row dt { color: var(--muted); font-size: 11px; }
.detail-row dd { margin: 0; text-align: right; font-size: 13px; font-weight: 600; }
.detail-card .btn { width: 100%; margin-top: 20px; }

.tabs { margin-bottom: 10px; display: flex; overflow-x: auto; background: #fff; border: 1px solid var(--line); }
.tabs button { min-width: 118px; min-height: 48px; padding: 0 20px; color: var(--muted); background: #fff; border: 0; border-right: 1px solid var(--line); cursor: pointer; font-weight: 500; }
.tabs button.active { color: var(--wine); box-shadow: inset 0 -3px var(--wine); }
.rack-wrap { padding: 25px; overflow-x: auto; }
.rack { min-width: 780px; display: grid; grid-template-columns: 72px repeat(10, 1fr); gap: 9px; align-items: stretch; }
.rack-label { display: grid; place-items: center start; color: var(--muted); font-size: 11px; }
.rack .slot { min-height: 104px; padding: 8px 3px; text-align: center; font-size: 11px; line-height: 1.5; }
.rack .slot b { display: block; font-size: 14px; }
.aisles { padding: 15px; display: grid; gap: 7px; }
.aisle { min-height: 39px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); background: #fafbf8; border: 1px solid var(--line); font-size: 11px; cursor: pointer; }
.aisle.active { color: var(--wine); border-color: var(--wine); font-weight: 600; }
.camera-layout { display: grid; grid-template-columns: 190px minmax(0,1fr); }

@media (max-width: 1280px) {
  .app-main { padding-inline: 28px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .workspace, .workspace-wide { grid-template-columns: 1fr; }
  .detail-card { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(280px,1.2fr); column-gap: 28px; align-items: start; }
  .detail-card .detail-kicker,
  .detail-card h2,
  .detail-card .detail-sub { grid-column: 1; }
  .detail-card .detail-list { grid-column: 2; grid-row: 1 / span 4; }
  .detail-card .btn { grid-column: 1; }
}

@media (max-width: 1024px) {
  :root { --sidebar: 270px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 12px 0 35px rgba(0,0,0,.25); }
  body.menu-open .sidebar { transform: translateX(0); }
  .menu-overlay { position: fixed; inset: 0; z-index: 40; display: block; visibility: hidden; opacity: 0; background: rgba(10,18,14,.55); transition: .25s; }
  body.menu-open .menu-overlay { visibility: visible; opacity: 1; }
  body.menu-open .assignment-next-button, body.menu-open .camera-pallet-action-bar, body.menu-open .tunnel-pallet-action-bar, body.menu-open .process-actions, body.menu-open .dispatch-module-actions { z-index: 30; pointer-events: none; }
  .mobile-menu { position: fixed; z-index: 60; top: 15px; left: 15px; width: 48px; height: 48px; padding: 0; display: grid; place-items: center; color: #fff; background: var(--green); border: 0; border-radius: 50%; box-shadow: 0 8px 22px rgba(12,73,38,.25); cursor: pointer; }
  .mobile-menu span, .mobile-menu::before, .mobile-menu::after { content: ""; width: 20px; height: 2px; display: block; background: currentColor; transition: .2s; }
  .mobile-menu span { position: relative; }
  .mobile-menu::before { position: absolute; transform: translateY(-6px); }
  .mobile-menu::after { position: absolute; transform: translateY(6px); }
  body.menu-open .mobile-menu { left: 207px; }
  body.menu-open .mobile-menu span { opacity: 0; }
  body.menu-open .mobile-menu::before { transform: rotate(45deg); }
  body.menu-open .mobile-menu::after { transform: rotate(-45deg); }
  .app-main { margin-left: 0; padding: 15px 24px 38px; }
  .page-title { min-height: 48px; margin-bottom: 14px; padding-inline: 58px; display: grid; place-items: center; text-align: center; }
  .page-title h1 { font-size: clamp(25px,5vw,34px); }
  .camera-pallet-action-bar { left: 50%; width: min(700px,calc(100vw - 24px)); }
  .tunnel-button-picker { align-items: center; }
  .tunnel-button-options { justify-content: center; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workspace, .workspace-wide { grid-template-columns: 1fr; }
  .rack-wrap { padding: 20px; }
}

@media (max-width: 700px) {
  .app-main { padding: 15px 12px 28px; }
  .page-title { min-height: 48px; margin-bottom: 12px; padding-inline: 55px; display: grid; place-items: center; text-align: center; }
  .page-title p { margin-bottom: 5px; }
  h1 { font-size: 29px; }
  .page-subtitle { font-size: 13px; }
  .search { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .stat-card { min-width: 0; min-height: 88px; padding: 14px 12px; gap: 11px; }
  .stat-icon { flex-basis: 39px; width: 39px; height: 39px; font-size: 19px; }
  .stat-label { font-size: 10px; line-height: 1.25; }
  .stat-value { font-size: 25px; }
  .stat-value small { display: block; margin-top: 2px; font-size: 9px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-head .btn { width: 100%; }
  .panel-head h2, .detail-card h2 { font-size: 18px; }
  .location-grid { grid-template-columns: repeat(3, minmax(0,1fr)); padding: 12px; gap: 8px; }
  .slot { min-width: 0; min-height: 54px; font-size: 12px; }
  .legend { gap: 13px; padding: 14px; }
  .camera-layout { grid-template-columns: 1fr; }
  .aisles { grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid var(--line); }
  .aisle { min-width: 0; padding: 0 9px; font-size: 10px; }
  .tabs button { min-width: 105px; min-height: 45px; padding: 0 14px; font-size: 12px; }
  .rack-wrap { padding: 14px 10px 18px; }
  .rack { min-width: 650px; grid-template-columns: 58px repeat(10, 1fr); gap: 6px; }
  .rack .slot { min-height: 90px; font-size: 9px; }
  .rack .slot b { font-size: 12px; }
  .rack-label { position: sticky; left: 0; z-index: 2; padding-left: 6px; background: #fff; }
  .detail-card { display: block; padding: 20px; }
  .detail-card .btn { min-height: 48px; }

  .table-wrap { overflow: visible; padding: 10px; }
  table, tbody, tr, td { display: block; width: 100%; }
  table { min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tbody tr { padding: 14px; background: #fff; border: 1px solid var(--line); }
  tbody tr:hover { background: #fff; }
  td { min-height: 31px; padding: 6px 0; display: grid; grid-template-columns: 94px minmax(0,1fr); gap: 10px; align-items: start; border: 0; font-size: 11px; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
  td:last-child { padding-top: 10px; border-top: 1px solid var(--line); }
}

@media (max-width: 420px) {
  .sidebar { width: min(280px, calc(100vw - 48px)); padding-top: 27px; }
  body.menu-open .mobile-menu { left: auto; right: 12px; }
  .side-brand img { width: 145px; }
  .side-brand span { font-size: 21px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 82px; }
  .stat-icon { display: none; }
  .stat-value { font-size: 27px; }
  .location-grid { grid-template-columns: repeat(3,1fr); }
  .panel-head { padding: 16px; }
  .detail-row { padding: 12px 0; }
}

/* Página Ingreso */
body.login-active .page-title { width: min(520px,100%); margin-inline: auto; }
.page-login { width: min(520px,100%); margin-inline: auto; padding: 28px; display: block; color: var(--ink); background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--green); box-shadow: 0 20px 50px rgba(16,39,27,.1); }
.page-login[hidden] { display: none; }
.login-intro { margin-bottom: 24px; display: flex; align-items: center; gap: 12px; }
.login-intro-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 13px; }
.login-intro-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.page-login-form { display: grid; gap: 17px; }
.page-login-form .login-field > span:first-child { color: #4f5c54; }
.login-control { position: relative; display: block; font-weight: 400; letter-spacing: normal; text-transform: none; }
.login-control > svg { position: absolute; z-index: 1; top: 50%; left: 14px; width: 19px; height: 19px; color: #748078; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transform: translateY(-50%); pointer-events: none; }
.page-login-form .login-control input { min-height: 52px; padding: 0 48px 0 44px; color: var(--ink); background: #f7faf8; border: 1px solid #d5ddd7; border-radius: 9px; font-size: 14px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.page-login-form .login-control input::placeholder { color: #9aa49e; }
.page-login-form .login-control input:focus { background: #fff; border-color: var(--green); box-shadow: 0 0 0 4px rgba(18,131,66,.1); }
.login-password-toggle { position: absolute; z-index: 2; top: 50%; right: 8px; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; color: #748078; background: transparent; border: 0; border-radius: 8px; cursor: pointer; transform: translateY(-50%); }
.login-password-toggle:hover { color: var(--green); background: var(--green-light); }
.login-password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-submit { min-height: 52px; margin-top: 3px; padding-inline: 20px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 9px; font-size: 13px; box-shadow: 0 10px 22px rgba(18,131,66,.2); }
.login-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.login-submit:hover svg { transform: translateX(3px); }
.login-message { min-height: 17px; margin: 13px 0 0; color: var(--green); font-size: 11px; line-height: 1.45; text-align: center; }
.login-message:empty { min-height: 0; margin-top: 0; }
.login-message.error { padding: 10px 12px; color: #8d1821; background: #fff1f2; border: 1px solid #f0c7ca; border-radius: 8px; }
.session-summary { display: flex; align-items: center; gap: 11px; padding: 9px 11px; background: #fff; border: 1px solid var(--line); }
.session-summary[hidden] { display: none; }
.session-avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 14px; font-weight: 600; }
.session-summary > span:nth-child(2) { display: grid; gap: 3px; }
.session-summary small { color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.session-summary strong { font-size: 11px; font-weight: 500; }
.session-summary button { min-height: 34px; margin-left: 8px; padding: 0 11px; color: var(--wine); background: #fff; border: 1px solid #d8bfc7; cursor: pointer; font-size: 9px; }
.module-session { width: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 11px; background: #fff; border: 1px solid var(--line); }
.module-session[hidden] { display: none; }
.module-session-avatar { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 14px; font-weight: 600; }
.module-session strong { font-size: 10px; font-weight: 500; white-space: nowrap; }
.module-session .btn { min-height: 34px; margin-left: 8px; padding: 0 11px; }
.camera-dispatch-shortcut { min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; color: #fff; background: var(--green); border: 1px solid var(--green); border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 600; white-space: nowrap; }
.camera-dispatch-shortcut[hidden] { display: none; }
.camera-dispatch-shortcut:hover { background: var(--green-dark); }
.camera-dispatch-shortcut.is-return { color: var(--forest); background: var(--green-light); }
.camera-dispatch-shortcut svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.user-form-message { grid-column: 1 / -1; min-height: 18px; margin: 0; color: var(--green); font-size: 11px; }
.user-form-message.error { color: var(--wine); }
.header-access { display: flex; align-items: end; gap: 10px; }
.header-access label { display: grid; gap: 7px; }
.header-access label span { color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.header-access select { min-width: 180px; min-height: 44px; padding: 0 35px 0 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); outline: none; }
.header-access select:focus { border-color: var(--green); }
.header-access .btn { min-height: 44px; white-space: nowrap; }
.login-symbol { margin-right: 5px; font-size: 16px; }
.access-panel { padding: 22px; display: grid; grid-template-columns: minmax(280px,1fr) 230px auto; gap: 20px; align-items: end; background: var(--forest); color: #fff; border: 1px solid var(--forest); }
.access-copy { display: flex; align-items: center; gap: 17px; }
.access-copy h2, .section-heading h2, .entry-head h2 { margin: 0; font-size: 22px; font-weight: 500; }
.access-copy p:not(.detail-kicker) { margin: 7px 0 0; color: #aab6af; font-size: 12px; line-height: 1.5; }
.access-copy .detail-kicker { color: #77b88d; }
.access-icon { flex: 0 0 50px; height: 50px; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); border-radius: 50%; font-size: 25px; }
.access-select, .entry-field { display: grid; gap: 8px; }
.access-select span, .entry-field > span { color: inherit; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.access-select select { min-height: 44px; padding: 0 12px; color: #fff; background: var(--forest-2); border: 1px solid #526159; outline: none; }
.access-button { min-height: 44px; }
.module-section { margin-top: 10px; padding: 8px; background: #fff; border: 1px solid var(--line); }
.section-heading { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading .detail-kicker { margin-bottom: 5px; }
.section-heading h2 { font-size: 18px; }
.role-badge, .step-chip { padding: 8px 11px; color: var(--green); background: var(--green-light); font-size: 10px; font-weight: 600; }
.module-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.module-card { min-height: 58px; padding: 8px 10px; display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; color: var(--ink); text-align: left; background: #fafbf8; border: 1px solid var(--line); cursor: pointer; }
.module-card:hover, .module-card.selected { border-color: var(--green); box-shadow: inset 0 -3px var(--green); }
.module-icon { position: relative; width: 34px; height: 34px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 10px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.module-icon::after { content: ""; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; background: var(--red); border: 2px solid #fff; border-radius: 50%; }
.module-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.module-card:hover .module-icon { transform: translateY(-2px); }
.module-card.selected .module-icon { color: #fff; background: var(--green); }
.module-card b, .module-card small { display: block; }
.module-card b { margin: 0; font-size: 11px; }
.module-card small { display: none; }
.module-card i { font-size: 11px; }
.module-card i { color: var(--wine); font-style: normal; }
.module-card.locked { opacity: .38; filter: grayscale(1); cursor: not-allowed; box-shadow: none; border-color: var(--line); }
.module-card.locked i { font-size: 0; }
.module-card.locked i::after { content: "Bloqueado"; font-size: 8px; color: var(--muted); }
.form-workspace { margin-top: 18px; scroll-margin-top: 20px; }
.workspace-empty { min-height: 230px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #cbd1cc; }
.workspace-empty span { color: var(--wine); font-size: 30px; }
.workspace-empty h2 { margin: 10px 0 4px; color: var(--ink); font-size: 18px; }
.workspace-empty p { margin: 0; font-size: 12px; }
.entry-module { background: #fff; border: 1px solid var(--line); }
.entry-head { padding: 24px; display: flex; align-items: start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.entry-head > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.entry-form { padding: 24px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; align-items: end; }
.reception-truck-form { grid-template-columns: minmax(220px,1fr) minmax(180px,.7fr) auto; }
.entry-form-dense { grid-template-columns: repeat(4,minmax(0,1fr)); }
.entry-field > span { color: #5f6a63; }
.entry-field input, .entry-field select { width: 100%; min-width: 0; min-height: 45px; padding: 0 12px; color: var(--ink); background: #fafbf8; border: 1px solid #d9ded9; outline: none; }
.entry-field input:focus, .entry-field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,131,66,.1); }
.uppercase { text-transform: uppercase; }
.form-actions { display: flex; justify-content: end; gap: 10px; }
.form-actions-full { grid-column: 1 / -1; }
.btn-muted { color: var(--muted); background: #fff; border-color: #cdd3ce; }
.entry-tabs { padding: 0 24px; display: flex; border-bottom: 1px solid var(--line); }
.entry-tabs button { min-height: 49px; padding: 0 22px; color: var(--muted); background: #fff; border: 0; cursor: pointer; }
.entry-tabs button.active { color: var(--wine); box-shadow: inset 0 -3px var(--wine); }
.scan-row { padding: 24px 24px 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.scan-button { min-height: 45px; padding: 0 16px; color: var(--wine); background: #fff; border: 1px solid var(--wine); cursor: pointer; }
.reception-summary { display: grid; grid-template-columns: repeat(3,1fr); background: var(--forest); color: #fff; }
.reception-summary > div { min-height: 62px; padding: 11px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-right: 1px solid rgba(255,255,255,.13); }
.reception-summary > div:last-child { border-right: 0; }
.reception-summary span { color: #9fada5; font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.reception-summary strong { font-size: 19px; font-weight: 500; }
.reception-total-item { position: relative; }
.reception-total-trigger { padding: 2px 7px; color: #fff; background: transparent; border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 19px; font-weight: 500; }
.reception-total-trigger:hover, .reception-total-trigger:focus-visible, .reception-total-trigger[aria-expanded="true"] { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); outline: 0; }
.reception-total-popover { position: absolute; top: calc(100% - 5px); right: 18px; z-index: 35; width: max-content; padding: 6px; background: #fff; border: 1px solid #d8bfc7; box-shadow: 0 12px 30px rgba(32,24,27,.24); }
.reception-total-popover[hidden] { display: none; }
.reception-total-popover button { min-height: 34px; padding: 0 11px; color: var(--wine); background: #fff8fa; border: 1px solid var(--wine); cursor: pointer; font-size: 9px; font-weight: 600; white-space: nowrap; }
.reception-quantity-editor { position: fixed; inset: 0; z-index: 210; padding: 16px; display: grid; place-items: center; }
.reception-quantity-editor[hidden] { display: none; }
.reception-editor-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(20,29,24,.56); border: 0; }
.reception-quantity-dialog { position: relative; z-index: 1; width: min(390px,100%); padding: 22px; background: #fff; border-top: 4px solid var(--wine); box-shadow: 0 24px 70px rgba(0,0,0,.35); animation: selectedPalletEnter .2s ease both; }
.reception-quantity-dialog > small { color: var(--wine); font-size: 8px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.reception-quantity-dialog h3 { margin: 5px 34px 6px 0; font-size: 20px; font-weight: 500; }
.reception-quantity-dialog > p:not(.user-form-message) { margin: 0 0 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.reception-editor-actions { margin-top: 15px; display: flex; justify-content: flex-end; gap: 8px; }
body.reception-editor-open { overflow: hidden; }
.pallet-scan-step { padding: 24px; background: #f3f1f0; }
.pallet-scan-title { width: min(900px,100%); min-height: 78px; margin: 0 auto 16px; padding: 18px 34px; display: flex; align-items: center; color: #fff; background: linear-gradient(105deg,var(--green-dark),var(--green)); border-radius: 12px; box-shadow: 0 8px 18px rgba(12,73,38,.2); }
.pallet-scan-title h2 { margin: 0; font-size: clamp(24px,3vw,36px); font-weight: 500; letter-spacing: -.03em; }
.pallet-scan-card { width: min(900px,100%); margin: 0 auto; padding: 30px; background: #fff; border-radius: 12px; box-shadow: 0 8px 20px rgba(25,35,30,.14); }
.pallet-scan-surface { min-height: 330px; padding: 28px; display: grid; place-items: center; align-content: center; gap: 16px; background: #ebeceb; border-radius: 12px; }
.pallet-camera-button { width: min(230px,100%); aspect-ratio: 1; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; color: #fff; background: linear-gradient(145deg,var(--green),var(--green-dark)); border: 0; border-radius: 12px; cursor: pointer; box-shadow: 0 12px 28px rgba(12,73,38,.24); transition: transform .18s ease, box-shadow .18s ease; }
.pallet-camera-button:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(125,13,43,.25); }
.pallet-camera-button:disabled { opacity: .6; cursor: wait; transform: none; }
.pallet-camera-button svg { width: 58px; height: 58px; fill: currentColor; }
.pallet-camera-button strong { font-size: 16px; }
.pallet-camera-button small { color: rgba(255,255,255,.72); font-size: 11px; }
.pallet-file-button { min-width: 230px; }
.pallet-file-button[hidden] { display: none; }
.pallet-scan-message { min-height: 18px; margin: 0; color: var(--muted); text-align: center; font-size: 10px; }
.pallet-scan-message.error { color: var(--wine); }
.reception-folio-log { width: min(520px,100%); padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.reception-folio-log[hidden] { display: none; }
.reception-folio-log header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reception-folio-log header span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.reception-folio-log header strong { min-width: 24px; height: 24px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 12px; font-size: 9px; }
.reception-folio-log ol { max-height: 112px; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; overflow-y: auto; list-style: none; }
.reception-folio-log li { min-width: 0; padding: 7px 8px; display: flex; align-items: center; gap: 7px; background: #f4f8f5; border: 1px solid #dce7df; border-radius: 6px; }
.reception-folio-log li span { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 50%; font-size: 7px; font-weight: 700; }
.reception-folio-log li strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pallet-camera-inline { width: min(230px,100%); display: grid; gap: 12px; }
.pallet-camera-inline[hidden], .pallet-read-result[hidden], .reception-guide-step[hidden], .pallet-reception-complete[hidden] { display: none; }
.pallet-camera-view { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: #101713; border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.pallet-camera-view video { width: 100%; height: 100%; object-fit: cover; }
.pallet-camera-view > span { position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.9); box-shadow: 0 0 0 999px rgba(0,0,0,.2); pointer-events: none; }
.pallet-read-result { padding: 24px; background: #fff; }
.pallet-read-head { margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.pallet-read-head span { display: block; font-size: 12px; font-weight: 600; }
.pallet-read-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.pallet-read-head > strong { flex: 0 0 auto; color: var(--wine); font-size: 11px; }
.pallet-read-result dl { margin: 0 0 20px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.pallet-read-result dl div { min-width: 0; padding: 12px; background: #f7f8f5; border: 1px solid var(--line); }
.pallet-read-result dt { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 600; letter-spacing: .06em; }
.pallet-read-result dd { min-height: 17px; margin: 6px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; }
.pallet-read-result .form-actions { justify-content: flex-end; }
.reception-guide-step { min-height: 330px; padding: 28px; display: grid; place-items: center; background: #f3f1f0; }
.reception-guide-card { width: min(620px,100%); padding: 28px; background: #fff; border-top: 4px solid var(--wine); box-shadow: 0 12px 32px rgba(30,39,34,.15); }
.reception-guide-card > small { color: var(--wine); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.reception-guide-card h3 { margin: 0 0 18px; font-size: 21px; font-weight: 500; }
.reception-guide-card > p { margin: 0 0 20px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.reception-guide-card form { display: grid; gap: 13px; }
.reception-guide-card .entry-field[hidden] { display: none; }
.reception-add-guide { justify-self: start; min-height: 34px; padding: 0; color: var(--wine); background: transparent; border: 0; cursor: pointer; font-size: 9px; font-weight: 700; }
.reception-add-guide[hidden] { display: none; }
.reception-guide-folio-log { margin-top: 3px; }
.reception-guide-card .user-form-message { margin: 0; }
.reception-guide-card .form-actions { margin-top: 2px; justify-content: flex-end; }
.pallet-reception-complete { min-height: 270px; padding: 32px; display: grid; place-items: center; align-content: center; text-align: center; background: #f7f8f5; }
.pallet-reception-complete > span { width: 54px; height: 54px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 25px; }
.pallet-reception-complete h3 { margin: 15px 0 6px; font-size: 20px; font-weight: 500; }
.pallet-reception-complete p { margin: 0; color: var(--muted); font-size: 11px; }
.reception-final-report { width: min(900px,100%); min-height: 0; margin: 0 auto; padding: 28px 28px 100px; display: block; text-align: left; background: #fff; }
.reception-final-report > header { padding: 24px; color: #fff; background: linear-gradient(110deg,var(--green-dark),var(--green)); }
.reception-final-report > header h3 { margin: 0; font-size: 24px; letter-spacing: .02em; }
.reception-final-summary { margin: 0; padding: 18px 20px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.reception-final-summary > div { padding: 16px 18px; display: grid; gap: 5px; background: #f4f8f5; border: 1px solid var(--line); }
.reception-final-summary small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.reception-final-summary strong { font-size: 22px; }
.reception-final-guides { min-height: 0; margin: 0; padding: 0 20px; display: block; background: transparent; }
.reception-final-guides .reception-guide-card { width: 100%; padding: 20px 0; background: transparent; border-top: 0; border-bottom: 1px solid var(--line); box-shadow: none; }
.reception-final-guides .reception-guide-card form { grid-template-columns: repeat(2,minmax(0,1fr)); }
.reception-final-guides .reception-guide-card h3, .reception-final-guides .reception-add-guide, .reception-final-guides .user-form-message { grid-column: 1 / -1; }
.reception-final-folios { width: auto; max-height: 360px; margin: 0 20px; padding: 20px 0; overflow: auto; background: transparent; border: 0; border-radius: 0; }
.reception-final-folios ol { max-height: 280px; grid-template-columns: 1fr; }
.reception-final-folios header > span { display: grid; gap: 3px; }
.reception-final-folios header small { color: var(--muted); font-size: 8px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.reception-final-folios li.pallet-fumigated { color: #fff; background: #236f93; border-color: #236f93; }
.reception-final-folios li.pallet-fumigated span { color: #dceef6; }
.reception-final-folios li.fumigation-selectable { cursor: pointer; user-select: none; }
.reception-final-folios li.fumigation-selectable:hover { border-color: var(--wine); }
.reception-final-folios li.fumigation-selectable.selected-for-fumigation { color: var(--wine); background: #fff1f3; border-color: var(--wine); box-shadow: inset 4px 0 0 var(--wine); }
.reception-final-folios li.fumigation-selectable.selected-for-fumigation span { color: var(--wine); }
.reception-final-message { min-height: 20px; margin: 14px 0 0 !important; text-align: center; }
.reception-final-message.success { color: var(--green-dark); }
.reception-final-actions { position: fixed; z-index: 190; left: calc(50% + var(--sidebar-half)); bottom: max(14px,env(safe-area-inset-bottom)); width: min(700px,calc(100vw - var(--sidebar) - 24px)); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; transform: translateX(-50%); }
.reception-final-actions .btn { min-height: 54px; border-radius: 0; font-size: 12px; font-weight: 700; box-shadow: 0 6px 16px rgba(18,131,66,.2); }
.reception-final-actions .btn.is-selecting { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 8px 20px rgba(172,25,36,.3); }
.reception-final-actions .is-fumigated, .reception-final-actions .is-fumigated:disabled { color: #fff; background: #236f93; border-color: #236f93; opacity: 1; cursor: default; }
.pallet-fumigated { --pallet-condition-blue: #236f93; }
.process-pallet-item.pallet-fumigated, .tunnel-popover-pallet.pallet-fumigated, .camera-popover-pallet.pallet-fumigated, .tunnel-release-item.pallet-fumigated, .camera-dispatch-picker-item.pallet-fumigated { color: #fff; background: var(--pallet-condition-blue); border-color: var(--pallet-condition-blue); }
button.pallet-fumigated { color: #fff; background: #236f93; border-color: #236f93; }
.process-pallet-item.pallet-fumigated small, .tunnel-popover-pallet.pallet-fumigated small, .camera-popover-pallet.pallet-fumigated small, .tunnel-release-item.pallet-fumigated small, .camera-dispatch-picker-item.pallet-fumigated small, .camera-dispatch-picker-item.pallet-fumigated em { color: #dceef6; }
.visual-table-wrap tr.pallet-fumigated td { background: #e8f4fa; }
.visual-table-wrap tr.pallet-fumigated .visual-primary-cell { color: #236f93; }
.visual-primary-cell.pallet-fumigated { color: #236f93; background: #e8f4fa; }
.pallet-register-table tr.pallet-fumigated td { background: #e8f4fa; }
.pallet-register-table tr.pallet-fumigated td:first-child, .pallet-register-table tr.pallet-fumigated td:nth-child(2) { color: #236f93; font-weight: 700; }
.tunnel-full-slot i.occupied.pallet-fumigated, .camera-full-slot i.occupied.pallet-fumigated { color: #fff; background: #236f93; border-color: #236f93; box-shadow: 0 0 0 2px rgba(35,111,147,.2); }
@media (max-width: 900px) {
  .reception-final-report { padding: 16px 12px 92px; }
  .reception-final-actions { right: 8px; left: 8px; width: auto; transform: none; }
}
@media (max-width: 520px) {
  .reception-final-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reception-final-summary > div { padding: 13px 10px; }
  .reception-final-summary strong { font-size: 18px; }
  .reception-final-guides .reception-guide-card form { grid-template-columns: 1fr; }
}
.assignment-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); }
.pending-list { padding: 20px; display: grid; align-content: start; gap: 8px; border-right: 1px solid var(--line); }
.pending-list h3, .camera-step h3 { margin: 0 0 10px; font-size: 13px; font-weight: 500; }
.pending-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pending-list-head h3 { margin: 0; }
.pending-list-head strong { min-width: 25px; height: 25px; display: grid; place-items: center; color: #fff; background: var(--wine); font-size: 10px; font-weight: 600; }
#tunnelPendingItems { display: grid; gap: 8px; }
.pending-list-empty { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.pending-list-empty[hidden] { display: none; }
.pending-pallet { min-height: 44px; padding: 10px 12px; display: grid; place-items: center; color: var(--ink); text-align: center; background: #fafbf8; border: 1px solid var(--line); cursor: pointer; }
.pending-pallet b { font-size: 11px; font-weight: 600; }
.pending-pallet span { color: var(--muted); font-size: 10px; }
.pending-pallet .pallet-status { margin-top: 3px; }
.pending-pallet.active { color: var(--wine); border-color: var(--wine); background: #fff8fa; }
.position-picker { padding: 22px; min-width: 0; }
.tunnel-mobile-selection { display: none; }
.picker-toolbar { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.selection-summary { text-align: right; }
.selection-summary small, .final-location small, .scanned-pallet small { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.selection-summary strong { display: block; margin-top: 5px; color: var(--wine); font-size: 13px; }
.compact-rack { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(70px,1fr) minmax(70px,1fr) 20px minmax(70px,1fr) minmax(70px,1fr); gap: 7px; align-items: stretch; overflow-x: auto; padding: 4px 4px 14px; }
.tunnel-column { min-width: 0; display: grid; grid-template-rows: auto 1fr; gap: 7px; }
.tunnel-column-title { min-height: 43px; padding: 7px 5px; display: grid; place-items: center; align-content: center; color: var(--forest); text-align: center; background: #f1f3ef; border: 1px solid var(--line); }
.tunnel-column-title b { font-size: 10px; font-weight: 600; }
.tunnel-column-title small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.tunnel-column-slots { display: grid; align-content: start; gap: 4px; }
.tunnel-column-separator { width: 100%; height: 100%; display: block; background: #f1f3ef; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.compact-slot { min-height: 34px; padding: 2px; color: var(--green); background: #f2f8f4; border: 1px solid #bcd8c6; cursor: pointer; font-size: 9px; }
.compact-slot.occupied { color: #9ba49e; background: #ecefeb; border-color: #d9ded9; cursor: not-allowed; }
.compact-slot.selected { color: #fff; background: var(--wine); border-color: var(--wine); }
.position-legend { margin-top: 12px; display: flex; gap: 18px; color: var(--muted); font-size: 9px; }
.position-legend span { display: flex; align-items: center; gap: 6px; }
.position-legend i { width: 12px; height: 12px; background: #f2f8f4; border: 1px solid #bcd8c6; }
.position-legend i.occupied { background: #ecefeb; border-color: #d9ded9; }
.position-legend i.chosen { background: var(--wine); border-color: var(--wine); }
.confirm-position { display: none; }
.confirm-position[hidden] { display: none; }
.confirm-position.is-floating { position: fixed; z-index: 125; min-height: 42px; margin: 0; display: block; white-space: nowrap; box-shadow: 0 12px 28px rgba(62,21,34,.28); animation: floatingConfirmEnter .18s ease both; }
.confirm-camera-position { display: none; }
.confirm-camera-position[hidden] { display: none; }
.confirm-camera-position.is-floating { position: fixed; z-index: 125; min-height: 42px; margin: 0; display: block; white-space: nowrap; box-shadow: 0 12px 28px rgba(62,21,34,.28); animation: floatingConfirmEnter .18s ease both; }
.tunnel-assignment-message { margin-top: 10px; text-align: right; }
.camera-workflow > section[hidden] { display: none; }
.camera-level-step { position: relative; padding: 26px 28px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 24px; background: #fff; }
.camera-level-step > div:first-of-type { display: grid; gap: 5px; }
.camera-level-step > div > small { color: var(--muted); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.camera-level-step h3 { margin: 0; font-size: 20px; font-weight: 500; }
.camera-level-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.camera-level-options button { min-width: 112px; min-height: 68px; color: var(--muted); background: #fafbf8; border: 1px solid var(--line); cursor: pointer; }
.camera-level-options b, .camera-level-options span { display: block; }
.camera-level-options b { color: var(--ink); font-size: 18px; }
.camera-level-options span { margin-top: 3px; font-size: 10px; }
.camera-level-options button.active { color: #fff; background: #236f93; border-color: #236f93; }
.camera-level-options button.active b { color: #fff; }
.camera-pallet-list { padding: 20px 24px; background: #f7f9fb; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.camera-pallet-list-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.camera-pallet-list-head > div:first-child { display: grid; gap: 3px; }
.camera-pallet-list-head span { color: var(--ink); font-size: 12px; font-weight: 600; }
.camera-pallet-list-head small { color: #49758c; font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.camera-pallet-list-head > div:last-child { display: flex; align-items: center; gap: 8px; }
.camera-pallet-list-head > div:last-child > strong { min-width: 27px; height: 27px; display: grid; place-items: center; color: #fff; background: #236f93; font-size: 10px; }
.camera-pallet-list-head button, .camera-selected-pallet button { min-height: 31px; padding: 0 10px; color: #236f93; background: #fff; border: 1px solid #236f93; cursor: pointer; font-size: 8px; font-weight: 600; }
.camera-pallet-search { margin-bottom: 12px; display: grid; gap: 5px; }
.camera-pallet-search span { color: var(--muted); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.camera-pallet-search input { width: 100%; min-height: 40px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #c8dce6; outline: 0; }
.camera-pallet-search input:focus { border-color: #236f93; box-shadow: 0 0 0 3px rgba(35,111,147,.1); }
#cameraPalletItems { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 8px; }
.camera-pallet-item { min-height: 49px; padding: 9px 11px; display: grid; gap: 3px; color: var(--ink); text-align: left; background: #fff; border: 1px solid #c8dce6; cursor: pointer; }
.camera-pallet-item b { font-size: 11px; font-weight: 600; }
.camera-pallet-item small { color: #236f93; font-size: 8px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.camera-pallet-item.active { color: #fff; background: #236f93; border-color: #236f93; }
.camera-pallet-item.active small { color: #dceef6; }
.camera-pallet-empty { margin: 0; color: var(--muted); font-size: 10px; }
.camera-pallet-empty[hidden] { display: none; }
.camera-pallet-list.is-entering, .camera-location-step.is-entering { animation: tunnelMapEnter .28s ease both; }
.camera-pallet-list.is-returning, .camera-location-step.is-returning { animation: tunnelMapReturn .18s ease both; }
.camera-pallet-item.moving-up { position: relative; z-index: 2; animation: palletMoveUp .22s ease both; }
.camera-location-step { padding: 22px 24px 26px; background: #fff; border-top: 1px solid var(--line); }
.camera-selected-pallet { position: sticky; top: 66px; z-index: 5; margin-bottom: 18px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f2f8fb; border: 1px solid #236f93; box-shadow: 0 8px 22px rgba(31,72,92,.1); }
.camera-selected-pallet span { min-width: 0; display: grid; gap: 3px; }
.camera-selected-pallet small { color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.camera-selected-pallet strong { overflow: hidden; color: #236f93; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.camera-location-toolbar { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.camera-location-toolbar .entry-field { min-width: 220px; }
.camera-location-toolbar > div { text-align: right; }
.camera-location-toolbar > div small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.camera-location-toolbar > div strong { display: block; margin-top: 5px; color: #236f93; font-size: 13px; }
.camera-storage-map { width: 100%; min-width: 0; min-height: 220px; display: grid; grid-template-columns: repeat(10,minmax(58px,1fr)); gap: 6px; overflow-x: auto; padding: 4px 4px 14px; }
.camera-storage-map-two { max-width: 440px; grid-template-columns: repeat(2,minmax(100px,1fr)); margin-inline: auto; }
.camera-storage-map > p { grid-column: 1 / -1; place-self: center; color: var(--muted); font-size: 11px; }
.camera-storage-column { min-width: 0; display: grid; grid-template-rows: auto 1fr; gap: 6px; }
.camera-storage-column-title { min-height: 38px; padding: 5px 3px; display: grid; place-items: center; color: #315f75; text-align: center; background: #eaf3f7; border: 1px solid #c8dce6; font-size: 8px; font-weight: 600; }
.camera-storage-column-slots { display: grid; align-content: start; gap: 4px; }
.camera-storage-slot { min-height: 31px; padding: 2px; color: #236f93; background: #f4f9fb; border: 1px solid #c8dce6; cursor: pointer; font-size: 8px; }
.camera-storage-slot.occupied { color: #9ba7ad; background: #eceff0; border-color: #d9dfe1; cursor: not-allowed; }
.camera-storage-slot.selected { color: #fff; background: var(--wine); border-color: var(--wine); }
.camera-assignment-message { margin-top: 11px; text-align: right; }
.camera-map-stage { padding: clamp(10px,1.8vh,18px) 20px clamp(12px,2vh,20px); background: #fff; }
.camera-map-toolbar { margin-bottom: clamp(7px,1.2vh,11px); display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.camera-map-toolbar .entry-field { min-width: 230px; }
.camera-map-toolbar > div { text-align: right; }
.camera-map-toolbar small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.camera-map-toolbar strong { display: block; margin-top: 5px; color: #236f93; font-size: 13px; }
.camera-map-heading { min-width: 0; display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; }
.camera-map-heading > div { min-width: 0; }
.camera-return-batch-button { min-height: 42px; padding: 5px 7px 5px 12px; display: inline-flex; align-items: center; gap: 9px; color: #fff; background: #151817; border: 1px solid #151817; border-radius: 8px; cursor: pointer; font-size: 9px; font-weight: 700; white-space: nowrap; box-shadow: 0 7px 18px rgba(10,18,14,.2); }
.camera-return-batch-button b { width: 24px; height: 24px; display: grid; place-items: center; color: #151817; background: #fff; border-radius: 50%; font-size: 9px; }
.camera-return-batch-button:hover { background: #000; border-color: #000; transform: translateY(-1px); }
.camera-return-batch-button.active { background: #000; border-color: #d7a54a; box-shadow: 0 0 0 2px rgba(215,165,74,.28),0 8px 20px rgba(10,18,14,.25); }
.camera-return-batch-button.active b { color: #fff; background: #c78115; }
.camera-return-batch-button:disabled { opacity: .58; cursor: wait; transform: none; }
.camera-full-map { width: 100%; min-width: 0; min-height: 260px; display: grid; grid-template-columns: repeat(10,minmax(68px,1fr)); gap: 7px; overflow-x: auto; padding: 4px 4px 14px; }
.camera-full-map > p { grid-column: 1/-1; place-self: center; color: var(--muted); font-size: 11px; }
.camera-full-column { min-width: 0; display: grid; grid-template-rows: auto 1fr; gap: 6px; }
.camera-full-column-title { min-height: 38px; padding: 5px 3px; display: grid; place-items: center; color: #315f75; text-align: center; background: #eaf3f7; border: 1px solid #c8dce6; font-size: 8px; font-weight: 600; }
.camera-full-column-slots { display: grid; align-content: start; gap: 4px; }
.camera-full-slot { min-height: 39px; padding: 4px 5px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px; color: #236f93; background: #f4f9fb; border: 1px solid #c8dce6; cursor: pointer; }
.camera-full-slot:hover, .camera-full-slot:focus-visible { border-color: #236f93; box-shadow: 0 0 0 2px rgba(35,111,147,.12); outline: 0; }
.camera-full-slot.selected { border-color: var(--wine); box-shadow: 0 0 0 2px rgba(116,32,62,.16); }
.camera-full-slot b { font-size: 9px; font-weight: 600; }
.camera-full-slot span { display: flex; gap: 2px; }
.camera-full-slot i { width: 15px; height: 15px; display: grid; place-items: center; color: #79919d; background: #e6f0f4; border: 1px solid #c8dce6; font-size: 7px; font-style: normal; font-weight: 700; }
.camera-full-slot i:first-child.occupied { color: #fff; background: #236f93; border-color: #236f93; }
.camera-full-slot i:last-child.occupied { color: #fff; background: var(--wine); border-color: var(--wine); }
.camera-full-slot.full { color: #fff; background: #39463f; border-color: #39463f; }
.camera-full-slot.return-selected { outline: 2px solid #111; outline-offset: 1px; box-shadow: 0 0 0 4px rgba(210,138,32,.2); }
.camera-map-legend { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 9px 18px; color: var(--muted); font-size: 9px; }
.camera-map-legend span { display: flex; align-items: center; gap: 6px; }
.camera-map-legend i { width: 12px; height: 12px; background: #f4f9fb; border: 1px solid #c8dce6; }
.camera-map-legend i.floor { background: #236f93; border-color: #236f93; }
.camera-map-legend i.height { background: var(--wine); border-color: var(--wine); }
.camera-map-legend i.full { background: #39463f; border-color: #39463f; }
.camera-full-map.is-reloading { animation: cameraMapReload .16s ease both; pointer-events: none; }
.camera-full-map.is-entering { animation: tunnelMapEnter .25s ease both; }
.camera-assignment-popover { position: fixed; z-index: 130; width: min(350px,calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; padding: 18px; background: #fff; border: 1px solid #c8dce6; box-shadow: 0 18px 50px rgba(28,47,57,.28); }
body.camera-modal-open { overflow: hidden; }
.camera-assignment-popover[hidden] { display: none; }
.camera-assignment-popover.is-open { animation: selectedPalletEnter .2s ease both; }
.camera-assignment-popover.is-switching { animation: cameraPopoverSwitch .16s ease both; pointer-events: none; }
.camera-popover-close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; padding: 0; color: var(--muted); background: #f1f4f3; border: 0; cursor: pointer; font-size: 20px; line-height: 1; }
.camera-popover-head { padding-right: 32px; display: grid; gap: 4px; }
.camera-popover-head small, .camera-pallet-stage-head small { color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.camera-popover-head strong { color: #236f93; font-size: 12px; line-height: 1.4; }
.camera-occupied-actions { margin-top: 16px; padding: 15px; background: linear-gradient(145deg,#f6faf7,#edf5ef); border: 1px solid #cbdcd0; border-radius: 10px; }
.camera-occupied-actions[hidden] { display: none; }
.camera-occupied-actions > small { color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.camera-occupied-actions > strong { display: block; margin-top: 4px; color: var(--forest); font-size: 18px; }
.camera-occupied-actions > p { margin: 7px 0 13px; color: var(--muted); font-size: 9px; }
.camera-occupied-actions > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.camera-occupied-actions .btn { min-width: 0; min-height: 42px; padding-inline: 8px; font-size: 9px; }
.camera-return-tunnel-button { background: var(--green); border-color: var(--green); }
.assignment-qr-stage { margin-top: 17px; display: grid; justify-items: center; gap: 11px; }
.assignment-qr-stage[hidden], .assignment-qr-camera[hidden] { display: none; }
.assignment-qr-stage > p:first-child { margin: 0; color: var(--ink); font-size: 10px; text-align: center; }
.assignment-qr-button { width: 150px; min-height: 138px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff; background: linear-gradient(145deg,var(--green),var(--green-dark)); border: 0; border-radius: 10px; cursor: pointer; box-shadow: 0 9px 20px rgba(12,73,38,.2); }
.assignment-qr-button:disabled { opacity: .6; cursor: wait; }
.assignment-qr-button svg { width: 44px; height: 44px; fill: currentColor; }
.assignment-qr-button strong { font-size: 13px; }
.assignment-qr-button small { color: rgba(255,255,255,.75); font-size: 8px; }
.assignment-qr-file { width: 100%; }
.assignment-qr-file[hidden] { display: none; }
.assignment-qr-camera { width: min(420px,100%); display: grid; gap: 12px; }
.assignment-qr-camera .pallet-camera-view { aspect-ratio: 1; }
.assignment-qr-message { min-height: 16px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; text-align: center; }
.assignment-qr-message.error { color: var(--wine); }
.assignment-manual-button { width: 100%; min-height: 38px; color: var(--green); background: #fff; border: 1px solid var(--green); cursor: pointer; font-size: 9px; font-weight: 700; }
.tunnel-workflow > .assignment-qr-stage, .camera-workflow > .assignment-qr-stage { width: min(520px,calc(100% - 24px)); min-height: 440px; margin: 24px auto; padding: 32px; align-content: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(28,47,57,.12); }
.tunnel-workflow > .assignment-qr-stage .assignment-qr-button, .camera-workflow > .assignment-qr-stage .assignment-qr-button { width: min(220px,100%); min-height: 205px; }
.tunnel-map-stage[hidden], .assignment-next-button[hidden] { display: none; }
.assignment-next-button { position: fixed; z-index: 190; left: 50%; bottom: max(16px,env(safe-area-inset-bottom)); width: min(420px,calc(100vw - 24px)); min-height: 54px; margin: 0; display: block; transform: translateX(-50%); box-shadow: 0 12px 30px rgba(12,73,38,.3); font-size: 14px; }
.assignment-next-button.is-context:disabled { opacity: 1; cursor: default; }
.assignment-next-button.is-context:disabled:hover { background: var(--green); border-color: var(--green); }
.assignment-next-button.is-relocating,
.assignment-next-button.is-relocating:disabled:hover { background: var(--wine); border-color: var(--wine); box-shadow: 0 12px 30px rgba(132,19,27,.3); }
.tunnel-pallet-action-bar { position: fixed; z-index: 190; left: calc(50% + var(--sidebar-half)); bottom: max(14px,env(safe-area-inset-bottom)); width: min(720px,calc(100vw - var(--sidebar) - 24px)); padding: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; background: transparent; border: 0; box-shadow: none; transform: translateX(-50%); }
.tunnel-pallet-action-bar button { width: 100%; min-width: 0; min-height: 54px; padding: 6px 9px; color: #fff; background: var(--green); border: 1px solid rgba(255,255,255,.16); cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.2; box-shadow: 0 6px 16px rgba(18,131,66,.2),0 0 14px rgba(18,131,66,.08); }
.tunnel-pallet-action-bar button:hover { background: var(--green-dark); border-color: var(--green-dark); }
.tunnel-pallet-action-bar button.active { background: var(--green-dark); border-color: #fff; box-shadow: 0 0 0 2px var(--green-dark),0 10px 22px rgba(12,73,38,.3); }
.camera-level-stage > p:first-child { margin: 17px 0 10px; color: var(--ink); font-size: 10px; }
.camera-assignment-popover .camera-level-options button { min-width: 0; min-height: 75px; padding: 7px; }
.camera-assignment-popover .camera-level-options button small { display: block; margin-top: 4px; color: #3f805c; font-size: 7px; text-transform: uppercase; }
.camera-assignment-popover .camera-level-options button.occupied { color: var(--wine); background: #fff8fa; border-color: var(--wine); cursor: pointer; opacity: 1; }
.camera-assignment-popover .camera-level-options button.occupied small { overflow: hidden; color: var(--wine); font-size: 8px; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.camera-assignment-popover .camera-level-options button.occupied:disabled { color: #8c9690; background: #eef1ef; border-color: #d9ded9; cursor: not-allowed; opacity: .65; }
.camera-assignment-popover .camera-level-options button.blocked-by-floor:disabled { color: #8b542a; background: #fff4e8; border-color: #e4c49c; cursor: not-allowed; opacity: 1; }
.camera-assignment-popover .camera-level-options button.blocked-by-floor:disabled small { color: #8b542a; white-space: normal; }
.camera-pallet-search[hidden], .camera-popover-pallets[hidden] { display: none !important; }
.camera-relocation-bar { margin: 12px 0 0; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; background: var(--wine); animation: selectedPalletEnter .2s ease both; }
.camera-relocation-bar[hidden] { display: none; }
.camera-relocation-bar span { min-width: 0; display: grid; gap: 2px; }
.camera-relocation-bar small { color: #f1dce4; font-size: 7px; letter-spacing: .07em; text-transform: uppercase; }
.camera-relocation-bar strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.camera-relocation-bar > div { display: flex; gap: 6px; }
.camera-relocation-bar button { min-height: 30px; padding: 0 9px; flex: 0 0 auto; color: var(--wine); background: #fff; border: 0; cursor: pointer; font-size: 8px; font-weight: 600; }
.camera-pallet-action-bar { position: fixed; z-index: 190; left: calc(50% + var(--sidebar-half)); bottom: max(14px,env(safe-area-inset-bottom)); width: min(820px,calc(100vw - var(--sidebar) - 24px)); padding: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; background: transparent; border: 0; box-shadow: none; transform: translateX(-50%); animation: actionBarFade .2s ease both; }
.camera-pallet-action-bar[hidden] { display: none; }
.camera-pallet-action-bar button { min-width: 0; min-height: 54px; padding: 6px 9px; color: #fff; background: var(--green); border: 1px solid rgba(255,255,255,.16); border-radius: 0; cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.2; box-shadow: 0 6px 16px rgba(18,131,66,.2),0 0 14px rgba(18,131,66,.08); transition: background .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease; }
.camera-pallet-action-bar button:hover { background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); }
.camera-pallet-action-bar button:disabled { cursor: wait; opacity: .55; transform: none; }
.camera-pallet-action-bar button.active { background: var(--green-dark); border-color: #fff; box-shadow: 0 0 0 2px var(--green-dark),0 10px 22px rgba(12,73,38,.3); }

.process-workspace { width: min(1040px,100%); margin: 0 auto; padding-bottom: 68px; display: grid; gap: 8px; }
.process-filter-section > small, .process-list-panel header small { display: block; color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.process-search { margin: 0; padding: 8px 10px; background: #fff; border: 1px solid var(--line); }
.process-search span { font-size: 7px; }
.process-search input { min-height: 36px; }
.process-filter-section { min-width: 0; padding: 7px 9px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); }
.process-tunnel-filters { min-width: 0; padding: 2px 2px 5px; display: flex; justify-content: flex-start; gap: 5px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.process-tunnel-filters button { position: relative; min-width: 42px; min-height: 32px; padding: 4px 10px; flex: 0 0 auto; color: var(--green); background: #fff; border: 1px solid var(--green); border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 700; box-shadow: 0 4px 10px rgba(18,131,66,.08); }
.process-tunnel-filters button::after { content: ""; position: absolute; top: 4px; right: 4px; width: 4px; height: 4px; background: #c6cec9; border-radius: 50%; opacity: .45; }
.process-tunnel-filters button.has-pallet::after { background: #20c768; opacity: 1; box-shadow: 0 0 7px rgba(32,199,104,.75); }
.process-tunnel-filters button.active { color: #fff; background: var(--green); box-shadow: 0 6px 14px rgba(18,131,66,.2); }
.process-tunnel-filters button.active.has-pallet::after { background: #fff; box-shadow: 0 0 7px rgba(255,255,255,.9); }
.process-stage-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.process-stage-filters button { position: relative; min-width: 0; min-height: 66px; padding: 7px 8px; display: grid; grid-template-columns: 27px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; gap: 1px 7px; color: var(--forest); text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; box-shadow: 0 5px 14px rgba(16,39,27,.07); }
.process-stage-filters button::after { content: ""; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; background: #c6cec9; border-radius: 50%; opacity: .45; transition: opacity .18s ease,background .18s ease,box-shadow .18s ease; }
.process-stage-filters button.has-data::after { background: #20c768; opacity: 1; box-shadow: 0 0 0 3px rgba(32,199,104,.15),0 0 8px rgba(32,199,104,.7); }
.process-stage-filters button b { grid-row: 1 / 3; width: 27px; height: 27px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 11px; }
.process-stage-filters button span { overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.process-stage-filters button small { color: var(--muted); font-size: 8px; }
.process-stage-filters button.active { color: #fff; background: var(--green-dark); border-color: var(--green-dark); box-shadow: 0 10px 24px rgba(12,73,38,.24); transform: translateY(-1px); }
.process-stage-filters button.active::after { background: rgba(255,255,255,.5); opacity: .45; box-shadow: none; }
.process-stage-filters button.active.has-data::after { background: #fff; opacity: 1; box-shadow: 0 0 0 3px rgba(255,255,255,.2),0 0 9px rgba(255,255,255,.9); }
.process-stage-filters button.active b { color: var(--green-dark); background: #fff; }
.process-stage-filters button.active small { color: rgba(255,255,255,.75); }
.process-list-panel { min-height: 0; padding: 10px; background: #fff; border: 1px solid var(--line); }
.process-list-panel > header { margin-bottom: 7px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.process-list-panel h3 { margin: 2px 0 0; color: var(--forest); font-size: 14px; }
.process-list-panel > header > strong { color: var(--green); font-size: 10px; }
.process-pallet-list { max-height: max(280px,calc(100dvh - 360px)); display: grid; gap: 5px; overflow-y: auto; }
.process-pallet-item { min-width: 0; padding: 8px 10px; display: grid; grid-template-columns: 18px minmax(0,1fr) auto; align-items: center; gap: 9px; background: #f8faf8; border: 1px solid var(--line); border-left: 4px solid #c5d2c9; cursor: pointer; }
.process-pallet-item.selected { background: var(--green-light); border-color: #9dc8ab; border-left-color: var(--green); }
.process-pallet-item input { width: 16px; height: 16px; accent-color: var(--green); }
.process-pallet-item > span { min-width: 0; display: grid; gap: 3px; }
.process-pallet-item strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.process-pallet-item small, .process-pallet-item time { color: var(--muted); font-size: 8px; }
.process-pallet-item time { white-space: nowrap; }
.process-pallet-times { min-width: 210px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.process-pallet-times > span { min-width: 0; padding: 5px 7px; display: grid; gap: 2px; background: #fff; border: 1px solid var(--line); }
.process-pallet-times small { color: var(--green); font-size: 6px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.process-pallet-times .pending { background: #f1f3f1; }
.process-pallet-times .pending time { color: #8d9691; font-style: italic; }
.process-actions { position: fixed; z-index: 190; bottom: max(12px,env(safe-area-inset-bottom)); left: calc(50% + var(--sidebar-half)); width: min(820px,calc(100vw - var(--sidebar) - 24px)); padding: 0; background: transparent; border: 0; transform: translateX(-50%); }
.process-default-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; animation: processActionSwap .2s ease both; }
.process-default-actions[hidden] { display: none; }
.process-default-actions button, .process-actions > .btn { min-width: 0; min-height: 54px; padding: 6px 9px; color: #fff; background: var(--green); border: 1px solid rgba(255,255,255,.16); cursor: pointer; font-size: 11px; font-weight: 700; box-shadow: 0 6px 16px rgba(18,131,66,.2),0 0 14px rgba(18,131,66,.08); }
.process-default-actions button.active { background: var(--green-dark); border-color: #fff; box-shadow: 0 0 0 2px var(--green-dark),0 10px 22px rgba(12,73,38,.3); }
.process-actions > span { display: none; }
.process-actions > .btn { width: 100%; background: var(--wine); border-color: var(--wine); animation: processActionSwap .22s ease both; }
.process-actions > .btn[hidden] { display: none; }
@keyframes processActionSwap { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes actionBarFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 700px) {
  .process-workspace { padding-bottom: 62px; gap: 6px; }
  .process-filter-section { padding: 6px 7px; }
  .process-stage-filters { gap: 4px; }
  .process-stage-filters button { min-height: 61px; padding: 5px 3px; display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: center; }
  .process-stage-filters button b { width: 23px; height: 23px; flex: 0 0 23px; font-size: 9px; }
  .process-stage-filters button span { width: 100%; font-size: 7px; white-space: normal; line-height: 1.15; }
  .process-stage-filters button small { font-size: 6px; }
  .process-list-panel { padding: 7px; }
  .process-pallet-list { max-height: max(250px,calc(100dvh - 330px)); }
  .process-pallet-item { padding: 7px 7px; grid-template-columns: 17px minmax(0,1fr); }
  .process-pallet-item > time, .process-pallet-times { grid-column: 2; }
  .process-pallet-times { min-width: 0; width: 100%; }
  .process-actions { right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); left: 8px; width: auto; transform: none; }
  .process-default-actions { gap: 5px; }
  .process-default-actions button, .process-actions > .btn { min-height: 52px; padding: 4px 3px; font-size: 9px; overflow-wrap: anywhere; }
  .dispatch-module-actions { right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); left: 8px; width: auto; transform: none; }
  .dispatch-default-actions { gap: 5px; }
  .dispatch-default-actions button, .dispatch-module-actions > .btn { min-height: 52px; padding: 4px 3px; font-size: 9px; overflow-wrap: anywhere; }
}
@media (max-width: 1024px) {
  .tunnel-pallet-action-bar, .camera-pallet-action-bar, .process-actions, .dispatch-module-actions { left: 50%; width: min(820px,calc(100vw - 24px)); }
  .tunnel-pallet-action-bar { width: min(720px,calc(100vw - 24px)); }
}
@media (max-width: 700px) {
  .process-actions, .dispatch-module-actions { right: 8px; left: 8px; width: auto; transform: none; }
}
.camera-full-slot.moving-pallet-origin { outline: 2px dashed #d49735; outline-offset: 1px; }
.camera-position-full { margin: 10px 0 0; padding: 9px; color: #8b542a; background: #fff4e8; font-size: 9px; line-height: 1.4; }
.camera-position-full[hidden], .camera-level-stage[hidden], .camera-pallet-stage[hidden] { display: none; }
.camera-pallet-stage { margin-top: 16px; }
.camera-pallet-stage-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.camera-pallet-stage-head span { display: grid; gap: 3px; }
.camera-pallet-stage-head strong { color: var(--wine); font-size: 12px; }
.camera-pallet-stage-head button { min-height: 29px; padding: 0 9px; color: var(--wine); background: #fff; border: 1px solid var(--wine); cursor: pointer; font-size: 8px; font-weight: 600; }
#cameraPalletItems.camera-popover-pallets { max-height: 190px; display: grid; grid-template-columns: 1fr; gap: 6px; overflow-y: auto; padding-right: 2px; }
.camera-popover-pallet { min-height: 38px; padding: 8px 10px; color: #236f93; text-align: left; background: #f4f9fb; border: 1px solid #c8dce6; cursor: pointer; font-size: 10px; font-weight: 600; }
.camera-popover-pallet.active { color: #fff; background: #236f93; border-color: #236f93; }
.camera-popover-actions { margin-top: 13px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.camera-popover-actions span { color: var(--muted); font-size: 8px; }
.camera-popover-actions .btn { width: 100%; min-height: 40px; }
.camera-flow { display: grid; grid-template-columns: .8fr 1.4fr .8fr; }
.camera-step { position: relative; min-width: 0; padding: 24px; border-right: 1px solid var(--line); }
.camera-step:last-child { border-right: 0; }
.step-number { position: absolute; top: 20px; right: 20px; width: 25px; height: 25px; display: grid; place-items: center; color: var(--wine); background: #f5e8ed; border-radius: 50%; font-size: 10px; font-weight: 600; }
.scan-row.vertical { padding: 0; display: grid; grid-template-columns: 1fr; }
.scanned-pallet { margin-top: 15px; padding: 13px; background: #f5f7f4; }
.scanned-pallet strong { display: block; margin-top: 5px; font-size: 12px; }
.camera-destination { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-map { min-height: 178px; margin-top: 16px; padding: 12px; display: grid; grid-template-columns: repeat(8,1fr); gap: 7px; align-content: start; background: #f7f8f5; border: 1px solid var(--line); }
.quick-map p { grid-column: 1/-1; place-self: center; max-width: 260px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }
.quick-map button { aspect-ratio: 1; color: var(--green); background: #fff; border: 1px solid #bcd8c6; cursor: pointer; font-size: 10px; }
.quick-map button.occupied { color: #a5aca7; background: #e3e7e3; border-color: #d2d7d3; cursor: not-allowed; }
.quick-map button.selected { color: #fff; background: var(--wine); border-color: var(--wine); }
.level-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.level-toggle button { min-height: 76px; color: var(--muted); background: #fafbf8; border: 1px solid var(--line); cursor: pointer; }
.level-toggle button b, .level-toggle button span { display: block; }
.level-toggle button b { color: var(--ink); font-size: 18px; }
.level-toggle button span { margin-top: 4px; font-size: 10px; }
.level-toggle button.active { color: var(--wine); border-color: var(--wine); background: #fff8fa; }
.final-location { margin-top: 18px; padding: 15px; background: var(--forest); color: #fff; }
.final-location strong { display: block; margin-top: 6px; font-size: 15px; }
.confirm-camera { width: 100%; margin-top: 14px; }
.login-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.login-modal[hidden] { display: none; }
.login-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(10,18,14,.72); border: 0; backdrop-filter: blur(3px); cursor: default; }
.login-dialog { position: relative; z-index: 1; width: min(430px,100%); padding: 34px; background: #fff; border-top: 4px solid var(--wine); box-shadow: 0 26px 80px rgba(0,0,0,.35); }
.login-dialog > img { width: 135px; padding: 12px; background: var(--forest); }
.login-dialog > .detail-kicker { margin-top: 26px; }
.login-dialog h2 { margin: 0; font-size: 25px; font-weight: 500; }
.login-description { margin: 10px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-close { position: absolute; top: 13px; right: 13px; width: 36px; height: 36px; padding: 0; color: var(--muted); background: #f4f5f1; border: 0; cursor: pointer; font-size: 23px; line-height: 1; }
.login-dialog form { display: grid; gap: 16px; }
.login-dialog form > .btn { width: 100%; min-height: 48px; }
.login-profile { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: var(--green-light); }
.login-profile span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.login-profile strong { color: var(--green); font-size: 11px; }
.login-note { display: block; margin-top: 17px; color: #909991; text-align: center; font-size: 9px; line-height: 1.5; }

@media (max-width: 1180px) {
  .module-grid { grid-template-columns: repeat(2,1fr); }
  .entry-form-dense { grid-template-columns: repeat(2,1fr); }
  .camera-flow { grid-template-columns: 1fr 1fr; }
  .camera-step:last-child { grid-column: 1/-1; border-top: 1px solid var(--line); }
  .final-step { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; align-items: end; }
  .final-step h3, .final-step .step-number { grid-column: 1/-1; }
  .confirm-camera { margin: 0; }
}

@media (max-width: 760px) {
  .page-login { padding: 25px 22px; }
  .session-summary { width: 100%; }
  .session-summary > span:nth-child(2) { flex: 1; }
  .header-access { width: 100%; display: grid; grid-template-columns: 1fr auto; }
  .header-access select { width: 100%; min-width: 0; }
  .access-panel { grid-template-columns: 1fr; align-items: stretch; }
  .access-button { width: 100%; }
  .section-heading, .entry-head { align-items: flex-start; flex-direction: column; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 54px; }
  .entry-form, .entry-form-dense { grid-template-columns: 1fr; padding: 18px; }
  .pallet-read-result { padding: 18px; }
  .pallet-read-result dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pallet-read-result .form-actions { align-items: stretch; flex-direction: column; }
  .pallet-read-result .form-actions .btn { width: 100%; }
  .reception-guide-step { padding: 12px; }
  .reception-guide-card { padding: 20px 16px; }
  .reception-guide-card .form-actions .btn { width: 100%; }
  .reception-truck-form { grid-template-columns: 1fr; }
  .reception-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .reception-summary > div { min-width: 0; min-height: 58px; padding: 8px 5px; flex-direction: column; justify-content: center; gap: 4px; text-align: center; border-right: 1px solid rgba(255,255,255,.13); border-bottom: 0; }
  .reception-summary > div:last-child { border-right: 0; }
  .reception-summary span { font-size: 7px; line-height: 1.25; letter-spacing: .05em; }
  .reception-summary strong { max-width: 100%; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .reception-total-popover { right: auto; left: 50%; transform: translateX(-50%); }
  .form-actions, .form-actions-full { grid-column: 1; }
  .form-actions .btn { flex: 1; }
  .scan-row { grid-template-columns: 1fr; padding: 18px 18px 0; }
  .assignment-layout { grid-template-columns: 1fr; }
  .pending-list { grid-template-columns: 1fr; border-right: 0; border-bottom: 1px solid var(--line); }
  #tunnelPendingItems { grid-template-columns: repeat(2,1fr); }
  #module-tuneles .position-picker { display: none; }
  #module-tuneles .assignment-layout.mobile-pallet-selected .pending-list { display: none; }
  #module-tuneles .assignment-layout.mobile-pallet-selected .position-picker { display: block; animation: tunnelMapEnter .28s ease both; }
  #module-tuneles .position-picker.is-returning { animation: tunnelMapReturn .18s ease both; }
  .tunnel-mobile-selection:not([hidden]) { position: sticky; top: 66px; z-index: 5; margin: -4px 0 18px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff8fa; border: 1px solid var(--wine); box-shadow: 0 8px 22px rgba(53,34,40,.1); animation: selectedPalletEnter .3s ease both; }
  .tunnel-mobile-selection span { min-width: 0; display: grid; gap: 3px; }
  .tunnel-mobile-selection small { color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
  .tunnel-mobile-selection strong { overflow: hidden; color: var(--wine); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .tunnel-mobile-selection button { min-height: 34px; padding: 0 11px; flex: 0 0 auto; color: var(--wine); background: #fff; border: 1px solid var(--wine); cursor: pointer; font-size: 9px; font-weight: 600; }
  .pending-pallet.moving-up { position: relative; z-index: 2; animation: palletMoveUp .22s ease both; }
  .pending-list.mobile-list-return { animation: palletListReturn .25s ease both; }
  .picker-toolbar { align-items: stretch; flex-direction: column; }
  .selection-summary { text-align: left; }
  .camera-flow { grid-template-columns: 1fr; }
  .camera-map-stage { padding: 18px; }
  .camera-map-toolbar { align-items: stretch; flex-direction: column; }
  .camera-map-toolbar .entry-field { min-width: 0; }
  .camera-map-toolbar > div { text-align: left; }
  .camera-full-map { grid-template-columns: repeat(10,minmax(66px,1fr)); }
  .camera-level-step { grid-template-columns: 1fr; padding: 22px 18px; }
  .camera-level-options button { min-width: 0; }
  .camera-pallet-list { padding: 16px 18px; }
  #cameraPalletItems { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .camera-location-step { padding: 18px; }
  .camera-location-toolbar { align-items: stretch; flex-direction: column; }
  .camera-location-toolbar .entry-field { min-width: 0; }
  .camera-location-toolbar > div { text-align: left; }
  .camera-storage-map { grid-template-columns: repeat(10,minmax(54px,1fr)); }
  .camera-storage-map-two { grid-template-columns: repeat(2,minmax(90px,1fr)); }
  .camera-step { border-right: 0; border-bottom: 1px solid var(--line); }
  .camera-step:last-child { grid-column: auto; }
  .final-step { display: block; }
  .confirm-camera { margin-top: 14px; }
  .quick-map { grid-template-columns: repeat(6,1fr); }
}

@keyframes palletMoveUp {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-32px) scale(.96); }
}

@keyframes selectedPalletEnter {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tunnelMapEnter {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tunnelMapReturn {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(28px); }
}

@keyframes palletListReturn {
  from { opacity: 0; transform: translateY(-22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatingConfirmEnter {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cameraMapReload {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.985); }
}

@keyframes cameraPopoverSwitch {
  from { opacity: 1; transform: scale(1); }
  to { opacity: .2; transform: scale(.97); }
}

@media (prefers-reduced-motion: reduce) {
  .pending-pallet.moving-up,
  .camera-pallet-item.moving-up,
  .tunnel-mobile-selection:not([hidden]),
  #module-tuneles .assignment-layout.mobile-pallet-selected .position-picker,
  #module-tuneles .position-picker.is-returning,
  .pending-list.mobile-list-return,
  .camera-pallet-list.is-entering,
  .camera-pallet-list.is-returning,
  .camera-location-step.is-entering,
  .camera-location-step.is-returning,
  .confirm-position.is-floating,
  .confirm-camera-position.is-floating,
  .camera-full-map.is-reloading,
  .camera-full-map.is-entering,
  .camera-assignment-popover.is-open,
  .camera-assignment-popover.is-switching,
  .camera-relocation-bar { animation-duration: .01ms; }
}

@media (max-width: 430px) {
  .pallet-scan-step { padding: 12px; }
  .pallet-scan-title { min-height: 62px; padding: 14px 18px; border-radius: 9px; }
  .pallet-scan-title h2 { font-size: 23px; }
  .pallet-scan-card { padding: 14px; border-radius: 9px; }
  .pallet-scan-surface { min-height: 280px; padding: 16px; border-radius: 9px; }
  .pallet-camera-button { width: 180px; padding: 18px; }
  .pallet-camera-button svg { width: 47px; height: 47px; }
  .pallet-camera-inline { width: 180px; }
  .reception-folio-log ol { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-login { padding: 22px 18px; border-radius: 0; box-shadow: 0 14px 35px rgba(16,39,27,.09); }
  .login-intro { margin-bottom: 20px; }
  .session-summary { align-items: flex-start; flex-wrap: wrap; }
  .session-summary button { width: 100%; margin: 3px 0 0; }
  .header-access { grid-template-columns: 1fr; }
  .header-access .btn { width: 100%; }
  .login-dialog { padding: 25px 20px; }
  .access-copy { align-items: flex-start; }
  .access-icon { display: none; }
  .module-section, .entry-head, .position-picker, .camera-step { padding: 17px; }
  .module-card { grid-template-columns: 34px 1fr; }
  .module-card i { display: none; }
  .pending-list { grid-template-columns: 1fr; padding: 14px; }
  #tunnelPendingItems { grid-template-columns: 1fr; }
  #cameraPalletItems { grid-template-columns: 1fr; }
  .camera-map-stage { padding: 15px 12px 18px; }
  .camera-full-map { grid-template-columns: repeat(10,minmax(64px,1fr)); }
  .camera-map-legend { gap: 8px 12px; }
  .camera-assignment-popover { padding: 16px 14px; }
  .camera-relocation-bar { align-items: stretch; flex-direction: column; }
  .camera-relocation-bar > div { display: grid; grid-template-columns: 1fr 1fr; }
  .camera-relocation-bar button { width: 100%; }
  .camera-popover-actions { grid-template-columns: 1fr; }
  .camera-popover-actions span { text-align: right; }
  .camera-level-options { grid-template-columns: 1fr 1fr; }
  .camera-pallet-list-head { align-items: flex-start; }
  .camera-pallet-list-head > div:last-child { align-items: flex-end; flex-direction: column; }
  .camera-selected-pallet { top: 62px; }
  .camera-destination { grid-template-columns: 1fr; }
  .quick-map { grid-template-columns: repeat(4,1fr); }
  .form-actions { flex-direction: column-reverse; }
}
/* Gestión interna de usuarios */
.user-directory { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--line, #dfe3e6); border-radius: 16px; background: #fff; }
.user-directory-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.user-directory-head h3 { margin: 0; }
.user-directory-head span { color: var(--muted, #667085); font-size: .9rem; }
.user-table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.user-table th, .user-table td { padding: .8rem; border-bottom: 1px solid var(--line, #e5e7eb); text-align: left; vertical-align: middle; }
.user-table th { color: var(--muted, #667085); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.user-directory .user-table-wrap { overflow: hidden; }
.user-directory .user-table { min-width: 0; table-layout: fixed; }
.user-directory .user-name-cell { font-weight: 600; }
.user-edit-trigger { width: 100%; padding: 3px 0; overflow: hidden; color: var(--wine); text-align: left; text-overflow: ellipsis; white-space: nowrap; background: transparent; border: 0; cursor: pointer; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.user-edit-trigger:hover { color: var(--forest); }
.user-delete-button { padding: .65rem .85rem; white-space: nowrap; background: #a12638; border-color: #a12638; }
.user-delete-button:hover { background: #7f1d2d; border-color: #7f1d2d; }
.user-delete-button:disabled { opacity: .5; cursor: not-allowed; }
.user-directory-empty { margin: 1rem 0 0; color: var(--muted, #667085); }
.user-editor { position: fixed; inset: 0; z-index: 180; padding: 16px; display: grid; place-items: center; }
.user-editor[hidden] { display: none; }
.user-editor-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(10,18,14,.72); border: 0; cursor: default; backdrop-filter: blur(2px); }
.user-editor-dialog { position: relative; z-index: 1; width: min(470px,100%); padding: 25px; background: #fff; border-top: 4px solid var(--wine); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.user-editor-dialog > small { color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.user-editor-dialog h3 { margin: 5px 0 0; font-size: 23px; font-weight: 500; }
.user-editor-dialog > p:not(.user-form-message) { margin: 6px 0 20px; color: var(--muted); font-size: 10px; }
.user-editor-dialog .entry-field { display: grid; }
.user-editor-dialog .entry-field input { width: 100%; }
.user-editor-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.user-editor-actions .user-delete-button { grid-column: 1/-1; }

@media (max-width: 700px) {
  .user-directory .user-table-wrap { overflow: hidden; border: 1px solid var(--line, #e5e7eb); }
  .user-directory .user-table { width: 100%; min-width: 0; display: table; table-layout: fixed; }
  .user-directory .user-table thead { display: table-header-group; }
  .user-directory .user-table tbody { display: table-row-group; }
  .user-directory .user-table tr { width: auto; display: table-row; padding: 0; background: #fff; border: 0; }
  .user-directory .user-table th, .user-directory .user-table td { width: auto; min-height: 0; padding: 8px 7px; display: table-cell; overflow: hidden; border-bottom: 1px solid var(--line, #e5e7eb); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .user-directory .user-table td::before { display: none; }
  .user-directory .user-table th { background: #f4f6f3; }
  .user-directory .user-table th:nth-child(1) { width: 36%; }
  .user-directory .user-table th:nth-child(2) { width: 34%; }
  .user-directory .user-table th:nth-child(3) { width: 30%; }
}

@media (max-width: 430px) {
  .user-directory { padding: .65rem; }
  .user-directory .user-table th, .user-directory .user-table td { padding: 7px 6px; }
  .user-editor { padding: 10px; place-items: end center; }
  .user-editor-dialog { width: 100%; padding: 20px 16px; }
  .user-editor-actions { grid-template-columns: 1fr; }
  .user-editor-actions .user-delete-button { grid-column: auto; }
}
.pallet-register-section { margin-bottom: 1.5rem; padding: 1.25rem; border: 1px solid var(--line, #dfe3e6); border-radius: 16px; background: #fff; }
.pallet-register-section:last-child { margin-bottom: 0; }
.pallet-register-section .user-directory-head p { margin: .25rem 0 0; color: var(--muted, #667085); }
.pallet-register-table { min-width: 780px; }
.pallet-register-search { display: block; max-width: 480px; margin: 0 0 1rem; }
.pallet-register-search input { width: 100%; }
.pallet-register-filters { margin-bottom: 14px; display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.pallet-register-filters .camera-pallet-search { min-width: 220px; margin: 0; }
.pallet-register-date input { min-height: 40px; padding: 0 11px; color: var(--ink); background: #fff; border: 1px solid #c8dce6; }
.pallet-register-filters .btn { min-height: 40px; }
.dispatch-button { padding: .65rem .9rem; white-space: nowrap; }
.pallet-register-status { font-weight: 700; text-transform: capitalize; }
.pallet-register-status.status-recepcionado { color: #8a5b00; }
.pallet-register-status.status-refrigerado { color: #1769aa; }
.pallet-register-status.status-almacenado { color: #28734c; }
.pallet-register-status.status-despachado { color: #6b3fa0; }
.pallet-movement-user { position: relative; min-width: 130px; padding-left: 17px !important; font-weight: 600; }
.pallet-movement-next::before { content: "→"; position: absolute; left: -8px; top: 50%; z-index: 1; width: 16px; height: 16px; display: grid; place-items: center; color: var(--wine); background: #fff; transform: translateY(-50%); font-size: 12px; font-weight: 700; }

/* Selector de posiciones del túnel */
#module-tuneles .compact-rack { grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 18px; max-width: 560px; margin-inline: auto; }
#module-tuneles .tunnel-column-slots { gap: 5px; }
#module-tuneles .compact-slot { min-height: 38px; padding: 4px 7px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; text-align: left; }
#module-tuneles .compact-slot > b { font-size: 10px; font-weight: 700; }
#module-tuneles .compact-slot > span { display: flex; gap: 3px; }
#module-tuneles .compact-slot i { width: 20px; height: 20px; display: grid; place-items: center; color: #6e8577; background: #fff; border: 1px solid #bcd8c6; font-size: 8px; font-style: normal; }
#module-tuneles .compact-slot i.occupied { color: #fff; background: var(--green); border-color: var(--green); }
#module-tuneles .compact-slot.full { color: #8e9791; background: #e4e8e5; border-color: #cbd1cd; cursor: pointer; }
#module-tuneles .compact-slot.full i.occupied { background: #7d8981; border-color: #7d8981; }
#module-tuneles .compact-slot.selected { color: #fff; background: var(--wine); border-color: var(--wine); }
.tunnel-level-popover { position: fixed; z-index: 130; width: min(285px, calc(100vw - 16px)); padding: 17px; background: #fff; border: 1px solid #d8bfc7; box-shadow: 0 18px 50px rgba(53,34,40,.28); animation: floatingConfirmEnter .18s ease both; }
.tunnel-level-popover[hidden] { display: none; }
.tunnel-level-popover > small { color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.tunnel-level-popover > strong { display: block; margin-top: 4px; color: var(--wine); font-size: 13px; }
.tunnel-level-popover > p { margin: 15px 0 9px; font-size: 10px; }
.tunnel-level-popover > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tunnel-level-popover button { min-height: 72px; padding: 8px; color: var(--muted); background: #fafbf8; border: 1px solid var(--line); cursor: pointer; }
.tunnel-level-popover button b, .tunnel-level-popover button span, .tunnel-level-popover button small { display: block; }
.tunnel-level-popover button b { color: var(--ink); font-size: 18px; }
.tunnel-level-popover button span { margin-top: 2px; font-size: 10px; }
.tunnel-level-popover button small { margin-top: 4px; color: var(--green); font-size: 7px; }
.tunnel-level-popover button.occupied { background: #fff8fa; border-color: #d8bfc7; cursor: pointer; }
.tunnel-level-popover button.occupied small { color: var(--wine); }

/* Flujo de túnel: mapa primero y ventana fija al centro */
.tunnel-map-stage { padding: clamp(9px,1.5vh,15px) 20px clamp(11px,1.8vh,18px); background: #fff; }
.tunnel-map-toolbar { margin-bottom: clamp(6px,1vh,10px); display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.tunnel-map-toolbar > div:last-child { text-align: right; }
.tunnel-map-toolbar > div:last-child small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.tunnel-map-toolbar > div:last-child strong { display: block; margin-top: 5px; color: var(--wine); font-size: 13px; }
.tunnel-full-map { width: 100%; margin: 0 auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(6px,1.2vw,14px); overflow: visible; }
.tunnel-full-column { min-width: 0; display: grid; grid-template-rows: auto 1fr; gap: 6px; }
.tunnel-full-column-title { min-height: clamp(30px,5vh,42px); padding: 4px 6px; display: grid; place-items: center; align-content: center; color: var(--forest); background: #f1f3ef; border: 1px solid var(--line); }
.tunnel-full-column-title b { font-size: 10px; }
.tunnel-full-column-title small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.tunnel-full-column-slots { display: grid; gap: clamp(1px,.35vh,4px); }
.tunnel-full-slot { min-width: 0; min-height: clamp(20px,calc((100dvh - 300px) / var(--tunnel-position-count,22)),34px); padding: 1px clamp(3px,.7vw,7px); display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: clamp(2px,.5vw,5px); color: var(--green); background: #f2f8f4; border: 1px solid #bcd8c6; cursor: pointer; }
.tunnel-full-slot:hover, .tunnel-full-slot:focus-visible { border-color: var(--green); box-shadow: 0 0 0 2px rgba(18,131,66,.14); outline: 0; }
.tunnel-full-slot.selected { border-color: var(--wine); box-shadow: 0 0 0 2px rgba(116,32,62,.16); }
.tunnel-full-slot.full { color: #fff; background: #39463f; border-color: #39463f; }
.tunnel-full-slot.moving-pallet-origin { outline: 2px dashed #d49735; outline-offset: 1px; }
.tunnel-full-slot b { font-size: 9px; }
.tunnel-full-slot span { display: flex; gap: 3px; }
.tunnel-full-slot i { width: clamp(13px,2.25vh,17px); height: clamp(13px,2.25vh,17px); display: grid; place-items: center; color: #799187; background: #e6f1e9; border: 1px solid #bcd8c6; font-size: 7px; font-style: normal; font-weight: 700; }
.tunnel-full-slot i:first-child.occupied { color: #fff; background: var(--green); border-color: var(--green); }
.tunnel-full-slot i:last-child.occupied { color: #fff; background: var(--wine); border-color: var(--wine); }
.tunnel-map-legend { width: min(760px,100%); margin: clamp(7px,1.3vh,12px) auto 0; display: flex; flex-wrap: wrap; gap: 5px 18px; color: var(--muted); font-size: 9px; }
.tunnel-map-legend span { display: flex; align-items: center; gap: 6px; }
.tunnel-map-legend i { width: 12px; height: 12px; background: #f2f8f4; border: 1px solid #bcd8c6; }
.tunnel-map-legend i.floor { background: var(--green); border-color: var(--green); }
.tunnel-map-legend i.height { background: var(--wine); border-color: var(--wine); }
.tunnel-map-legend i.full { background: #39463f; border-color: #39463f; }
.tunnel-assignment-modal, .tunnel-release-modal { position: fixed; inset: 0; z-index: 200; padding: 16px; display: grid; place-items: center; }
.tunnel-assignment-modal[hidden], .tunnel-release-modal[hidden] { display: none; }
.tunnel-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(20,29,24,.54); border: 0; cursor: default; }
.tunnel-assignment-dialog { position: relative; z-index: 1; width: min(430px,100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px; background: #fff; border: 1px solid #d8bfc7; box-shadow: 0 22px 70px rgba(28,37,32,.36); animation: selectedPalletEnter .2s ease both; }
body.tunnel-modal-open { overflow: hidden; }
.tunnel-release-dialog { position: relative; z-index: 1; width: min(620px,100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; background: #fff; border-top: 4px solid var(--wine); box-shadow: 0 24px 70px rgba(0,0,0,.35); animation: selectedPalletEnter .2s ease both; }
.tunnel-release-dialog > small { color: #8faaa0; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.tunnel-release-dialog h3 { margin: 5px 0 0; font-size: 21px; font-weight: 500; }
.tunnel-release-dialog > p:not(.user-form-message) { margin: 8px 32px 18px 0; color: var(--muted); font-size: 10px; }
.tunnel-release-filter { max-width: 220px; }
.tunnel-release-select-all { min-height: 42px; margin: 14px 0 9px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; color: var(--forest); background: #f2f8f4; border: 1px solid #c5dace; cursor: pointer; font-size: 10px; font-weight: 600; }
.tunnel-release-select-all input, .tunnel-release-item input { width: 16px; height: 16px; accent-color: var(--wine); }
.tunnel-release-list { max-height: min(43dvh,360px); display: grid; gap: 7px; overflow-y: auto; padding-right: 3px; }
.tunnel-release-item { min-height: 54px; padding: 9px 12px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); cursor: pointer; }
.tunnel-release-item:has(input:checked) { background: #fff7fa; border-color: var(--wine); box-shadow: inset 3px 0 var(--wine); }
.tunnel-release-item.process-pending { cursor: not-allowed; opacity: .62; background: #f2f4f2; }
.tunnel-release-item.process-pending > strong { color: var(--muted); }
.tunnel-release-item span { min-width: 0; display: grid; gap: 3px; }
.tunnel-release-item b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.tunnel-release-item small { color: var(--muted); font-size: 8px; }
.tunnel-release-item > strong { color: var(--wine); font-size: 9px; white-space: nowrap; }
.tunnel-release-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 9px; }
.tunnel-release-actions > span { color: var(--muted); font-size: 9px; }
.tunnel-pallet-stage { margin-top: 18px; }
.tunnel-pallet-stage[hidden], .tunnel-level-stage[hidden], .tunnel-current-pallets[hidden] { display: none; }
.tunnel-popover-pallets { max-height: 220px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; overflow-y: auto; padding-right: 2px; }
.tunnel-popover-pallet { min-height: 42px; padding: 8px 10px; display: grid; gap: 3px; color: var(--green); text-align: left; background: #f2f8f4; border: 1px solid #bcd8c6; cursor: pointer; font-size: 10px; font-weight: 600; }
.tunnel-popover-pallet:hover { color: #fff; background: var(--green); border-color: var(--green); }
.tunnel-popover-pallet small { color: var(--muted); font-size: 7px; font-weight: 500; }
.tunnel-popover-pallet:hover small { color: rgba(255,255,255,.78); }
.tunnel-popover-pallet.returning-from-camera { color: var(--wine); background: #fff7fa; border-color: #d8bfc7; }
.tunnel-popover-pallet.returning-from-camera:hover { color: #fff; background: var(--wine); border-color: var(--wine); }
.tunnel-modal-count { margin-top: 11px; color: var(--muted); font-size: 8px; text-align: right; }
.tunnel-current-pallets { margin: 0 0 13px; padding: 10px; background: #fff8fa; border: 1px solid #d8bfc7; }
.tunnel-current-pallets > small { display: block; margin-bottom: 7px; color: var(--wine); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.tunnel-current-pallets > p:not(.user-form-message) { margin: -2px 0 9px; color: var(--muted); font-size: 8px; line-height: 1.4; }
#tunnelCurrentPalletItems { display: grid; gap: 6px; }
.tunnel-edit-pallet { padding: 9px; color: var(--ink); background: #fff; border: 1px solid #d8bfc7; }
.tunnel-process-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tunnel-process-head > span { display: grid; gap: 2px; }
.tunnel-process-head b { font-size: 10px; }
.tunnel-process-head small { color: var(--muted); font-size: 8px; }
.tunnel-process-head > strong { color: var(--wine); font-size: 8px; text-align: right; }
.tunnel-process-stages { margin-top: 9px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
.tunnel-process-stage { min-width: 0; min-height: 48px; padding: 5px 3px; display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); background: #f4f6f4; border: 1px solid var(--line); cursor: pointer; }
.tunnel-process-stage b { width: 18px; height: 18px; display: grid; place-items: center; color: inherit; background: #fff; border: 1px solid currentColor; border-radius: 50%; font-size: 8px; }
.tunnel-process-stage span { overflow: hidden; font-size: 7px; line-height: 1.2; text-align: center; text-overflow: ellipsis; }
.tunnel-process-stage.completed { color: var(--green); background: #edf7f0; border-color: #bcd8c6; }
.tunnel-process-stage.active { color: #fff; background: var(--green); border-color: var(--green); box-shadow: 0 4px 10px rgba(12,73,38,.18); }
.tunnel-process-stage.active:last-child { background: var(--wine); border-color: var(--wine); box-shadow: 0 4px 10px rgba(116,32,62,.2); }
.tunnel-process-stage.active b { color: var(--green); }
.tunnel-process-stage.active:last-child b { color: var(--wine); }
.tunnel-relocate-pallet { width: 100%; min-height: 30px; margin-top: 7px; color: var(--wine); background: #fff; border: 1px solid #d8bfc7; cursor: pointer; font-size: 8px; font-weight: 600; }
.tunnel-process-message { min-height: 0; margin-top: 8px; font-size: 8px; }
.tunnel-level-stage { margin-top: 17px; }
.tunnel-level-stage > p { margin: 0 0 10px; font-size: 10px; }
.tunnel-level-stage .camera-level-options button { min-width: 0; min-height: 76px; padding: 8px; }
.tunnel-level-stage .camera-level-options button small { display: block; margin-top: 4px; color: var(--green); font-size: 7px; }
.tunnel-level-stage .camera-level-options button.occupied { color: #8c9690; background: #eef1ef; border-color: #d9ded9; cursor: not-allowed; opacity: .7; }
.tunnel-level-stage .camera-level-options button.current-location { color: var(--wine); background: #fff7fa; border-color: var(--wine); cursor: pointer; opacity: 1; }
.tunnel-level-stage .camera-level-options button.current-location small { color: var(--wine); }
.tunnel-level-stage .camera-level-options button.blocked-by-floor:disabled { color: #8b542a; background: #fff4e8; border-color: #e4c49c; cursor: not-allowed; opacity: 1; }
.tunnel-level-stage .camera-level-options button.blocked-by-floor:disabled small { color: #8b542a; white-space: normal; }
.tunnel-confirm-button { width: 100%; margin-top: 14px; min-height: 42px; }

@media (max-width: 620px) {
  .tunnel-map-stage { padding: 10px; }
  .tunnel-map-toolbar { margin-bottom: 8px; align-items: stretch; flex-direction: column; gap: 7px; }
  .tunnel-map-toolbar > div:last-child { text-align: left; }
  .tunnel-selector-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .tunnel-button-picker { min-width: 0; flex: 1 1 auto; }
  .tunnel-close-button { width: 100%; flex: 0 0 auto; align-self: stretch; padding-inline: 12px; }
  .tunnel-relocate-mode-button { width: 100%; min-height: 40px; }
  .tunnel-full-map { grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(4px,2vw,8px); overflow: visible; }
  .tunnel-full-column { gap: 4px; }
  .tunnel-full-column-title { min-height: 29px; padding-block: 2px; }
  .tunnel-full-column-title b { font-size: 9px; }
  .tunnel-full-column-title small { margin-top: 0; font-size: 7px; }
  .tunnel-full-slot { min-height: clamp(20px,calc((100dvh - 350px) / var(--tunnel-position-count,22)),29px); padding-inline: 3px; }
  .tunnel-full-slot b { overflow: hidden; font-size: 8px; text-overflow: ellipsis; }
  .tunnel-full-slot span { gap: 2px; }
  .tunnel-full-slot i { width: 13px; height: 13px; font-size: 6px; }
  .tunnel-map-legend { margin-top: 7px; gap: 4px 10px; font-size: 8px; }
  .tunnel-map-legend span { gap: 4px; }
  .tunnel-map-legend i { width: 10px; height: 10px; }
  .tunnel-assignment-modal, .tunnel-release-modal { padding: 8px; }
  .tunnel-assignment-dialog { max-height: calc(100vh - 16px); padding: 17px; }
  .tunnel-popover-pallets { grid-template-columns: 1fr; }
  .tunnel-release-dialog { max-height: calc(100dvh - 16px); padding: 18px 14px; }
  .tunnel-release-actions { grid-template-columns: 1fr 1fr; }
  .tunnel-release-actions > span { grid-column: 1 / -1; text-align: right; }
  .tunnel-release-actions .btn { min-width: 0; padding-inline: 8px; }
}

@media (max-height: 700px) {
  .tunnel-map-toolbar { margin-bottom: 7px; }
  .tunnel-full-column { gap: 3px; }
  .tunnel-full-column-title { min-height: 24px; padding-block: 1px; }
  .tunnel-full-column-title b { font-size: 8px; }
  .tunnel-full-column-title small { margin-top: 0; font-size: 6px; }
  .tunnel-full-column-slots { gap: 1px; }
  .tunnel-full-slot { min-height: clamp(14px,calc((100dvh - 260px) / var(--tunnel-position-count,22)),24px); padding-block: 0; }
  .tunnel-full-slot b { font-size: 7px; }
  .tunnel-full-slot i { width: 10px; height: 10px; font-size: 5px; }
  .tunnel-map-legend { margin-top: 5px; gap-block: 3px; font-size: 7px; }
}
.tunnel-selector-actions { display: flex; align-items: end; gap: 7px; }
.tunnel-button-picker { min-width: 0; display: grid; gap: 3px; }
.tunnel-button-picker > span { color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.tunnel-button-options { width: min(100%,640px); max-width: 100%; padding: 4px; display: flex; flex-wrap: wrap; gap: 5px; overflow: visible; background: linear-gradient(145deg,#f6faf7,#edf5ef); border: 1px solid #d1dfd5; border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.tunnel-selector-button { position: relative; width: 50px; min-width: 50px; min-height: 38px; padding: 4px; flex: 0 0 50px; overflow: hidden; color: var(--forest); background: linear-gradient(180deg,#fff,#f7faf8); border: 1px solid #9bc8aa; border-radius: 7px; cursor: pointer; font-size: 8px; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; text-overflow: ellipsis; box-shadow: 0 2px 6px rgba(26,65,42,.1),inset 0 1px 0 #fff; transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.tunnel-selector-button::after { content: ""; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; background: #c6cec9; border-radius: 50%; opacity: .45; box-shadow: none; transition: opacity .18s ease,background .18s ease,box-shadow .18s ease; }
.tunnel-selector-button.has-pallet::after { background: #20c768; opacity: 1; box-shadow: 0 0 0 3px rgba(32,199,104,.15),0 0 8px rgba(32,199,104,.7); }
.tunnel-selector-button.short-label { font-size: 16px; font-weight: 650; }
.tunnel-selector-button:hover { color: var(--green-dark); background: #fff; border-color: var(--green); transform: translateY(-1px); box-shadow: 0 5px 11px rgba(26,65,42,.15),inset 0 1px 0 #fff; }
.tunnel-selector-button:focus-visible { outline: 3px solid rgba(116,32,62,.3); outline-offset: 2px; }
.tunnel-selector-button.active { color: #fff; background: linear-gradient(145deg,var(--green),var(--green-dark)); border-color: var(--green-dark); box-shadow: 0 8px 17px rgba(12,73,38,.25),inset 0 1px 0 rgba(255,255,255,.2); transform: translateY(-1px); }
.tunnel-selector-button.active::after { background: rgba(255,255,255,.5); opacity: .45; box-shadow: none; }
.tunnel-selector-button.active.has-pallet::after { background: #fff; opacity: 1; box-shadow: 0 0 0 3px rgba(255,255,255,.2),0 0 9px rgba(255,255,255,.9); }
.tunnel-close-button { min-height: 38px; padding-inline: 13px; white-space: nowrap; background: var(--forest); border-color: var(--forest); font-size: 10px; }
.tunnel-close-button[hidden] { display: none; }
.tunnel-close-button:disabled { color: #d7dfda; background: #59675f; border-color: #59675f; cursor: not-allowed; opacity: 1; }
.tunnel-relocate-mode-button { min-height: 38px; padding-inline: 13px; color: var(--green); background: #fff; border-color: var(--green); font-size: 10px; }
.tunnel-relocate-mode-button.active { color: #fff; background: var(--green-dark); border-color: var(--green-dark); box-shadow: 0 6px 15px rgba(12,73,38,.23); }
.map-relocation-picker, .map-relocation-confirm { position: fixed; z-index: 230; width: min(190px,calc(100vw - 16px)); padding: 0; background: transparent; border: 0; box-shadow: none; animation: floatingConfirmEnter .18s ease both; }
.map-relocation-picker[hidden], .map-relocation-confirm[hidden] { display: none; }
.map-relocation-picker > small, .map-relocation-confirm > small { display: block; color: var(--muted); font-size: 7px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.map-relocation-picker > strong, .map-relocation-confirm > strong { display: block; margin-top: 4px; color: var(--forest); font-size: 11px; line-height: 1.35; }
.map-relocation-picker > div { display: grid; gap: 6px; }
.map-relocation-picker > div > button { width: 100%; min-height: 42px; padding: 7px 10px; display: block; overflow: hidden; color: #fff; text-align: center; text-overflow: ellipsis; white-space: nowrap; background: var(--green); border: 1px solid rgba(255,255,255,.2); border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; box-shadow: 0 7px 18px rgba(18,131,66,.22); }
.map-relocation-picker > div > button span { font-size: 8px; font-weight: 600; text-transform: uppercase; }
.map-relocation-picker > div > button strong { overflow: hidden; font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.map-relocation-picker > div > button:hover { color: #fff; background: var(--green); border-color: var(--green); }
.map-relocation-picker > div > button:disabled { color: #8c9690; background: #eef1ef; border-color: #d9ded9; cursor: not-allowed; opacity: .7; }
.map-relocation-confirm { width: min(190px,calc(100vw - 16px)); }
.map-relocation-confirm > p { margin: 7px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.map-relocation-confirm button { width: 100%; min-width: 0; min-height: 44px; padding: 6px 10px; color: #fff; background: var(--green); border: 1px solid rgba(255,255,255,.2); border-radius: 7px; cursor: pointer; font-size: 10px; font-weight: 700; box-shadow: 0 7px 18px rgba(18,131,66,.22); }
.map-relocation-confirm button.confirm { color: #fff; background: var(--green); }
.tunnel-observation-panel { position: fixed; z-index: 235; width: min(390px,calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 14px; display: grid; gap: 10px; overflow: hidden; background: #fff; border: 1px solid #bcd8c6; border-top: 4px solid var(--green); border-radius: 11px; box-shadow: 0 18px 48px rgba(16,39,27,.3); animation: floatingConfirmEnter .18s ease both; }
.tunnel-observation-panel[hidden] { display: none; }
.tunnel-observation-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tunnel-observation-panel > header small, .tunnel-observation-panel > header strong { display: block; }
.tunnel-observation-panel > header small { color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tunnel-observation-panel > header strong { margin-top: 3px; color: var(--forest); font-size: 14px; }
.tunnel-observation-panel > header > button { width: 30px; height: 30px; flex: 0 0 30px; color: var(--muted); background: #f2f5f3; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.tunnel-observation-list { max-height: min(46dvh,390px); display: grid; gap: 7px; overflow-y: auto; }
.tunnel-observation-entry { padding: 8px; display: grid; gap: 5px; background: #f1f4f2; border: 1px solid #d7ded9; border-left: 4px solid #aab5ae; border-radius: 7px; cursor: pointer; }
.tunnel-observation-entry.is-editing { background: #f4fbf6; border-color: #9ccaaa; border-left-color: var(--green); cursor: text; }
.tunnel-observation-entry small { color: var(--muted); font-size: 7px; line-height: 1.35; }
.tunnel-observation-entry textarea { width: 100%; min-height: 68px; padding: 8px; resize: vertical; color: var(--ink); background: #fff; border: 1px solid #bdd0c2; border-radius: 6px; font: inherit; font-size: 10px; line-height: 1.45; }
.tunnel-observation-entry textarea[readonly] { color: #526159; background: #e9eeeb; border-color: #d3dbd6; cursor: pointer; opacity: 1; -webkit-text-fill-color: #526159; }
.tunnel-observation-entry textarea:focus { outline: 3px solid rgba(18,131,66,.15); border-color: var(--green); }
.tunnel-observation-empty { margin: 0; padding: 10px; color: var(--muted); text-align: center; background: #f7f9f7; border: 1px dashed var(--line); font-size: 9px; }
.tunnel-observation-add { min-height: 34px; color: var(--green); background: #fff; border: 1px dashed var(--green); border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 700; }
.tunnel-observation-add:hover { color: #fff; background: var(--green); border-style: solid; }
.tunnel-observation-message { min-height: 0; margin: 0; }
.tunnel-observation-save { width: 100%; min-height: 42px; }
.camera-return-picker button.selected { color: #fff; background: #151817; border-color: #151817; box-shadow: inset 0 -3px 0 #c78115; }
.camera-return-modal { position: fixed; inset: 0; z-index: 245; display: grid; place-items: center; padding: 14px; }
.camera-return-modal[hidden] { display: none; }
.camera-return-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(9,14,11,.72); border: 0; }
.camera-return-dialog { position: relative; z-index: 1; width: min(620px,100%); max-height: calc(100dvh - 28px); padding: 22px; display: grid; gap: 10px; overflow: hidden; background: #fff; border-top: 4px solid #151817; box-shadow: 0 24px 70px rgba(0,0,0,.38); }
.camera-return-dialog > small { color: #8c9690; font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.camera-return-dialog h3 { margin: -3px 34px 0 0; color: var(--forest); font-size: 21px; }
.camera-return-dialog > p:not(.user-form-message) { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.camera-return-summary { padding: 9px 11px; color: #fff; background: #151817; font-size: 10px; }
.camera-return-selected-list { max-height: min(44dvh,390px); display: grid; gap: 6px; overflow-y: auto; }
.camera-return-selected-list article { min-width: 0; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f7f9f7; border: 1px solid var(--line); border-left: 4px solid #c78115; }
.camera-return-selected-list article > span { min-width: 0; display: grid; gap: 3px; }
.camera-return-selected-list strong { overflow: hidden; color: var(--forest); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.camera-return-selected-list small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.camera-return-selected-list article > button { min-height: 30px; padding: 0 9px; flex: 0 0 auto; color: var(--wine); background: #fff; border: 1px solid #d8bfc7; cursor: pointer; font-size: 8px; font-weight: 700; }
.camera-return-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.camera-return-actions .btn { min-width: 0; min-height: 44px; }
body.camera-return-modal-open { overflow: hidden; }
body.camera-return-modal-open .camera-pallet-action-bar { z-index: 30; pointer-events: none; }
@media (max-width: 480px) {
  .map-relocation-picker, .map-relocation-confirm { width: min(150px,calc(100vw - 12px)); padding: 0; }
  .tunnel-observation-panel { width: min(330px,calc(100vw - 12px)); padding: 11px; }
  .tunnel-observation-list { max-height: 42dvh; }
  .camera-return-dialog { padding: 18px 12px 12px; }
  .camera-return-actions { gap: 6px; }
  .camera-return-actions .btn { padding-inline: 7px; font-size: 9px; }
}
@media (max-width: 620px) {
  .tunnel-button-options { width: 100%; max-width: none; }
  .tunnel-button-options { gap: 4px; padding: 4px; border-radius: 8px; }
  .tunnel-selector-button { width: 44px; min-width: 44px; min-height: 34px; padding: 3px; flex-basis: 44px; border-width: 1px; border-radius: 6px; font-size: 7px; }
  .tunnel-selector-button.short-label { font-size: 14px; }
}
.compact-slot.relocation-origin { outline: 2px dashed var(--wine); outline-offset: 2px; }
.pallet-register-status.status-en_tunel { color: #8a5b00; }
.pallet-register-status.status-retorno_tunel { color: var(--wine); }
.pallet-register-status.status-camaras { color: #1769aa; }
.master-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 560px; background: #fff; border: 1px solid var(--line); }
.master-sidebar { padding: 20px 14px; color: #fff; background: var(--forest); }
.master-sidebar > small, .master-content-head small, .master-editor-dialog > small { color: #8faaa0; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.master-sidebar h3 { margin: 5px 6px 18px; font-size: 17px; font-weight: 500; }
.master-sidebar > div { display: grid; gap: 6px; }
.master-sidebar button { min-height: 47px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #dbe4df; text-align: left; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); cursor: pointer; }
.master-sidebar button.active { color: #fff; background: var(--wine); border-color: var(--wine); }
.master-sidebar button b { min-width: 24px; height: 24px; display: grid; place-items: center; color: var(--forest); background: #fff; font-size: 9px; }
.master-content { min-width: 0; padding: 22px; }
.master-content-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.master-content-head h3 { margin: 4px 0; font-size: 21px; font-weight: 500; }
.master-content-head span { color: var(--muted); font-size: 9px; }
.master-empty-button { background: #a12638; border-color: #a12638; }
.master-empty-button.master-add-button { background: var(--green); border-color: var(--green); }
.master-table-wrap { width: 100%; margin-top: 12px; overflow: auto; max-height: 620px; border: 1px solid var(--line); }
.master-data-table { width: max-content; min-width: 100%; border-collapse: collapse; }
.master-data-table th { position: sticky; top: 0; z-index: 2; padding: 10px; color: var(--muted); text-align: left; background: #f2f4f1; border-bottom: 1px solid var(--line); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.master-data-table td { max-width: 240px; padding: 9px 10px; overflow: hidden; border-bottom: 1px solid var(--line); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.master-row-actions { position: sticky; right: 0; display: flex; gap: 5px; background: #fff; box-shadow: -5px 0 8px rgba(28,47,35,.05); }
.master-row-actions .btn { min-height: 32px; padding: 0 9px; font-size: 8px; }
.master-row-actions button:disabled { opacity: .4; cursor: not-allowed; }
.master-inline-input { width: min(210px, 100%); min-height: 36px; padding: 0 9px; color: var(--ink); background: #fff; border: 1px solid #cbd3cd; outline: 0; font: inherit; }
.master-inline-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,131,66,.1); }
.master-number-input { width: 105px; }
.master-facility-name { font: inherit; }
.master-facility-summary { display: none; }
.master-record-name { font: inherit; }
.master-record-summary { display: none; }
.master-editor { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: 16px; }
.master-editor[hidden] { display: none; }
.master-editor-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(10,18,14,.72); border: 0; }
.master-editor-dialog { position: relative; z-index: 1; width: min(680px, 100%); padding: 24px; background: #fff; border-top: 4px solid var(--wine); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.master-editor-dialog h3 { margin: 5px 0 0; font-size: 21px; font-weight: 500; }
.master-editor-dialog > p:not(.user-form-message) { color: var(--muted); font-size: 10px; }
.master-editor-dialog textarea { width: 100%; min-height: 340px; padding: 13px; resize: vertical; color: #d9eee1; background: #17221c; border: 1px solid #394940; font: 11px/1.55 Consolas, monospace; }
.master-editor-dialog > div { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.master-editor-dialog .master-record-editor-fields { max-height: min(52dvh, 450px); margin-top: 18px; padding: 2px 4px 2px 2px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; align-items: start; justify-content: stretch; gap: 13px; }
.master-record-editor-fields label { min-width: 0; display: grid; gap: 6px; }
.master-record-editor-fields label > span { color: var(--forest); font-size: 9px; font-weight: 600; letter-spacing: .05em; overflow-wrap: anywhere; text-transform: uppercase; }
.master-record-editor-fields input, .master-record-editor-fields select, .master-record-editor-fields textarea { width: 100%; min-height: 46px; padding: 0 11px; color: var(--ink); background: #fff; border: 1px solid #bdc8c0; border-radius: 7px; outline: 0; font: inherit; font-size: 14px; line-height: 1.4; }
.master-record-editor-fields textarea { min-height: 105px; padding-block: 10px; resize: vertical; }
.master-record-editor-fields input:focus, .master-record-editor-fields select:focus, .master-record-editor-fields textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,131,66,.12); }
.master-record-field-wide { grid-column: 1 / -1; }
.facility-editor-dialog { width: min(540px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.facility-editor-dialog .facility-editor-fields { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.facility-editor-fields label { display: grid; gap: 6px; }
.facility-editor-fields label:first-child { grid-column: 1 / -1; }
.facility-editor-fields label span, .facility-editor-capacity > span { color: var(--forest); font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.facility-editor-fields input { width: 100%; min-height: 48px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #bdc8c0; border-radius: 7px; outline: 0; font-size: 16px; }
.facility-editor-fields input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,131,66,.12); }
.facility-editor-capacity { grid-column: 1 / -1; padding: 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 12px; background: #f8f2f4; border-radius: 8px; }
.facility-editor-capacity strong { color: var(--wine); font-size: 24px; }
.facility-editor-capacity small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.facility-editor-dialog .facility-editor-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.master-editor-dialog .master-editor-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.facility-editor-actions .btn { min-height: 48px; }
.facility-delete-button { grid-column: 1 / -1; grid-row: 2; color: #fff; background: #a12638; border-color: #a12638; }
.facility-delete-button:disabled { opacity: .45; cursor: not-allowed; }
body.facility-editor-open { overflow: hidden; }

@media (max-width: 900px) {
  .master-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .master-sidebar { padding: 14px; }
  .master-sidebar h3 { margin: 4px 0 12px; font-size: 15px; }
  .master-sidebar > div { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; scroll-snap-type: x proximity; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .master-sidebar > div::-webkit-scrollbar { height: 5px; }
  .master-sidebar button { min-height: 44px; flex: 0 0 145px; scroll-snap-align: start; }
  .master-content { width: 100%; max-width: 100%; padding: 18px; overflow: hidden; }
}
.dispatch-session { width: auto; }
.dispatch-return { min-height: 34px; margin-left: 8px; padding: 0 11px; display: flex; align-items: center; color: var(--wine); border: 1px solid #d8bfc7; font-size: 9px; text-decoration: none; }
.dispatch-online-value { color: var(--green); font-size: 21px; }
.dispatch-page-panel { margin-top: 14px; padding: 22px; background: #fff; border: 1px solid var(--line); }
.embedded-dispatch-panel { margin: 0 0 16px; border-top: 4px solid var(--wine); }
#module-despachados { padding: 10px 10px 82px; background: #f4f7f4; }
.dispatch-workspace { width: min(1040px,100%); margin: 0 auto; padding-bottom: 68px; display: grid; gap: 8px; }
.dispatch-filter-section { padding: 8px 9px; }
.dispatch-list-panel { min-height: 0; }
.dispatch-pallet-list { max-height: max(280px,calc(100dvh - 360px)); }
.dispatch-pallet-item { cursor: pointer; }
.dispatch-pallet-item time { text-align: right; }
.dispatch-compact-controls { display: grid; gap: 7px; }
.dispatch-compact-controls .dispatch-folio-filter { margin: 0; padding: 8px 10px; background: #fff; border: 1px solid var(--line); }
.dispatch-compact-controls .dispatch-folio-filter > span { font-size: 7px; }
.dispatch-compact-controls .dispatch-folio-filter input { min-height: 36px; }
.dispatch-camera-button-filter { min-width: 0; padding: 7px 9px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); }
.dispatch-camera-button-filter > small { color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#dispatchCameraButtonFilters { min-width: 0; padding: 2px 2px 5px; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
#dispatchCameraButtonFilters button { position: relative; min-width: 42px; min-height: 32px; padding: 4px 10px; flex: 0 0 auto; color: var(--green); background: #fff; border: 1px solid var(--green); border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 700; box-shadow: 0 4px 10px rgba(18,131,66,.08); }
#dispatchCameraButtonFilters button::after { content: ""; position: absolute; top: 4px; right: 4px; width: 4px; height: 4px; background: #c6cec9; border-radius: 50%; opacity: .45; }
#dispatchCameraButtonFilters button.has-pallet::after { background: #20c768; opacity: 1; box-shadow: 0 0 7px rgba(32,199,104,.75); }
#dispatchCameraButtonFilters button.active { color: #fff; background: var(--green); box-shadow: 0 6px 14px rgba(18,131,66,.2); }
#dispatchCameraButtonFilters button.active.has-pallet::after { background: #fff; box-shadow: 0 0 7px rgba(255,255,255,.9); }
.dispatch-module-actions { position: fixed; z-index: 190; bottom: max(12px,env(safe-area-inset-bottom)); left: calc(50% + var(--sidebar-half)); width: min(820px,calc(100vw - var(--sidebar) - 24px)); padding: 0; background: transparent; border: 0; transform: translateX(-50%); }
.dispatch-default-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; animation: processActionSwap .2s ease both; }
.dispatch-default-actions[hidden] { display: none; }
.dispatch-default-actions button, .dispatch-module-actions > .btn { min-width: 0; min-height: 54px; padding: 6px 9px; color: #fff; background: var(--green); border: 1px solid rgba(255,255,255,.16); cursor: pointer; font-size: 11px; font-weight: 700; box-shadow: 0 6px 16px rgba(18,131,66,.2),0 0 14px rgba(18,131,66,.08); }
.dispatch-default-actions button.active { background: var(--green-dark); border-color: #fff; box-shadow: 0 0 0 2px var(--green-dark),0 10px 22px rgba(12,73,38,.3); }
.dispatch-module-actions > strong { display: none; }
.dispatch-module-actions > .btn { width: 100%; background: var(--wine); border-color: var(--wine); animation: processActionSwap .22s ease both; }
.dispatch-module-actions > .btn[hidden] { display: none; }
body.dispatch-modal-open .dispatch-module-actions { z-index: 160; pointer-events: none; }
@media (max-width: 1024px) {
  .dispatch-module-actions { left: 50%; width: min(820px,calc(100vw - 24px)); }
}
@media (max-width: 700px) {
  .dispatch-module-actions { right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); left: 8px; width: auto; transform: none; }
  .dispatch-default-actions { gap: 5px; }
  .dispatch-default-actions button, .dispatch-module-actions > .btn { min-height: 52px; padding: 4px 3px; font-size: 9px; overflow-wrap: anywhere; }
}
.dispatch-page-head { margin-bottom: 15px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.dispatch-page-head h2 { margin: 3px 0 5px; font-size: 21px; font-weight: 500; }
.dispatch-page-head > div > span { color: var(--muted); font-size: 10px; }
.dispatch-page-search { width: min(310px, 100%); margin: 0; }
.dispatch-readonly-cell { color: var(--muted); font-size: 9px; font-style: italic; }
.dispatch-visual-workspace { grid-template-columns: minmax(0, 1fr) 300px; }
.dispatch-empty-row td { height: 210px; color: var(--muted); text-align: center; font-size: 11px; }
.dispatch-visual-detail .btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 680px) {
  .user-directory { padding: 1rem; }
  .pallet-register-section { padding: 1rem; }
  .user-directory-head { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .pallet-register-filters { align-items: stretch; flex-direction: column; }
  .pallet-register-filters .camera-pallet-search, .pallet-register-filters .btn { width: 100%; }
  #module-tuneles .compact-rack { grid-template-columns: repeat(2, minmax(96px, 1fr)); gap: 9px; }
  .picker-toolbar { align-items: stretch; flex-direction: column; }
  .tunnel-selector-actions { width: 100%; }
  .tunnel-selector-actions .entry-field { flex: 1; }
  .tunnel-close-button { align-self: end; }
  .master-layout { border-inline: 0; }
  .master-sidebar { padding: 12px; }
  .master-sidebar > small { display: none; }
  .master-sidebar h3 { margin-bottom: 9px; font-size: 14px; }
  .master-sidebar button { min-height: 48px; flex-basis: 138px; }
  .master-sidebar > div { padding-bottom: 0; scrollbar-width: none; }
  .master-sidebar > div::-webkit-scrollbar { display: none; }
  .master-content { padding: 14px 10px 22px; }
  .master-content-head { align-items: stretch; flex-direction: column; }
  .master-content-head h3 { margin-block: 2px; }
  .master-empty-button { width: 100%; padding-inline: 12px; white-space: normal; }
  .master-table-wrap { max-height: none; overflow: visible; border: 0; }
  .master-data-table { width: 100%; min-width: 0; display: block; }
  .master-data-table thead { display: none; }
  .master-data-table tbody { display: grid; gap: 10px; }
  .master-data-table tr { width: 100%; display: block; padding: 13px; background: #fff; border: 1px solid var(--line); box-shadow: 0 3px 12px rgba(28,47,35,.04); }
  .master-data-table td { width: 100%; max-width: none; min-height: 32px; padding: 7px 0; display: grid; grid-template-columns: minmax(86px, 34%) minmax(0, 1fr); gap: 10px; overflow: visible; border: 0; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
  .master-inline-input, .master-number-input { width: 100%; }
  .master-data-table td::before { content: attr(data-label); color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
  .master-data-table .master-row-actions { position: static; margin-top: 5px; padding-top: 11px; display: grid; grid-template-columns: 1fr 1fr; box-shadow: none; border-top: 1px solid var(--line); }
  .master-data-table .master-row-actions::before { display: none; }
  .master-row-actions .btn { min-height: 42px; font-size: 9px; }
  .master-data-table tbody:has(.master-facility-row) { gap: 7px; }
  .master-data-table .master-facility-row { padding: 10px 10px 10px 13px; overflow: hidden; display: grid; grid-template-columns: minmax(0,1fr) 88px; align-items: center; gap: 10px; border: 0; border-left: 4px solid var(--green); border-radius: 9px; box-shadow: 0 3px 12px rgba(28,47,35,.08); }
  .master-data-table .master-facility-row td { min-height: 0; padding: 0; display: block; }
  .master-data-table .master-facility-row td::before { display: none; }
  .master-data-table .master-facility-row td:first-child { grid-column: 1; min-width: 0; padding: 0; color: var(--ink); border: 0; }
  .master-facility-name { display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .master-facility-summary { margin-top: 4px; display: block; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
  .master-data-table .master-facility-row td:nth-child(2), .master-data-table .master-facility-row td:nth-child(3), .master-data-table .master-facility-row td:nth-child(4) { display: none; }
  .master-data-table .master-facility-row .master-row-actions { grid-column: 2; margin: 0; padding: 0; display: block; border: 0; box-shadow: none; }
  .master-facility-row .master-row-actions .btn { width: 100%; min-height: 44px; padding-inline: 8px; border-radius: 7px; font-size: 10px; }
  .master-data-table .master-generic-row { padding: 10px 10px 10px 13px; overflow: hidden; display: grid; grid-template-columns: minmax(0,1fr) 88px; align-items: center; gap: 10px; border: 0; border-left: 4px solid var(--wine); border-radius: 9px; box-shadow: 0 3px 12px rgba(28,47,35,.08); }
  .master-data-table .master-generic-row td { min-height: 0; padding: 0; display: block; }
  .master-data-table .master-generic-row td::before { display: none; }
  .master-data-table .master-generic-row .master-record-primary { grid-column: 1; min-width: 0; }
  .master-record-name { display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .master-record-summary { margin-top: 4px; display: block; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
  .master-data-table .master-generic-row .master-record-detail { display: none; }
  .master-data-table .master-generic-row .master-row-actions { grid-column: 2; margin: 0; padding: 0; display: block; border: 0; box-shadow: none; }
  .master-generic-row .master-row-actions .btn { width: 100%; min-height: 44px; padding-inline: 8px; border-radius: 7px; font-size: 10px; }
  .master-editor { align-items: center; padding: 8px; }
  .master-editor.facility-editor { align-items: center; padding: 12px; }
  .master-editor-dialog { width: 100%; max-height: calc(100dvh - 16px); padding: 18px; overflow-y: auto; }
  .master-editor-dialog textarea { min-height: clamp(200px, 42dvh, 340px); resize: vertical; }
  .master-editor-dialog .master-record-editor-fields { max-height: 48dvh; grid-template-columns: 1fr; }
  .master-record-editor-fields textarea { min-height: 105px; }
  .master-record-field-wide { grid-column: auto; }
  .facility-editor-dialog .facility-editor-fields { grid-template-columns: 1fr; gap: 12px; }
  .facility-editor-fields label:first-child, .facility-editor-capacity { grid-column: auto; }
  .dispatch-session { width: 100%; }
  #module-despachados { padding: 7px; }
  .dispatch-page-panel { padding: 15px; }
  .dispatch-page-head { align-items: stretch; flex-direction: column; }
  .dispatch-page-search { width: 100%; }
  .dispatch-visual-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .master-sidebar button { flex-basis: 132px; }
  .master-content-head h3 { font-size: 19px; overflow-wrap: anywhere; }
  .master-data-table td { grid-template-columns: minmax(76px, 32%) minmax(0, 1fr); }
  .master-editor-dialog { padding: 16px 14px; }
  .master-editor-dialog > div { display: grid; grid-template-columns: 1fr 1fr; }
  .master-editor-dialog .btn { min-width: 0; padding-inline: 8px; }
}

/* Navegación de módulos: siempre en una sola fila */
.module-grid {
  display: flex;
  grid-template-columns: none;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 3px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.module-card {
  flex: 1 1 0;
  min-width: 0;
  scroll-snap-align: start;
}

@media (max-width: 1180px) {
  .module-grid { grid-template-columns: none; }
  .module-card { flex: 0 0 210px; min-width: 210px; }
}

@media (max-width: 760px) {
  .module-grid { grid-template-columns: none; }
  .module-card { flex: 0 0 min(230px, 78vw); min-width: min(230px, 78vw); }
}

/* Menú compacto para administradores y jefaturas */
.module-section.icon-only-menu .module-grid { gap: 4px; overflow: hidden; padding-bottom: 0; scroll-snap-type: none; }
.module-section.icon-only-menu .module-card { min-width: 0; min-height: 50px; padding: 5px 2px; flex: 1 1 0; display: grid; grid-template-columns: 1fr; place-items: center; }
.module-section.icon-only-menu .module-card > span:not(.module-icon),
.module-section.icon-only-menu .module-card > i { display: none; }
.module-section.icon-only-menu .module-icon { width: 40px; height: 40px; }
.module-section.icon-only-menu .module-icon svg { width: 24px; height: 24px; }

@media (max-width: 430px) {
  .module-section.icon-only-menu { padding: 5px; }
  .module-section.icon-only-menu .module-grid { gap: 2px; }
  .module-section.icon-only-menu .module-card { min-height: 44px; padding-inline: 0; }
  .module-section.icon-only-menu .module-icon { width: 31px; height: 31px; border-radius: 8px; }
  .module-section.icon-only-menu .module-icon svg { width: 19px; height: 19px; }
  .module-section.icon-only-menu .module-icon::after { top: 3px; right: 3px; width: 4px; height: 4px; border-width: 1px; }
}

/* Despacho operativo desde cámaras */
.camera-selector-actions { min-width: 0; display: flex; align-items: end; justify-content: center; gap: 9px; }
.camera-button-picker { min-width: 0; align-items: center; }
.camera-button-options { width: min(72vw,640px); justify-content: center; }
.camera-selector-button { min-width: 50px; flex-basis: 50px; }
.camera-dispatch-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.dispatch-title { align-items: center; }
.dispatch-session { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dispatch-session strong { font-size: 9px; }
.dispatch-camera-controls { display: grid; grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto; align-items: end; gap: 10px; }
.dispatch-folio-filter { min-width: 0; }
.dispatch-action-cluster { display: flex; align-items: center; gap: 8px; }
.dispatch-open-button { min-height: 44px; min-width: 130px; }
.dispatch-open-button:disabled { opacity: .45; cursor: not-allowed; }
.dispatch-selected-count { padding: 7px 10px; color: var(--wine); background: #f7ecef; border: 1px solid #e5ccd3; font-size: 10px; white-space: nowrap; }
.dispatch-list-empty { margin: 0; padding: 52px 16px; color: var(--muted); text-align: center; font-size: 10px; }
.dispatch-modal { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 16px; }
.dispatch-modal[hidden] { display: none; }
.dispatch-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(10,18,14,.72); border: 0; }
.dispatch-modal-dialog { position: relative; z-index: 1; width: min(620px, 100%); max-height: calc(100vh - 32px); padding: 24px; overflow: auto; background: #fff; border-top: 4px solid var(--wine); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.dispatch-modal-dialog h2 { margin: 4px 0 20px; font-size: 22px; font-weight: 500; }
.camera-dispatch-picker-dialog { width: min(760px,100%); overflow: hidden; }
.camera-dispatch-picker-filters { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
.camera-dispatch-picker-list { max-height: min(48dvh,430px); margin-top: 13px; padding-right: 3px; display: grid; gap: 7px; overflow-y: auto; }
.camera-dispatch-picker-item { width: 100%; min-width: 0; padding: 10px 12px; display: grid; grid-template-columns: minmax(0,1fr) 28px; align-items: center; gap: 10px; color: var(--ink); text-align: left; background: #fff; border: 1px solid var(--line); border-left: 4px solid #c8d4cc; cursor: pointer; }
.camera-dispatch-picker-item > span { min-width: 0; display: grid; gap: 3px; }
.camera-dispatch-picker-item b { font-size: 11px; }
.camera-dispatch-picker-item small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.camera-dispatch-picker-item em { overflow: hidden; color: #496557; font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.camera-dispatch-picker-item > i { width: 26px; height: 26px; display: grid; place-items: center; color: var(--green); background: var(--green-light); border-radius: 50%; font-size: 13px; font-style: normal; font-weight: 700; }
.camera-dispatch-picker-item.selected { background: #fff7fa; border-color: var(--wine); border-left-color: var(--wine); }
.camera-dispatch-picker-item.selected > i { color: #fff; background: var(--wine); }
.camera-dispatch-picker-actions { margin-top: 13px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; }
.camera-dispatch-picker-actions strong { color: var(--wine); font-size: 10px; }
.dispatch-modal-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; color: var(--muted); background: #f2f4f1; border: 0; font-size: 22px; cursor: pointer; }
.dispatch-modal-list-head { margin-top: 18px; padding-bottom: 8px; display: flex; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.dispatch-modal-list-head strong { font-size: 11px; }
.dispatch-modal-list-head span { color: var(--muted); font-size: 8px; }
.dispatch-selected-list { --dispatch-selected-row-height: 52px; max-height: calc(var(--dispatch-selected-row-height) * 5); margin: 0; padding: 0; overflow-x: hidden; overflow-y: auto; list-style: none; }
.dispatch-selected-list li { min-height: var(--dispatch-selected-row-height); padding: 9px 4px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); box-sizing: border-box; }
.dispatch-selected-list strong { font-size: 10px; }
.dispatch-selected-list span { color: var(--muted); font-size: 9px; text-align: right; }
.dispatch-modal-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 8px; }
.dispatch-modal-open { overflow: hidden; }
.dispatch-success { padding: 10px 0 2px; text-align: center; }
.dispatch-success-icon { width: 68px; height: 68px; margin: 0 auto 16px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 10px rgba(18,131,66,.09); }
.dispatch-success-icon svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.dispatch-success > p:not(.detail-kicker) { max-width: 490px; margin: -8px auto 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.dispatch-success-summary { margin: 18px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: left; }
.dispatch-success-summary > span { min-width: 0; padding: 12px; display: grid; gap: 4px; background: #f3f6f3; border: 1px solid var(--line); }
.dispatch-success-summary small { color: var(--muted); font-size: 7px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.dispatch-success-summary strong { overflow-wrap: anywhere; color: var(--forest); font-size: 12px; }
.dispatch-report-actions { display: flex; align-items: center; justify-content: center; gap: 9px; }
.dispatch-report-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.dispatch-report-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dispatch-success-close { width: 100%; min-height: 40px; margin-top: 10px; }

@media (max-width: 680px) {
  .camera-map-toolbar { align-items: center; text-align: center; }
  .camera-map-toolbar > div { width: 100%; text-align: center; }
  .camera-map-heading { align-items: center; justify-content: center; flex-wrap: wrap; }
  .camera-map-heading > div { width: auto; flex: 1 1 120px; text-align: right; }
  .camera-return-batch-button { min-height: 39px; flex: 0 0 auto; }
  .camera-selector-actions { width: 100%; justify-content: center; }
  .camera-button-picker, .camera-button-options { width: 100%; max-width: none; }
  .camera-button-picker { flex: 1; }
  .camera-selector-button { width: 44px; min-width: 44px; min-height: 34px; padding: 3px; flex-basis: 44px; border-width: 1px; font-size: 7px; }
  .camera-selector-button.short-label { font-size: 14px; }
  #module-camaras { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  #module-tuneles { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tunnel-pallet-action-bar { right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); left: 8px; width: auto; max-width: none; padding: 0; gap: 6px; transform: none; }
  .tunnel-pallet-action-bar button { min-height: 52px; padding: 4px 3px; font-size: 10px; text-align: center; }
  .camera-pallet-action-bar { right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); left: 8px; width: auto; max-width: none; padding: 0; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; transform: none; }
  .camera-pallet-action-bar button { width: 100%; min-width: 0; min-height: 52px; padding: 4px 3px; display: grid; place-items: center; border-radius: 0; font-size: 9px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
  .camera-dispatch-link { padding-inline: 12px; }
  .dispatch-title { align-items: stretch; }
  .dispatch-camera-controls { grid-template-columns: minmax(0, 1fr) auto; }
  .dispatch-folio-filter { grid-column: 1 / -1; grid-row: 2; }
  .dispatch-action-cluster { grid-column: 2; grid-row: 1; }
  .dispatch-open-button { min-width: 112px; }
  .dispatch-modal-dialog { padding: 19px; }
  .camera-dispatch-picker-dialog { width: 100%; max-height: calc(100dvh - 16px); padding: 18px 12px 12px; }
  .camera-dispatch-picker-filters { grid-template-columns: 1fr; gap: 7px; }
  .camera-dispatch-picker-list { max-height: 43dvh; margin-top: 9px; }
  .camera-dispatch-picker-item { padding: 9px; }
  .camera-dispatch-picker-actions { grid-template-columns: 1fr 1fr; }
  .camera-dispatch-picker-actions strong { grid-column: 1 / -1; text-align: right; }
  .camera-dispatch-picker-actions .btn { min-width: 0; padding-inline: 7px; font-size: 9px; }
  .dispatch-modal-list-head, .dispatch-selected-list li { align-items: flex-start; flex-direction: column; gap: 4px; }
  .dispatch-selected-list { --dispatch-selected-row-height: 60px; }
  .dispatch-selected-list span { text-align: left; }
  .dispatch-modal-actions .btn { flex: 1; }
  .dispatch-success { padding-top: 5px; }
  .dispatch-success-icon { width: 58px; height: 58px; }
  .dispatch-success-summary { grid-template-columns: 1fr; gap: 6px; }
  .dispatch-report-actions { align-items: stretch; flex-direction: column; }
  .dispatch-report-button { width: 100%; }
  .module-session { width: 100%; }
  .module-session strong { flex: 1; white-space: normal; }
  .module-session .btn { margin-left: 0; }
  .dispatch-workspace { padding-bottom: 62px; gap: 6px; }
  .dispatch-filter-section { padding: 6px 7px; }
  .dispatch-pallet-list { max-height: max(250px,calc(100dvh - 330px)); }
  .dispatch-pallet-item time { grid-column: 2; text-align: left; }
}

/* Vistas publicas de seguimiento */
.visual-main { width: min(calc(100% - var(--sidebar)), 1700px); }
.visual-hero { min-height: 112px; margin-bottom: 18px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--wine); }
.visual-title-block { min-width: 0; flex: 1 1 auto; }
.visual-title-block > p { margin: 0 0 7px; color: var(--wine); font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.visual-live { min-width: 190px; min-height: 58px; padding: 8px 9px 8px 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #dce8e0; background: var(--forest); border-left: 4px solid var(--green); }
.visual-live-status { min-width: 0; display: flex; align-items: center; gap: 10px; }
.visual-live-status > i { width: 8px; height: 8px; flex: 0 0 auto; background: #58bd79; border-radius: 50%; box-shadow: 0 0 0 5px rgba(88,189,121,.12); }
.visual-live-status > span { min-width: 0; display: grid; gap: 2px; }
.visual-live-status small { color: #b9cbc0; font-size: 8px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.visual-live-status strong { color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.visual-live button { width: 40px; height: 40px; flex: 0 0 40px; padding: 0; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); border-radius: 50%; cursor: pointer; }
.visual-live button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visual-live button:hover { background: rgba(255,255,255,.16); }
.visual-live button:focus-visible { outline: 3px solid rgba(88,189,121,.4); outline-offset: 2px; }
.visual-live button:disabled { opacity: .65; cursor: wait; }
.visual-live button.is-refreshing svg { animation: visual-refresh-spin .8s linear infinite; }
@keyframes visual-refresh-spin { to { transform: rotate(360deg); } }

.visual-kpis { margin-bottom: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.visual-kpis article { position: relative; min-height: 112px; padding: 20px 21px 17px; display: grid; align-content: center; overflow: hidden; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--green); }
.visual-kpis article::after { content: ""; position: absolute; right: -22px; bottom: -31px; width: 90px; height: 90px; background: var(--green-light); border-radius: 50%; opacity: .75; }
.visual-kpis article.wine { border-top-color: var(--wine); }
.visual-kpis article.wine::after { background: #f6e9ee; }
.visual-kpis article.blue { border-top-color: var(--blue); }
.visual-kpis article.blue::after { background: #eaf2fd; }
.visual-kpis article > * { position: relative; z-index: 1; }
.visual-kpis article > span { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.visual-kpis article > strong { margin: 3px 0; font-size: 31px; line-height: 1; letter-spacing: -.04em; }
.visual-kpis article > small { color: var(--muted); font-size: 9px; }

.visual-section { margin-top: 16px; background: #fff; border: 1px solid var(--line); }
.visual-section > header { min-height: 68px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.visual-section > header small { display: block; margin-bottom: 3px; color: var(--wine); font-size: 8px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.visual-section > header h2 { margin: 0; font-size: 19px; font-weight: 500; }
.visual-section > header div > span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.visual-flow { padding: 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.visual-flow article { min-height: 78px; padding: 13px; display: flex; align-items: center; gap: 12px; background: #f7f9f7; border: 1px solid #e7ebe7; }
.visual-flow article > span { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: var(--forest); border-radius: 50%; font-size: 10px; font-weight: 600; }
.visual-flow article small { display: block; color: var(--muted); font-size: 9px; line-height: 1.3; }
.visual-flow article strong { display: block; margin-top: 3px; font-size: 20px; }

.visual-facility-grid { padding: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 12px; }
.visual-facility-card { min-width: 0; padding: 17px; background: #f8faf8; border: 1px solid #e3e8e4; border-left: 4px solid var(--green); }
.visual-facility-card > div:first-child { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.visual-facility-card > div:first-child > span { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.visual-facility-card > div:first-child > strong { flex: 0 0 auto; color: var(--forest); font-size: 19px; }
.visual-facility-card strong small { color: var(--muted); font-size: 10px; font-weight: 400; }
.visual-progress { height: 7px; margin: 15px 0 9px; overflow: hidden; background: #dfe7e1; border-radius: 8px; }
.visual-progress i { height: 100%; display: block; background: var(--green); border-radius: inherit; transition: width .25s ease; }
.visual-facility-card footer { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 8px; }
.visual-facility-card footer span:last-child { text-align: right; }

.visual-search { width: min(320px, 42vw); display: grid; gap: 5px; }
.visual-search > span { color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.visual-search input { width: 100%; min-height: 39px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #cfd7d1; outline: 0; font-size: 11px; }
.visual-search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(18,131,66,.1); }
.visual-table-wrap { position: relative; min-height: 150px; overflow-x: auto; }
.visual-table-wrap table { min-width: 650px; }
.visual-table-wrap th { padding-block: 11px; font-size: 8px; }
.visual-table-wrap td { padding-block: 12px; font-size: 10px; }
.visual-primary-cell { color: var(--forest); font-weight: 600; }
.visual-process-cell { min-width: 230px; color: #355c46; font-size: 9px !important; line-height: 1.55; white-space: normal; }
.visual-status-cell { font-weight: 600; }
.visual-status-recepcionado { color: var(--wine); }
.visual-status-en_tunel { color: var(--blue); }
.visual-status-camaras, .visual-status-refrigerado { color: #ad650b; }
.visual-status-almacenado { color: var(--green); }
.visual-status-despachado { color: var(--muted); }
.visual-empty { margin: 0; min-height: 150px; padding: 56px 18px; color: var(--muted); text-align: center; font-size: 10px; }
.visual-empty[hidden], .visual-facility-grid[hidden] { display: none; }
[data-visual-table] tr[hidden] { display: none !important; }

@media (max-width: 1024px) {
  .visual-main { width: 100%; }
  .visual-hero { padding-left: 64px; }
  .visual-title-block { text-align: center; }
  .visual-flow { grid-template-columns: repeat(5, minmax(145px, 1fr)); overflow-x: auto; scroll-snap-type: x proximity; }
  .visual-flow article { scroll-snap-align: start; }
}

@media (max-width: 680px) {
  .visual-main { padding-inline: 11px; }
  .visual-hero { min-height: 96px; margin-bottom: 11px; padding: 10px 10px 10px 58px; display: grid; grid-template-columns: minmax(0,1fr); justify-items: center; align-items: center; gap: 8px; }
  .visual-live { width: min(260px,100%); justify-self: center; }
  .visual-hero h1 { font-size: clamp(23px, 7vw, 29px); line-height: 1.05; }
  .visual-hero .page-subtitle { margin-top: 5px; font-size: 10px; line-height: 1.35; }
  .visual-title-block > p { margin-bottom: 5px; font-size: 7px; letter-spacing: .11em; }
  .visual-live { min-width: 139px; min-height: 52px; padding: 6px 6px 6px 11px; gap: 8px; }
  .visual-live-status { gap: 7px; }
  .visual-live-status > i { width: 7px; height: 7px; box-shadow: 0 0 0 4px rgba(88,189,121,.12); }
  .visual-live-status small { font-size: 7px; }
  .visual-live-status strong { font-size: 10px; }
  .visual-live button { width: 38px; height: 38px; flex-basis: 38px; }
  .visual-kpis { margin-bottom: 10px; gap: 6px; }
  .visual-kpis article { min-height: 91px; padding: 13px 9px 11px; }
  .visual-kpis article::after { right: -30px; bottom: -38px; }
  .visual-kpis article > span { font-size: 7px; line-height: 1.25; }
  .visual-kpis article > strong { margin-block: 5px 3px; font-size: 25px; }
  .visual-kpis article > small { font-size: 7px; line-height: 1.2; }
  .visual-section { margin-top: 10px; }
  .visual-section > header { min-height: 0; padding: 13px; align-items: stretch; flex-direction: column; gap: 11px; }
  .visual-section > header h2 { font-size: 17px; }
  .visual-flow { padding: 11px; grid-template-columns: repeat(5, 142px); gap: 7px; }
  .visual-flow article { min-height: 67px; padding: 10px; }
  .visual-facility-grid { padding: 10px; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .visual-facility-card { padding: 13px; border-radius: 7px; }
  .visual-progress { margin-block: 11px 7px; }
  .visual-search { width: 100%; }
  .visual-search input { min-height: 44px; font-size: 13px; }
  .visual-table-wrap { min-height: 0; padding: 10px; overflow: visible; background: #f4f7f4; }
  .visual-table-wrap table { width: 100%; min-width: 0; display: block; }
  .visual-table-wrap thead { display: none; }
  .visual-table-wrap tbody { display: grid; gap: 8px; }
  .visual-table-wrap tr { width: 100%; padding: 11px 12px; display: block; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); box-shadow: 0 2px 8px rgba(28,47,35,.04); }
  .visual-table-wrap td { width: 100%; min-height: 25px; padding: 4px 0; display: grid; grid-template-columns: minmax(77px, 31%) minmax(0, 1fr); gap: 9px; overflow-wrap: anywhere; border: 0; font-size: 10px; line-height: 1.35; white-space: normal; }
  .visual-table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: 7px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
  .visual-status-cell { color: inherit; }
  .visual-empty { min-height: 112px; padding: 42px 12px; background: #fff; }
}

@media (max-width: 380px) {
  .visual-kpis article { padding-inline: 7px; }
  .visual-kpis article > strong { font-size: 22px; }
  .visual-hero { min-height: 88px; padding: 11px 9px; gap: 7px; }
  .visual-hero .page-subtitle { max-width: 170px; font-size: 9px; }
  .visual-live { min-width: 119px; padding-left: 8px; gap: 5px; }
  .visual-live-status { gap: 5px; }
  .visual-live-status small { display: none; }
  .visual-live button { width: 36px; height: 36px; flex-basis: 36px; }
}

@media (max-width: 380px) {
  .camera-pallet-action-bar { right: 5px; left: 5px; padding: 0; gap: 4px; }
  .camera-pallet-action-bar button { min-height: 50px; padding-inline: 2px; font-size: 8px; }
}

.dispatch-instruction-trigger { padding: 0; color: var(--wine); background: transparent; border: 0; cursor: pointer; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.dispatch-instruction-detail { min-height: 34px; padding-inline: 12px; font-size: 9px; }
.dispatch-instruction-modal { z-index: 220; }
.dispatch-instruction-dialog { width: min(980px,100%); max-height: calc(100dvh - 32px); padding: 24px; overflow: hidden; }
.dispatch-instruction-dialog .camera-popover-close { z-index: 3; }
.dispatch-instruction-dialog > .dispatch-instruction-summary { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; gap: 10px; }
.dispatch-instruction-summary > span { min-width: 0; padding: 13px 14px; display: grid; gap: 4px; background: #f3f6f3; border: 1px solid var(--line); }
.dispatch-instruction-summary small { color: var(--muted); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.dispatch-instruction-summary strong { overflow-wrap: anywhere; color: var(--forest); font-size: 15px; }
.dispatch-visual-report-actions { margin-top: 10px; justify-content: flex-end; }
.dispatch-instruction-dialog > .dispatch-instruction-table-wrap { max-height: min(56dvh,540px); margin-top: 14px; padding: 0; display: block; overflow: auto; border: 1px solid var(--line); background: #fff; }
.dispatch-instruction-table-wrap table { width: max-content; min-width: 100%; border-collapse: collapse; }
.dispatch-instruction-table-wrap th { position: sticky; top: 0; z-index: 2; background: #f2f4f1; }
body.dispatch-instruction-open { overflow: hidden; }

@media (max-width: 680px) {
  .dispatch-instruction-modal { padding: 8px; }
  .dispatch-instruction-dialog { width: 100%; max-height: calc(100dvh - 16px); padding: 19px 10px 12px; overflow-y: auto; }
  .dispatch-instruction-dialog > .dispatch-instruction-summary { grid-template-columns: 1fr; gap: 7px; }
  .dispatch-visual-report-actions { align-items: stretch; flex-direction: column; }
  .dispatch-instruction-dialog > .dispatch-instruction-table-wrap { max-height: 50dvh; padding: 8px; overflow-y: auto; background: #f4f7f4; }
  .dispatch-instruction-table-wrap table { width: 100%; min-width: 0; }
  .dispatch-instruction-detail { width: 100%; min-height: 42px; }
}

.visual-facility-card.interactive { width: 100%; color: var(--ink); text-align: left; border-top: 1px solid #e3e8e4; border-right: 1px solid #e3e8e4; border-bottom: 1px solid #e3e8e4; border-left: 4px solid var(--green); cursor: pointer; font: inherit; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.visual-facility-card.interactive:hover, .visual-facility-card.interactive:focus-visible { transform: translateY(-2px); border-color: var(--green); outline: 0; box-shadow: 0 10px 22px rgba(18,131,66,.13); }
.camera-visual-modal { z-index: 220; }
.camera-visual-dialog { width: min(1120px,100%); max-height: calc(100dvh - 32px); padding: 24px; overflow: hidden; }
.camera-visual-dialog .camera-popover-close { z-index: 3; }
.camera-visual-dialog > .camera-visual-head { margin: 0 34px 16px 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.camera-visual-head > div { min-width: 0; }
.camera-visual-head small { color: #8faaa0; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.camera-visual-head h3 { margin: 5px 0 3px; }
.camera-visual-head p { margin: 0; color: var(--muted); font-size: 10px; }
.camera-visual-head .btn { min-width: 130px; }
.camera-visual-table-wrap { max-height: min(58dvh,600px); overflow: auto; border: 1px solid var(--line); }
.camera-visual-table-wrap table { width: 100%; min-width: 650px; border-collapse: collapse; }
.camera-visual-table-wrap th { position: sticky; top: 0; z-index: 2; background: #f2f4f1; }
#cameraVisualMapPanel[hidden], #cameraVisualListPanel[hidden] { display: none; }
#cameraVisualMapPanel { max-height: min(67dvh,680px); overflow: auto; }
.camera-readonly-map { min-width: 760px; padding-top: 14px; }
.camera-readonly-slot { cursor: default; }
.camera-readonly-slot:hover { border-color: #c8dce6; box-shadow: none; }
body.camera-visual-open { overflow: hidden; }
.tunnel-visual-modal { z-index: 220; }
.tunnel-visual-dialog { width: min(1120px,100%); max-height: calc(100dvh - 32px); padding: 24px; overflow: hidden; }
.tunnel-visual-dialog .camera-popover-close { z-index: 3; }
.tunnel-visual-dialog > .tunnel-visual-head { margin: 0 34px 16px 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.tunnel-visual-head > div { min-width: 0; }
.tunnel-visual-head small { color: #8faaa0; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.tunnel-visual-head h3 { margin: 5px 0 3px; }
.tunnel-visual-head p { margin: 0; color: var(--muted); font-size: 10px; }
.tunnel-visual-head .btn { min-width: 130px; }
.tunnel-visual-table-wrap { max-height: min(58dvh,600px); overflow: auto; border: 1px solid var(--line); }
.tunnel-visual-table-wrap table { width: 100%; min-width: 650px; border-collapse: collapse; }
.tunnel-visual-table-wrap th { position: sticky; top: 0; z-index: 2; background: #f2f4f1; }
#tunnelVisualMapPanel[hidden], #tunnelVisualListPanel[hidden] { display: none; }
#tunnelVisualMapPanel { max-height: min(67dvh,680px); overflow: auto; }
.tunnel-readonly-map { min-width: 700px; padding-top: 14px; }
.tunnel-readonly-slot { cursor: default; }
.tunnel-readonly-slot:hover { border-color: #bcd8c6; box-shadow: none; }
body.tunnel-visual-open { overflow: hidden; }

@media (max-width: 680px) {
  .camera-visual-modal { padding: 8px; }
  .camera-visual-dialog { width: 100%; max-height: calc(100dvh - 16px); padding: 18px 10px 12px; overflow-y: auto; }
  .camera-visual-dialog > .camera-visual-head { margin-right: 32px; align-items: stretch; flex-direction: column; gap: 10px; }
  .camera-visual-head .btn { width: 100%; min-height: 44px; }
  .camera-visual-table-wrap { max-height: 55dvh; padding: 8px; overflow-y: auto; background: #f4f7f4; }
  .camera-visual-table-wrap table { min-width: 0; }
  #cameraVisualMapPanel { max-height: 62dvh; }
  .camera-readonly-map { min-width: 700px; }
  .tunnel-visual-modal { padding: 8px; }
  .tunnel-visual-dialog { width: 100%; max-height: calc(100dvh - 16px); padding: 18px 10px 12px; overflow-y: auto; }
  .tunnel-visual-dialog > .tunnel-visual-head { margin-right: 32px; align-items: stretch; flex-direction: column; gap: 10px; }
  .tunnel-visual-head .btn { width: 100%; min-height: 44px; }
  .tunnel-visual-table-wrap { max-height: 55dvh; padding: 8px; overflow-y: auto; background: #f4f7f4; }
  .tunnel-visual-table-wrap table { min-width: 0; }
  #tunnelVisualMapPanel { max-height: 62dvh; }
  .tunnel-readonly-map { min-width: 650px; }
}

/* Tableros públicos renovados */
.visualization-page { background: #f1f5f2; }
.visualization-page .visual-main { padding-top: 22px; padding-bottom: 34px; }
.visual-kpis.visual-kpis-four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.visual-kpis.visual-kpis-five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.visual-kpis article.amber { border-top-color: #d28a20; }
.visual-kpis article.amber::after { background: #fff2dc; }
.visual-kpis article.dark { border-top-color: #151817; }
.visual-kpis article.dark::after { background: #e7ebe8; }
.visual-flow.visual-flow-seven { grid-template-columns: repeat(7,minmax(0,1fr)); }
.visual-flow article.ready { background: #fff7e8; border-color: #edd4a5; }
.visual-flow article.ready > span { background: #c97b14; }
.visual-process-grid { padding: 16px 18px 18px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.visual-process-grid article { position: relative; min-height: 82px; padding: 12px 13px 12px 48px; display: grid; align-content: center; gap: 3px; background: #f7faf8; border: 1px solid #dfe7e1; border-left: 4px solid var(--green); }
.visual-process-grid article b { position: absolute; left: 12px; top: 50%; width: 26px; height: 26px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 10px; transform: translateY(-50%); }
.visual-process-grid article span { color: var(--muted); font-size: 8px; font-weight: 600; }
.visual-process-grid article strong { color: var(--forest); font-size: 23px; line-height: 1; }
.visual-process-grid article.complete { background: #fff8eb; border-color: #ebd2a5; border-left-color: #c97b14; }
.visual-process-grid article.complete b { background: #c97b14; }
.visual-facility-card > div:first-child > span { display: flex; align-items: center; gap: 7px; }
.visual-facility-card > div:first-child > span > i { width: 7px; height: 7px; flex: 0 0 7px; background: #c5cec8; border-radius: 50%; }
.visual-facility-card.has-data > div:first-child > span > i { background: #24b95d; box-shadow: 0 0 0 4px rgba(36,185,93,.12),0 0 8px rgba(36,185,93,.5); }
.visual-facility-card.empty { border-left-color: #bcc6bf; }
.visual-facility-card.empty .visual-progress i { background: #aeb9b2; }
.visual-observation-cell { min-width: 175px; max-width: 280px; color: #89938d; font-size: 9px !important; line-height: 1.4; white-space: normal; }
.visual-observation-cell.has-observation { color: #7a4b07; background: #fff8e8; border-left: 3px solid #d28a20; }
.visual-pending-list { padding: 14px 18px 18px; display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 8px; }
.visual-pending-item { min-width: 0; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff9ed; border: 1px solid #ead4aa; border-left: 4px solid #d28a20; }
.visual-pending-item > span { min-width: 0; display: grid; gap: 3px; }
.visual-pending-item strong { overflow: hidden; color: var(--forest); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.visual-pending-item small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.visual-pending-item time { flex: 0 0 auto; color: #8a5b15; font-size: 8px; text-align: right; }
.visual-pending-item.pallet-fumigated { background: #e8f4fa; border-color: #9fc9dc; border-left-color: #236f93; }
.visual-pending-item.pallet-fumigated strong, .visual-pending-item.pallet-fumigated time { color: #236f93; }
.visual-return-item { background: #f5f6f5; border-color: #d9ddda; border-left-color: #151817; }
.visual-return-item time { color: #323835; }
.visual-return-section > header small { color: #151817; }
.visual-pending-section > .visual-empty, .visual-return-section > .visual-empty { margin: 0 18px 18px; min-height: 0; padding: 20px; background: #f7faf8; border: 1px dashed var(--line); }
.visual-pending-section > .visual-empty[hidden], .visual-return-section > .visual-empty[hidden] { display: none; }
.visual-table-wrap tbody tr { transition: background .15s ease; }
.visual-table-wrap tbody tr:hover { background: #f7faf8; }
.visual-table-wrap td { vertical-align: middle; }

/* Estado operativo activo: rojo uniforme para indicar que el modo está en funcionamiento. */
.tunnel-pallet-action-bar button.active,
.camera-pallet-action-bar button.active,
.process-default-actions button.active,
.dispatch-default-actions button.active,
.camera-return-batch-button.active,
.tunnel-relocate-mode-button.active,
.process-stage-filters button.active,
.process-tunnel-filters button.active,
#dispatchCameraButtonFilters button.active,
.tunnel-selector-button.active,
.camera-level-options button.active,
.camera-pallet-item.active,
.camera-popover-pallet.active,
.level-toggle button.active,
.tunnel-process-stage.active,
.camera-return-picker button.selected {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red),0 10px 22px rgba(172,25,36,.28);
}
.process-stage-filters button.active b,
.camera-level-options button.active b {
  color: var(--red);
  background: #fff;
}
.process-pallet-item.selected,
.camera-dispatch-picker-item.selected {
  background: #fff1f2;
  border-color: var(--red);
  border-left-color: var(--red);
}

@media (max-width: 1180px) {
  .visual-kpis.visual-kpis-four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .visual-kpis.visual-kpis-five { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .visual-flow.visual-flow-seven { grid-template-columns: repeat(7,150px); overflow-x: auto; }
}

@media (max-width: 700px) {
  .visualization-page .visual-main { padding-top: 10px; }
  .visual-kpis.visual-kpis-four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .visual-kpis.visual-kpis-five { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .visual-kpis.visual-kpis-five article:last-child { grid-column: 1 / -1; }
  .visual-process-grid { padding: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .visual-process-grid article { min-height: 70px; padding: 9px 8px 9px 39px; }
  .visual-process-grid article b { left: 8px; width: 23px; height: 23px; }
  .visual-process-grid article span { font-size: 7px; }
  .visual-process-grid article strong { font-size: 20px; }
  .visual-pending-list { padding: 9px; grid-template-columns: 1fr; gap: 6px; }
  .visual-pending-item { padding: 10px; }
  .visual-observation-cell { min-width: 0; max-width: none; }
  .visual-observation-cell.has-observation { padding: 7px 8px !important; display: block !important; border-left-width: 3px !important; }
}
