:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #1a1a1b;
  --muted: #8e8e93;
  --muted-2: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --gold: #d9a76e;
  --ok: #059669;
  --ok-bg: #d1fae5;
  --ok-text: #065f46;
  --warn: #f59e0b;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --rack: #f39c12;
  --zone: #10b981;
  --aisle: #34b0e8;
  --purple: #6c5ce7;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --font: "Figtree", system-ui, sans-serif;
  --font-ui: "Montserrat", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 1px 2px rgba(26, 26, 27, 0.04), 0 4px 16px rgba(26, 26, 27, 0.05);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

a { color: var(--primary); }
button, input, select, textarea { font: inherit; }

/* —— Shell: sidebar + topbar —— */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "side top"
    "side main";
}
.sidebar {
  grid-area: side;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 1.1rem 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0.5rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #e8c08a, var(--gold));
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.72rem;
  color: #fff;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.brand-block strong {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-block small {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.1rem;
}
.role-pill {
  margin: 0 0.4rem;
  padding: 0.45rem 0.65rem;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-group-label {
  margin: 0.65rem 0.5rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.nav-links a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--muted-2);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a .nav-ico {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 6px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--muted-2);
  flex-shrink: 0;
}
.nav-links a:hover { background: var(--bg); color: var(--ink); }
.nav-links a.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.nav-links a.active .nav-ico {
  background: var(--primary);
  color: #fff;
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.35rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.crumb {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.crumb span { color: var(--ink); }
.search-fake {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted-2);
  margin-left: auto;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.75rem;
}
.user-chip strong { color: var(--ink); display: block; font-size: 0.82rem; }

.main {
  grid-area: main;
  padding: 1.35rem 1.75rem 3rem;
  width: 100%;
  max-width: none;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.page-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.panel h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
label.field input,
label.field select,
label.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  color: var(--ink);
  background: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}
label.field input:focus,
label.field select:focus,
label.field textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}
label.field input.input-invalid,
label.field select.input-invalid,
.input-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.field-error {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--danger);
  line-height: 1.25;
}

.swal2-container {
  z-index: 2000 !important;
}
.swal2-popup {
  font-family: var(--font) !important;
  border-radius: 14px !important;
}
.swal2-title {
  font-family: var(--font-ui) !important;
  font-size: 1.2rem !important;
}
.swal2-confirm {
  border-radius: 8px !important;
}
.field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.select-ctl,
select.select-ctl,
input.select-ctl {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 2.2rem 0.55rem 0.85rem;
  color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232563eb' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 0.85rem center / 12px no-repeat;
  font-size: 0.92rem;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input.select-ctl {
  background-image: none;
  padding-right: 0.85rem;
  cursor: text;
}
.select-ctl:hover { border-color: #93c5fd; }
.select-ctl:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}
.select-inline {
  min-width: 180px;
  width: auto;
  flex: 1 1 180px;
}
label.field select.select-ctl {
  padding-right: 2.2rem;
}

.panel-filters { padding: 1rem 1.15rem; }
.filters-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 0.85rem;
  align-items: end;
}
.filters-actions { display: flex; align-items: end; padding-bottom: 0.05rem; }
@media (max-width: 900px) {
  .filters-row { grid-template-columns: 1fr; }
}

.dash-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.chip-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted-2);
  margin-right: 0.35rem;
}

.panel-wide, .panel-form { width: 100%; }
.table-wrap { overflow-x: auto; }
.data-wide { min-width: 960px; width: 100%; }
.cell-route { font-weight: 600; font-size: 0.88rem; }

.cola-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  min-width: 260px;
}

.section-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.batch-panel {
  margin-bottom: 1rem;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #f0f7ff 0%, #fff 55%);
}
.batch-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-end;
}
.batch-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: flex-end;
}
.batch-messenger-field {
  margin: 0;
  min-width: 220px;
}
.batch-messenger-field .select-ctl {
  min-width: 240px;
}
.batch-messenger-field .select-ctl.input-invalid {
  border-color: var(--danger, #dc2626);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}
.batch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.batch-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #dbeafe;
  background: #fff;
  border-radius: 8px;
  font-size: 0.86rem;
}
.muted-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.courier-toast { max-width: 420px; margin: 0 auto 1rem; }

.phone-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  padding: 0.5rem 0 2rem;
}

.phone-mock {
  position: relative;
  width: 340px;
  flex-shrink: 0;
  padding: 12px;
  border-radius: 42px;
  background: linear-gradient(160deg, #3a3a3c 0%, #1c1c1e 45%, #0f0f10 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 18px 50px rgba(15, 23, 42, 0.35),
    0 4px 12px rgba(15, 23, 42, 0.2);
}

.phone-side {
  position: absolute;
  background: #2a2a2c;
  border-radius: 2px;
}
.phone-side-left { left: -3px; width: 3px; }
.phone-side-right { right: -3px; width: 3px; }
.phone-mute { top: 96px; height: 22px; }
.phone-vol-up { top: 140px; height: 42px; }
.phone-vol-down { top: 192px; height: 42px; }
.phone-power { top: 160px; height: 64px; }

.phone-bezel {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 2px #111 inset;
}

.phone-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 96px;
  height: 26px;
  border-radius: 20px;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}
.phone-lens {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3b82f6, #1e3a5f 55%, #0b1220);
  box-shadow: 0 0 0 2px #111;
}

.phone-screen {
  position: relative;
  height: 640px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% -10%, #dbeafe 0%, transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--ink);
}

.phone-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 4px;
  font-size: 0.72rem;
  font-weight: 650;
  font-family: var(--font-ui);
}
.phone-sys { display: flex; align-items: center; gap: 5px; }
.phone-sig, .phone-wifi, .phone-batt {
  display: inline-block;
  background: var(--ink);
  opacity: 0.85;
}
.phone-sig {
  width: 14px;
  height: 8px;
  clip-path: polygon(0 100%, 25% 70%, 25% 100%, 50% 45%, 50% 100%, 75% 20%, 75% 100%, 100% 0, 100% 100%);
}
.phone-wifi {
  width: 12px;
  height: 9px;
  border-radius: 50% 50% 0 0;
  background: transparent;
  border: 2px solid var(--ink);
  border-bottom: 0;
  opacity: 0.85;
  transform: translateY(1px);
}
.phone-batt {
  width: 18px;
  height: 9px;
  border-radius: 2px;
  border: 1.5px solid var(--ink);
  background: transparent;
  position: relative;
  opacity: 0.85;
}
.phone-batt::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: var(--ink);
  border-radius: 0 1px 1px 0;
}
.phone-batt i {
  display: block;
  height: 100%;
  width: 70%;
  background: var(--ok);
  border-radius: 1px;
}

.mapp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem 0.45rem;
}
.mapp-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.mapp-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.72rem;
  color: #1a1a1b;
  background: linear-gradient(145deg, #e8c08a, var(--gold));
}
.mapp-brand strong {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.1;
}
.mapp-brand small {
  color: var(--muted);
  font-size: 0.7rem;
}
.mapp-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.68rem;
  color: var(--muted-2);
}
.mapp-pills b { color: var(--ink); }

.mapp-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0 0.75rem 0.5rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.mapp-tab {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 0.45rem 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-2);
  cursor: pointer;
}
.mapp-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.mapp-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.75rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.mapp-pane { display: flex; flex-direction: column; gap: 0.75rem; }
.mapp-pane[hidden] { display: none; }

.mapp-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted-2);
}
.mapp-empty strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.35rem;
  font-family: var(--font-ui);
}
.mapp-empty p { margin: 0; font-size: 0.82rem; }

.mapp-batch {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem 0.7rem 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.mapp-batch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  color: var(--muted-2);
}
.mapp-batch-head > div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mapp-batch-notes {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.mapp-card-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.mapp-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.mapp-card:hover {
  border-color: #93c5fd;
  background: #fff;
  transform: translateY(-1px);
}
.mapp-card:active { transform: scale(0.99); }
.mapp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.mapp-card-top code { font-size: 0.78rem; font-weight: 650; }
.mapp-card-route {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.mapp-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.mapp-card-cta {
  color: var(--primary);
  font-weight: 650;
  white-space: nowrap;
}

.mapp-sheet {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  animation: mapp-slide 0.22s ease-out;
}
.mapp-sheet[hidden] { display: none; }
@keyframes mapp-slide {
  from { transform: translateX(18%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
.mapp-sheet-inner {
  flex: 1;
  overflow-y: auto;
  padding: 2.4rem 0.95rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.mapp-back {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-ui);
  font-weight: 650;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.15rem;
}
.mapp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.mapp-sheet-head h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.15rem;
}
.mapp-route-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 650;
  font-size: 0.9rem;
}
.mapp-route-block .mapp-arrow {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
}
.mapp-route-block small {
  margin-top: 0.25rem;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
}
.mapp-muted {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted-2);
}
.mapp-sheet .field { margin: 0; }
.mapp-sheet .field .req { color: var(--danger); }
.mapp-primary {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.mapp-scan {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}
.mapp-scan p {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.mapp-scan-frame {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(217, 167, 110, 0.12)),
    repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(37, 99, 235, 0.05) 10px, rgba(37, 99, 235, 0.05) 11px);
}
.mapp-scan-frame span {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid var(--primary);
}
.mapp-scan-frame span:nth-child(1) { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.mapp-scan-frame span:nth-child(2) { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.mapp-scan-frame span:nth-child(3) { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.mapp-scan-frame span:nth-child(4) { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.phone-home {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.phone-home::after {
  content: '';
  width: 110px;
  height: 4px;
  border-radius: 4px;
  background: #1a1a1b;
  opacity: 0.35;
}

.phone-aside {
  max-width: 260px;
  padding: 0.25rem 0.5rem;
}
.phone-aside h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-ui);
  font-size: 1rem;
}
.phone-aside ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted-2);
  font-size: 0.88rem;
  line-height: 1.45;
}
.phone-aside-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .phone-aside { max-width: 100%; order: -1; }
  .phone-stage { justify-content: center; }
}

/* —— Seguimiento timeline —— */
.seg-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 1rem;
  align-items: stretch;
  min-height: 560px;
}
.seg-list { display: flex; flex-direction: column; margin-bottom: 0; min-height: 560px; }
.seg-list-scroll {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: calc(100vh - 280px);
  padding-right: 0.15rem;
}
.seg-order {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.seg-order:hover { border-color: #93c5fd; background: var(--primary-soft); }
.seg-order.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}
.seg-order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.seg-order-route {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.seg-order-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.seg-detail { margin-bottom: 0; min-height: 560px; }
.seg-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.seg-folio {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.seg-folio code {
  font-size: 1.05rem;
  font-weight: 700;
}
.seg-route {
  margin: 0.35rem 0 0;
  color: var(--muted-2);
  font-size: 0.9rem;
  font-weight: 600;
}
.seg-meta { margin-bottom: 0.85rem; }
.seg-items {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted-2);
}
.seg-tl-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tl-track {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem 0.35rem;
  position: relative;
}
.tl-track::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, #93c5fd, #e5e7eb);
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.75rem;
  padding: 0.35rem 0 1rem;
  cursor: pointer;
  outline: none;
}
.tl-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 800;
  z-index: 1;
  box-shadow: 0 0 0 4px #fff;
}
.tl-ok .tl-dot { border-color: var(--ok); color: var(--ok); }
.tl-warn .tl-dot { border-color: var(--warn); color: #b45309; }
.tl-danger .tl-dot { border-color: var(--danger); color: var(--danger); }
.tl-info .tl-dot { border-color: var(--info); color: var(--info); }

.tl-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tl-item:hover .tl-card,
.tl-item:focus .tl-card {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}
.tl-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: baseline;
}
.tl-card-top strong {
  font-size: 0.9rem;
  font-weight: 700;
}
.tl-card-top time {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}
.tl-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.tl-who {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-2);
  margin-right: 0.25rem;
}
.tl-chip {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.5rem;
  color: var(--muted-2);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tl-item:hover .tl-hint,
.tl-item:focus .tl-hint { opacity: 1; }

.tl-tooltip {
  position: absolute;
  left: 52px;
  bottom: calc(100% - 0.35rem);
  max-width: min(420px, 70vw);
  background: #1a1a1b;
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.4;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.tl-item:hover .tl-tooltip,
.tl-item:focus .tl-tooltip {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .seg-layout { grid-template-columns: 1fr; }
  .seg-list, .seg-detail { min-height: 0; }
  .seg-list-scroll { max-height: 280px; }
}

.kpi-card:nth-child(4) { border-top-color: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--line-2); background: var(--bg); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: var(--danger-text);
}
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg); }
.btn-rack { background: var(--rack); border-color: var(--rack); color: #fff; }
.btn-zone { background: var(--zone); border-color: var(--zone); color: #fff; }
.btn-aisle { background: var(--aisle); border-color: var(--aisle); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th, table.data td {
  text-align: left;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #fafafa;
}
table.data tbody tr:hover { background: #fafbfc; }
table.data a { font-weight: 600; text-decoration: none; }
table.data a:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid transparent;
}
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.danger { background: var(--danger-bg); color: var(--danger-text); }
.badge.info { background: var(--info-bg); color: #1e40af; }
.badge.tag {
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(160deg, rgba(243, 244, 246, 0.88) 0%, rgba(238, 242, 247, 0.82) 45%, rgba(226, 232, 240, 0.86) 100%),
    url("./assets/login-bg.jpg") center / cover no-repeat;
}
.auth-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 16px;
  padding: 1.85rem;
  box-shadow: 0 8px 32px rgba(26, 26, 27, 0.08), 0 1px 2px rgba(26, 26, 27, 0.04);
  backdrop-filter: blur(6px);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.auth-card h1 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.auth-card .hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 1.25rem; }
.auth-card .stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.demo-users {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}
.demo-users > strong {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.quick-logins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.quick-login {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.55rem 0.7rem;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font);
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
}
.quick-login:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.quick-login .ql-name {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--ink);
}
.quick-login .ql-role {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
}
.quick-logins .quick-login:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
}
.kpi-card:nth-child(2) { border-top-color: var(--zone); }
.kpi-card:nth-child(3) { border-top-color: var(--rack); }
.kpi-card .label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-card .value {
  font-family: var(--font-ui);
  font-size: 1.55rem;
  font-weight: 800;
  margin-top: 0.35rem;
  color: var(--ink);
}

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.25rem;
  border-left: 2px solid var(--line);
  margin-left: 0.4rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.95rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.timeline .ev {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.timeline .meta { font-size: 0.75rem; color: var(--muted); }

/* Consola operativa style home */
.home-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 720px;
}
.home-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.home-tile:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}
.home-ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.72rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(26, 26, 27, 0.12);
}
.home-ico.c-blue { background: var(--primary); }
.home-ico.c-green { background: var(--zone); }
.home-ico.c-orange { background: var(--rack); }
.home-ico.c-cyan { background: var(--aisle); }
.home-ico.c-purple { background: var(--purple); }
.home-ico.c-red { background: var(--danger); }
.home-tile .body { flex: 1; min-width: 0; }
.home-tile .code-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.home-tile h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.home-tile p {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}
.alert.err { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #fecaca; }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); border: 1px solid #a7f3d0; }

.qr-box { text-align: center; padding: 1rem; }
.qr-box img { max-width: 200px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem; }
.qr-box .folio {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.empty { color: var(--muted); font-size: 0.9rem; padding: 0.5rem 0; }

/* —— Campus / ubicaciones —— */
.loc-stats {
  display: flex;
  gap: 0.65rem;
}
.loc-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  min-width: 88px;
  text-align: center;
  box-shadow: var(--shadow);
}
.loc-stat strong {
  display: block;
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.loc-stat span {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.loc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem;
  margin-bottom: 1.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-2);
}
.loc-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.loc-legend .dot.campus { background: var(--primary); }
.loc-legend .dot.building { background: var(--purple); }
.loc-legend .dot.floor { background: var(--aisle); }
.loc-legend .dot.sector { background: var(--zone); }
.loc-legend .dot.office { background: var(--rack); }

.loc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
  align-items: start;
}
.loc-campus {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.loc-campus-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.2rem;
  color: #fff;
}
.loc-north .loc-campus-head {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
}
.loc-south .loc-campus-head {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #14b8a6 100%);
}
.loc-campus-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.loc-campus-head h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.loc-campus-head p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  opacity: 0.88;
}
.loc-campus-body { padding: 1rem 1.1rem 1.15rem; }
.loc-building {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--line);
}
.loc-building:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.loc-building h4 {
  margin: 0 0 0.65rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.loc-ico {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.loc-ico.building { background: var(--purple); }
.loc-ico.floor { background: var(--aisle); }
.loc-ico.sector { background: var(--zone); }

.loc-floors { display: flex; flex-direction: column; gap: 0.75rem; }
.loc-floor {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
}
.loc-floor-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.loc-sectors { display: flex; flex-direction: column; gap: 0.7rem; }
.loc-sector-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.loc-offices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.loc-office {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  box-shadow: 0 1px 2px rgba(26, 26, 27, 0.04);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.loc-office:hover {
  border-color: #bfdbfe;
  transform: translateY(-1px);
}
.loc-office-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.loc-office-code {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .loc-grid { grid-template-columns: 1fr; }
  .loc-stats { width: 100%; }
  .loc-stat { flex: 1; }
}

/* —— Plano 2D campus —— */
.plan-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: stretch;
  min-height: 560px;
}
.plan-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 0.85rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.plan-side-title {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.plan-campus-group { margin-bottom: 0.5rem; }
.plan-campus-name {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.plan-campus-name span {
  color: var(--primary);
  font-size: 0.72rem;
}
.plan-bldg-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-2);
  margin: 0.45rem 0 0.3rem 0.15rem;
}
.plan-floor-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
  font-family: var(--font);
}
.plan-floor-btn span {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.plan-floor-btn small {
  color: var(--muted);
  font-size: 0.72rem;
}
.plan-floor-btn:hover { border-color: #93c5fd; background: var(--primary-soft); }
.plan-floor-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}
.plan-legend-box {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.plan-leg-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-2);
  margin: 0.35rem 0;
}
.plan-leg-item i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid;
  display: inline-block;
}
.plan-leg-item i.corr {
  background: #e2e8f0;
  border-style: dashed;
  border-color: #64748b;
}

.plan-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 560px;
  overflow: hidden;
}
.plan-stage-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}
.plan-stage-bar strong {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.plan-stage-bar span {
  font-size: 0.8rem;
  color: var(--muted);
}
.plan-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-pill);
}
.plan-canvas {
  flex: 1;
  padding: 0.85rem;
  overflow: auto;
  background:
    radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.04), transparent 40%),
    #eef2f6;
}
.plan-svg {
  width: 100%;
  height: auto;
  max-height: 520px;
  min-height: 280px;
  display: block;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}
.plan-bldg-label {
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 700;
  fill: #64748b;
  letter-spacing: 0.04em;
}
.plan-corridor-label {
  font-family: var(--font-ui);
  font-size: 7.5px;
  font-weight: 700;
  fill: #64748b;
  letter-spacing: 0.08em;
}
.plan-sector-label {
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 800;
  fill: #fff;
  letter-spacing: 0.03em;
}
.plan-room {
  cursor: pointer;
}
.plan-room rect {
  transition: fill 0.15s ease, stroke-width 0.15s ease;
}
.plan-room:hover rect:first-child,
.plan-room:focus rect:first-child {
  fill: #eff6ff;
  stroke-width: 2;
}
.plan-room-name {
  font-family: var(--font);
  font-size: 7.5px;
  font-weight: 600;
  fill: #1a1a1b;
}
.plan-room-code {
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 600;
  fill: #2563eb;
}
.plan-compass {
  font-family: var(--font-ui);
  font-size: 7px;
  font-weight: 800;
  fill: #2563eb;
}

@media (max-width: 960px) {
  .plan-shell { grid-template-columns: 1fr; }
  .plan-sidebar { order: 2; }
  .plan-stage { order: 1; min-height: 420px; }
}

.toolbar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-areas: "top" "main";
  }
  .sidebar {
    display: none;
  }
  .search-fake { display: none; }
  .main { padding: 1rem; }
}

/* —— Modales —— */
body.modal-open { overflow: hidden; }
#modal-root { position: relative; z-index: 1000; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 27, 0.45);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-dialog {
  width: min(520px, 100%);
  max-height: min(88vh, 820px);
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(26, 26, 27, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.2s ease;
}
.modal-dialog.modal-wide { width: min(720px, 100%); }
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.modal-x {
  border: 0;
  background: var(--bg);
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted-2);
}
.modal-x:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body {
  padding: 1.15rem;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: #fafafa;
}
.modal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.modal-meta-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}
.modal-meta-item .lbl {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.modal-meta-item .val {
  font-weight: 700;
  font-size: 0.92rem;
}
.receipt-print h3 { margin: 0 0 0.5rem; font-family: var(--font-ui); }
.receipt-print p { margin: 0.25rem 0; color: var(--muted-2); }
.qr-preview { text-align: center; }
.qr-preview img { max-width: 200px; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem; }

/* —— Adjuntos mesa —— */
.attach-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.attach-box {
  border: 1px dashed #93c5fd;
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.5rem;
}
.attach-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.attach-file-btn { cursor: pointer; }
.attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.attach-empty {
  font-size: 0.84rem;
  color: var(--muted);
  padding: 0.35rem 0.15rem;
}
.attach-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
}
.attach-ico {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 800;
  flex-shrink: 0;
}
.attach-meta {
  flex: 1;
  min-width: 0;
}
.attach-meta strong {
  display: block;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attach-meta span {
  font-size: 0.72rem;
  color: var(--muted);
}
.attach-result {
  font-size: 0.82rem;
  color: var(--muted-2);
  margin: 0.5rem 0 0;
}
.attach-view { margin: 0 0 1rem; }
.attach-preview {
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.attach-preview img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.print-only { display: none; }
@media print {
  .sidebar, .topbar, .btn-row, .no-print, #modal-root .modal-backdrop { display: none !important; }
  .shell { display: block; }
  .print-only { display: block; }
  body { background: #fff; }
  body.modal-open #modal-root .modal-dialog {
    position: static;
    box-shadow: none;
    border: 0;
    max-height: none;
    width: 100%;
  }
  body.modal-open #modal-root .modal-backdrop {
    display: block !important;
    position: static;
    background: #fff;
    padding: 0;
  }
  body.modal-open #modal-root .modal-head .modal-x,
  body.modal-open #modal-root .modal-foot { display: none !important; }
}
