.blocking-alert {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 27, 51, 0.48);
  backdrop-filter: blur(3px);
}

.blocking-alert-card {
  position: relative;
  width: min(520px, 100%);
  padding: 42px 46px 38px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: #ad303c;
  color: #fff;
  text-align: center;
  box-shadow: 0 28px 75px rgba(44, 8, 13, 0.42);
}

.blocking-alert-card h2 {
  margin: 14px 0 10px;
  font-size: 28px;
  letter-spacing: -0.025em;
}

.blocking-alert-card p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
}

.blocking-alert-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 3px solid #fff;
  border-radius: 50%;
  font-size: 32px;
  font-weight: 900;
}

.blocking-alert-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.blocking-alert-close:hover,
.blocking-alert-close:focus {
  background: #fff;
  color: #ad303c;
  outline: none;
}

.data-table tr.row-in-use td,
.cell-input.row-in-use {
  background: #fff4ce;
}

.data-table tr.row-in-use .row-number {
  color: #8a6500;
  font-weight: 900;
  box-shadow: inset 4px 0 0 #f6b900;
}

.shift-header label {
  grid-template-columns: auto minmax(320px, 430px);
}

.topbar-presence {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(43vw, 760px);
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: safe center;
  gap: 7px;
  padding: 4px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  transform: translate(-50%, -50%);
}

.online-presence-label,
.online-person {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.online-presence-label {
  gap: 6px;
  color: #507087;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.online-presence-label i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a36a;
  box-shadow: 0 0 0 3px rgba(22, 163, 106, 0.13);
}

.online-person {
  gap: 6px;
  min-width: 0;
  padding: 4px 9px 4px 5px;
  border: 1px solid hsl(var(--presence-h) 45% 74%);
  border-radius: 999px;
  background: hsl(var(--presence-h) 68% 95%);
  color: hsl(var(--presence-h) 72% 27%);
  font-size: 11px;
}

.online-person strong {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-person-avatar {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  background: hsl(var(--presence-h) 65% 84%);
  color: hsl(var(--presence-h) 78% 25%);
  font-size: 10px;
  font-weight: 900;
}

.online-presence-empty {
  color: #71879a;
  font-size: 11px;
  font-weight: 700;
}

#logoutButton {
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

#logoutButton:hover {
  border-color: #22856a;
  background: #eefaf6;
  color: #167158;
  box-shadow: 0 8px 20px rgba(34, 133, 106, 0.22);
  transform: scale(1.12);
}

#logoutButton:focus-visible {
  border-color: #22856a;
  outline: 3px solid rgba(34, 133, 106, 0.2);
  outline-offset: 2px;
}

#logoutButton:active {
  background: #22856a;
  color: #fff;
  transform: scale(0.94);
}

#logoutButton.is-logging-out,
#logoutButton.is-logging-out:hover,
#logoutButton.is-logging-out:disabled {
  border-color: #22856a;
  background: #22856a;
  color: #fff;
  opacity: 1;
  cursor: progress;
  box-shadow: 0 8px 22px rgba(34, 133, 106, 0.32);
  transform: scale(1.06);
}

.user-card {
  grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding-block: 15px;
}

.user-card-identity {
  min-width: 0;
}

.user-card-identity h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-inactive {
  padding: 3px 6px;
  border-radius: 999px;
  background: #fbeaec;
  color: #a62f3a;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.user-blocked {
  padding: 3px 6px;
  border-radius: 999px;
  background: #ad303c;
  color: #fff;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.user-location-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.user-location-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid #d6e4eb;
  border-radius: 999px;
  background: #f2f7f9;
  color: #31536b;
  font-size: 9px;
  font-weight: 800;
}

.user-location-empty {
  color: #8a98a5;
  font-size: 9px;
  font-weight: 700;
}

.user-card-role {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.user-card-role strong {
  color: #213a52;
  font-size: 10px;
  letter-spacing: 0.07em;
}

.role-badge {
  min-width: 112px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
}

.role-peritador {
  border-color: #b9d8f3;
  background: #eaf5ff;
  color: #17669f !important;
}

.role-contabilidad {
  border-color: #d9c9f3;
  background: #f4effc;
  color: #6c3ca0 !important;
}

.role-administrador {
  border-color: #b9dfd2;
  background: #eaf8f3;
  color: #16745a !important;
}

.user-card-role span {
  color: #68798b;
  font-size: 10px;
  font-weight: 800;
}

.user-card .card-actions {
  justify-self: end;
}

.user-block-button.is-blocked {
  border-color: #ad303c;
  background: #ad303c;
  color: #fff;
  box-shadow: 0 5px 13px rgba(173, 48, 60, 0.2);
}

button {
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease, filter 150ms ease;
}

button:hover:not(:disabled) {
  filter: brightness(0.98);
  transform: translateY(-2px);
}

button:active:not(:disabled) {
  filter: brightness(0.94);
  transform: translateY(0) scale(0.96);
}

button.is-processing:disabled {
  opacity: 0.72;
  cursor: progress;
  filter: saturate(0.8);
  transform: scale(0.96);
}

.mini-button:hover:not(:disabled) {
  border-color: #9db3c4;
  background: #f3f7fa;
  box-shadow: 0 5px 13px rgba(22, 52, 78, 0.12);
}

button.user-block-button.is-blocked:hover:not(:disabled) {
  border-color: #8f2230;
  background: #8f2230;
  color: #fff;
  box-shadow: 0 6px 15px rgba(143, 34, 48, 0.28);
}

.connections-filters {
  flex-wrap: wrap;
}

.connections-filters .live-badge {
  margin-left: auto;
  align-self: center;
}

.connections-panel {
  margin-top: 18px;
}

.connections-table {
  min-width: 950px;
}

.connections-table th,
.connections-table td,
.connections-table td:not(:first-child) {
  text-align: center;
  vertical-align: middle;
}

.connections-table th:first-child,
.connections-table td:first-child {
  text-align: left;
}

.connection-user {
  color: #0757a6;
  font-weight: 900;
}

.connection-role {
  display: inline-flex;
  justify-content: center;
  font-size: 8px;
}

.connection-duration {
  color: #173b59;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.connection-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.connection-status.is-active {
  background: #e8f8f2;
  color: #137357;
}

.connection-status.is-active i {
  background: #20a879;
  box-shadow: 0 0 0 3px rgba(32, 168, 121, 0.14);
}

.connection-status.is-closed {
  background: #eef2f5;
  color: #667789;
}

.connection-status.is-closed i {
  background: #8b9aa7;
}

.connections-empty {
  padding: 34px !important;
  color: #718191;
  text-align: center !important;
}

@media (max-width: 720px) {
  .user-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .user-card-role {
    grid-column: 1;
    justify-items: start;
    text-align: left;
  }
  .user-card .card-actions {
    grid-column: 2;
    grid-row: 1 / 3;
    flex-direction: column;
    align-items: stretch;
  }
  .sidebar nav {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  }
  .connections-filters .live-badge {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
}

@media (max-width: 1200px) {
  .topbar-presence {
    width: 36vw;
  }
}

@media (max-width: 850px) {
  .topbar-presence {
    width: 32vw;
  }
  .online-presence-label {
    display: none;
  }
  .online-person strong {
    max-width: 85px;
  }
}

@media (max-width: 600px) {
  .topbar-presence {
    width: 30vw;
    padding-inline: 3px;
  }
  .online-person {
    padding-right: 6px;
  }
  .online-person strong {
    max-width: 65px;
  }
  .shift-header label {
    grid-template-columns: 90px 1fr;
  }
  .blocking-alert-card {
    padding: 38px 25px 30px;
  }

  .blocking-alert-card h2 {
    font-size: 24px;
  }

  .blocking-alert-card p {
    font-size: 14px;
  }
}
