:root {
  --ink: #10202a;
  --muted: #66808d;
  --panel: rgba(255, 255, 255, 0.74);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(33, 91, 103, 0.16);
  --aqua: #13b8c8;
  --mint: #57d6a4;
  --coral: #ff7e67;
  --violet: #7c6ee6;
}

* {
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(87, 214, 164, 0.34), transparent 32rem),
    radial-gradient(circle at 86% 18%, rgba(19, 184, 200, 0.28), transparent 28rem),
    linear-gradient(135deg, #f7fffd 0%, #eef8fb 43%, #f8f3ff 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: #087f8c;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: rgba(15, 45, 55, 0.84);
  color: #f7fffd;
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.sidebar-backdrop,
.sidebar-close,
.mobile-menu-toggle,
.mobile-quick-nav {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 18px;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--aqua), var(--mint));
  box-shadow: inset 0 1px 8px rgba(255, 255, 255, 0.45), 0 12px 30px rgba(19, 184, 200, 0.28);
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 30px rgba(19, 184, 200, 0.2);
}

.nav-link {
  color: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.main {
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar-title {
  display: grid;
  gap: 4px;
}

.glass-card,
.table-wrap,
.metric,
.timeline-item {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(26, 65, 78, 0.08);
  backdrop-filter: blur(18px);
  border-radius: 8px;
}

.glass-card {
  padding: 18px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.table-searchbar {
  max-width: 360px;
  margin: 0 0 12px;
}

.table {
  margin-bottom: 0;
}

.table-wrap > .table,
.table-wrap > table {
  min-width: 760px;
}

.table-wrap th,
.table-wrap td {
  white-space: nowrap;
}

.table-wrap td p,
.table-wrap td .text-wrap {
  white-space: normal;
}

.table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  border-bottom-color: var(--line);
}

.btn {
  border-radius: 8px;
}

.btn[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn[data-icon]::before {
  content: attr(data-icon);
  line-height: 1;
}

.glass-card h1[data-icon],
.glass-card h2[data-icon],
.metric h2[data-icon],
.auth-card h1[data-icon],
.public-wrap h1[data-icon],
.topbar h1[data-icon] {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.glass-card h1[data-icon]::before,
.glass-card h2[data-icon]::before,
.metric h2[data-icon]::before,
.auth-card h1[data-icon]::before,
.public-wrap h1[data-icon]::before,
.topbar h1[data-icon]::before {
  content: attr(data-icon);
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(19, 184, 200, 0.22);
  border-radius: 8px;
  color: #087f8c;
  background: rgba(19, 184, 200, 0.1);
  font-size: 0.95rem;
  line-height: 1;
}

.btn-primary {
  --bs-btn-bg: #0f9fab;
  --bs-btn-border-color: #0f9fab;
  --bs-btn-hover-bg: #0c8791;
  --bs-btn-hover-border-color: #0c8791;
}

.btn-success {
  --bs-btn-bg: #24a86d;
  --bs-btn-border-color: #24a86d;
}

.form-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.form-label[data-icon] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.form-label[data-icon]::before {
  content: attr(data-icon);
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(19, 184, 200, 0.22);
  border-radius: 8px;
  color: #087f8c;
  background: rgba(19, 184, 200, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 0.92rem;
  line-height: 1;
}

.help-tip {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid rgba(19, 184, 200, 0.52);
  border-radius: 999px;
  background: rgba(19, 184, 200, 0.12);
  color: #087f8c;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: 1px;
  cursor: help;
}

.help-tip:hover,
.help-tip:focus {
  border-color: #0f9fab;
  background: rgba(19, 184, 200, 0.22);
  outline: 2px solid rgba(19, 184, 200, 0.18);
}

.popover {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(26, 65, 78, 0.16);
}

.popover-body {
  color: #334155;
  font-size: 0.86rem;
}

.form-control,
.form-select {
  border-radius: 8px;
  border-color: var(--line);
  background-color: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 0.18rem rgba(19, 184, 200, 0.16), 0 8px 24px rgba(19, 184, 200, 0.12);
}

.form-control[type="number"],
.form-control[data-money] {
  color: #0d6e49;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.form-control[data-warning] {
  border-color: rgba(255, 126, 103, 0.42);
  background: rgba(255, 247, 244, 0.9);
}

.badge-state {
  border-radius: 999px;
  padding: 0.48rem 0.7rem;
  font-weight: 700;
}

.metric {
  padding: 18px;
  min-height: 118px;
}

.metric small {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.15;
  margin-top: 8px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 12px 14px;
}

.quick-order-form .glass-card {
  position: relative;
}

.quick-order-new {
  padding: 14px;
  border: 1px dashed rgba(33, 91, 103, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.quick-order-action {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .75rem;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 12px;
  background: rgba(14, 165, 233, .08);
  font-weight: 700;
}

.quick-order-action--stack {
  display: grid;
  align-items: stretch;
  width: min(100%, 760px);
  gap: .32rem;
  border-style: solid;
  background: rgba(15, 23, 42, .04);
}

.quick-order-action--stack.is-alert {
  border-color: rgba(220, 38, 38, .46);
  background: rgba(254, 243, 199, .92);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .18);
  animation: attentionPulse 1.6s ease-in-out infinite;
}

.quick-order-action__hint {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.quick-order-decision {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .15rem;
  padding-top: .25rem;
}

.quick-order-decision__title {
  grid-column: 1 / -1;
  color: #b91c1c;
  font-weight: 800;
  font-size: .9rem;
}

.quick-order-choice {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: 0;
  padding: .55rem;
  border: 1px solid rgba(245, 158, 11, .5);
  border-radius: 10px;
  background: rgba(255, 255, 255, .76);
  cursor: pointer;
}

.quick-order-choice:has(input:checked) {
  border-color: rgba(22, 163, 74, .72);
  background: rgba(220, 252, 231, .82);
}

.quick-order-choice small {
  display: block;
  color: var(--muted);
  font-weight: 600;
}

@keyframes attentionPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .14);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .18);
  }
}

.equipment-type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 10px;
}

.equipment-type-card {
  position: relative;
  display: grid;
  min-height: 84px;
  gap: 6px;
  place-items: center;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.equipment-type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.equipment-type-card__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #087f8c;
  background: rgba(19, 184, 200, 0.12);
  border: 1px solid rgba(19, 184, 200, 0.24);
  font-size: 1.1rem;
}

.equipment-type-card__text {
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.equipment-type-card:hover {
  color: var(--ink);
  border-color: rgba(19, 184, 200, 0.38);
  box-shadow: 0 10px 24px rgba(19, 184, 200, 0.14);
  transform: translateY(-1px);
}

.equipment-type-card:has(input:checked) {
  color: var(--ink);
  border-color: var(--aqua);
  background: linear-gradient(145deg, rgba(19, 184, 200, 0.16), rgba(87, 214, 164, 0.14));
  box-shadow: 0 0 0 3px rgba(19, 184, 200, 0.12), 0 14px 28px rgba(19, 184, 200, 0.14);
}

.equipment-type-card:has(input:checked) .equipment-type-card__icon {
  color: #04282e;
  background: linear-gradient(145deg, var(--aqua), var(--mint));
  border-color: transparent;
}

.service-combo,
.entity-combo {
  position: relative;
}

.service-combo__menu,
.entity-combo__menu {
  position: absolute;
  z-index: 1080;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  box-shadow: 0 18px 38px rgba(26, 65, 78, 0.18);
}

.service-combo__option,
.entity-combo__option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  text-align: left;
}

.service-combo__option:hover,
.service-combo__option.is-active,
.entity-combo__option:hover,
.entity-combo__option.is-active {
  background: rgba(19, 184, 200, 0.14);
  color: #087f8c;
}

.service-combo__empty,
.entity-combo__empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.entity-combo__option small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.quote-item-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 84%, transparent);
}

.pos-search {
  position: relative;
}

.pos-search__results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  overflow: auto;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 18px 38px rgba(26, 65, 78, 0.18);
}

.pos-search__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.pos-search__item:hover,
.pos-search__item:focus {
  background: rgba(19, 184, 200, 0.14);
}

.pos-search__item small,
.pos-search__empty {
  display: block;
  color: var(--muted);
}

.pos-search__empty {
  padding: 12px;
}

.pos-cart-table td,
.pos-cart-table th {
  min-width: 110px;
}

.pos-total-box {
  display: grid;
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  text-align: right;
}

.pos-total-box strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.pos-ticket-frame {
  display: block;
  width: 100%;
  min-height: min(76vh, 760px);
  border: 0;
  background: #fff;
}

.modal-backdrop {
  z-index: 1060;
}

.modal {
  z-index: 1070;
}

.pos-payment-modal .modal-content,
.pos-ticket-modal .modal-content {
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(9, 31, 40, 0.24);
  backdrop-filter: blur(18px);
}

.pos-payment-modal .modal-header,
.pos-payment-modal .modal-footer,
.pos-ticket-modal .modal-header,
.pos-ticket-modal .modal-footer {
  border-color: var(--line);
}

.pos-payment-method {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.camera-scanner-wrap {
  max-width: 540px;
}

.camera-scanner {
  overflow: hidden;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.camera-scanner video {
  border-radius: 8px;
}

.status-recibida { background: #e9f8ff; color: #087f8c; }
.status-en_revision, .status-diagnosticada { background: #eef2ff; color: #4d45a8; }
.status-esperando_autorizacion, .status-esperando_refaccion { background: #fff7e6; color: #a06000; }
.status-autorizada, .status-reparada, .status-lista_para_entrega { background: #eafaf2; color: #17734a; }
.status-rechazada, .status-no_reparable, .status-cancelada { background: #fff0f0; color: #ad3030; }
.status-en_reparacion { background: #edfaff; color: #087f8c; }
.status-entregada { background: #eef9ef; color: #2b6d34; }
.status-garantia { background: #f5efff; color: #6a45a8; }

.guest-wrap,
.public-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 28px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(26, 65, 78, 0.14);
  backdrop-filter: blur(18px);
}

.print-only {
  display: none;
}

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1045;
    width: min(84vw, 300px);
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 0.2s ease;
    box-shadow: 18px 0 46px rgba(9, 31, 40, 0.24);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: block;
    pointer-events: none;
    opacity: 0;
    background: rgba(7, 23, 32, 0.36);
    transition: opacity 0.2s ease;
  }

  body.sidebar-open .sidebar-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .brand {
    align-items: flex-start;
    padding-right: 36px;
    position: relative;
  }

  .sidebar-close {
    position: absolute;
    top: 8px;
    right: 2px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.4rem;
    line-height: 1;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    width: max-content;
    align-items: center;
    justify-content: center;
    order: 1;
    flex: 0 0 auto;
  }

  .nav-link {
    padding: 12px;
  }

  .main {
    padding: 16px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    min-width: 0;
  }

  .mobile-quick-nav {
    position: fixed;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    z-index: 1035;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 42px rgba(9, 31, 40, 0.2);
    backdrop-filter: blur(18px);
  }

  .mobile-quick-nav__item {
    display: grid;
    min-width: 0;
    min-height: 54px;
    place-items: center;
    gap: 2px;
    padding: 6px 4px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
    text-decoration: none;
    line-height: 1.05;
  }

  .mobile-quick-nav__item:hover,
  .mobile-quick-nav__item.active {
    color: var(--ink);
    border-color: rgba(19, 184, 200, 0.34);
    background: rgba(19, 184, 200, 0.12);
  }

  .mobile-quick-nav__icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(19, 184, 200, 0.18), rgba(87, 214, 164, 0.2));
    font-size: 1.05rem;
  }

  .mobile-quick-nav__label {
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    /* Barra superior fija en movil: menu, rol, notificaciones, tema y salir
       quedan siempre visibles al hacer scroll. */
    position: sticky;
    top: 0;
    z-index: 1030;
    margin: -16px -16px 12px;
    padding: 8px 16px;
    background: var(--panel-strong);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }

  /* Menu a la izquierda, controles a la derecha en la misma fila superior;
     el titulo baja a su propia linea. Orden: rol, notificaciones, tema, salir. */
  .topbar-actions {
    order: 2;
    margin-left: auto;
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .topbar-title {
    order: 3;
    flex-basis: 100%;
    width: 100%;
  }

  /* Compacta los controles para que menu + rol + campana + tema + salir
     quepan en una sola fila superior. */
  .topbar-actions .btn-label {
    display: none;
  }

  .topbar-user {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .form-control,
  .form-select,
  .btn,
  textarea {
    font-size: 16px;
  }

  .glass-card {
    padding: 14px;
  }

  .table-wrap {
    margin-inline: -4px;
    border-radius: 8px;
  }

  .table-searchbar {
    max-width: none;
  }

  .table-wrap > .table,
  .table-wrap > table {
    min-width: 720px;
  }

  .equipment-type-grid {
    grid-template-columns: repeat(3, minmax(86px, 1fr));
  }

  .print-toolbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .print-toolbar .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .equipment-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .sidebar,
  .topbar,
  .mobile-quick-nav,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .app-shell {
    display: block;
  }

  .main {
    padding: 0;
  }
}

/* =======================================================================
   Selector de patron / clave de desbloqueo (registro de orden)
   Usa las variables del tema activo, asi luce coherente en los 5 temas
   y neon en Blueprint. Escribe su resultado en el hidden #password_equipo.
   ======================================================================= */
.pattern-lock {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(127, 160, 180, 0.06);
}

.pattern-lock__tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(127, 160, 180, 0.14);
  margin-bottom: 10px;
}

.pattern-lock__tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease;
}

.pattern-lock__tab:hover {
  color: var(--ink);
}

.pattern-lock__tab.is-active {
  background: var(--aqua);
  color: #04222a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.pattern-lock__tab:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 2px;
}

.pattern-grid {
  position: relative;
  width: min(220px, 100%);
  aspect-ratio: 1;
  margin: 4px auto 2px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  touch-action: none;
  user-select: none;
}

.pattern-grid__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.pattern-grid__lines polyline {
  fill: none;
  stroke: url(#patternStroke);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(63, 181, 240, 0.6));
}

.pattern-dot {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: rgba(127, 160, 180, 0.12);
  color: transparent;
  font-size: 0.85rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.pattern-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: opacity 0.12s ease;
}

.pattern-dot.is-on {
  border-color: var(--aqua);
  color: #eaf6ff;
  background: rgba(63, 181, 240, 0.28);
  box-shadow: 0 0 0 4px rgba(63, 181, 240, 0.18), 0 0 16px rgba(63, 181, 240, 0.55);
  transform: scale(1.05);
}

.pattern-dot.is-on::after {
  opacity: 0;
}

.pattern-dot:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 3px;
}

.pattern-lock__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.pattern-lock__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.pattern-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
  max-width: 220px;
}

.pattern-keypad button {
  border: 1px solid var(--line);
  background: rgba(127, 160, 180, 0.1);
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.pattern-keypad button:hover {
  border-color: var(--aqua);
  background: rgba(63, 181, 240, 0.14);
}

.pattern-keypad button:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 2px;
}

/* Notificaciones: campana con contador y elemento no leido. */
.notif-bell {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}

.notif-item.is-unread {
  background: rgba(19, 184, 200, 0.1);
  border-radius: 8px;
}

/* Desbloqueo del equipo (ficha de orden): el patron se dibuja en negro, asi
   que va sobre fondo claro para verse bien en cualquier tema. */
.unlock-box {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  line-height: 0;
}

.unlock-code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ink);
}

/* Botones de accion de la orden: en movil se apilan verticalmente y todos
   quedan del mismo ancho/alto para una linea de acciones uniforme. */
@media (max-width: 720px) {
  .order-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .order-actions > .btn,
  .order-actions > .dropdown {
    width: 100%;
  }

  .order-actions > .dropdown > .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Panel del escaner de codigo de barras (inventario). */
.barcode-scan-panel {
  width: min(360px, 100%);
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(127, 160, 180, 0.06);
}

.barcode-scan-reader {
  overflow: hidden;
  min-height: 200px;
  border-radius: 8px;
  background: #000;
}

.barcode-scan-reader video {
  border-radius: 8px;
}

/* Ficha de orden en escritorio: las tarjetas se reparten en 2 columnas
   balanceadas (masonry) para no amontonarlas en una columna angosta.
   En pantallas < 1200px queda una sola columna (igual que en movil). */
@media (min-width: 1200px) {
  .orden-detalle {
    column-count: 2;
    column-gap: 1rem;
  }

  .orden-detalle > .glass-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
  }
}
